diff --git a/utils/Constants.ts b/utils/Constants.ts index 023febf..b868f4e 100644 --- a/utils/Constants.ts +++ b/utils/Constants.ts @@ -139,6 +139,16 @@ export const BotBadgeType = (data: Bot) => { votes: { label: '하트', status: `${formatNumber(data.votes)}` + }, + status: { + label: '상태', + status: Status[data.status]?.text || '알 수 없음', + color: { + online: '34d399', + idle: 'fcd34d', + dnd: 'ef4444', + streaming: '8b5cf6' + }[data.status] || '6b7280' } } } diff --git a/utils/Yup.ts b/utils/Yup.ts index d7eaca6..a9bfe4e 100644 --- a/utils/Yup.ts +++ b/utils/Yup.ts @@ -41,7 +41,7 @@ type ImageSize = '128' | '256' | '512' export const WidgetOptionsSchema: Yup.SchemaOf = Yup.object({ id: Yup.string().required(), ext: Yup.mixed().oneOf(['svg']).required(), - type: Yup.mixed().oneOf(['votes', 'servers']).required(), + type: Yup.mixed().oneOf(['votes', 'servers', 'status']).required(), scale: Yup.number().positive().min(0.5).max(3).required(), style: Yup.mixed<'flat'|'classic'>().oneOf(['flat', 'classic']).default('flat') }) @@ -54,7 +54,7 @@ interface WidgetOptions { style: 'flat' | 'classic' } -type widgetType = 'votes' | 'servers' +type widgetType = 'votes' | 'servers' | 'status' type widgetExt = 'svg' export const PageCount = Yup.number().integer().positive().required()