From 8e9855f6eb25a45cd6c3d081e33e2acc39e70fa5 Mon Sep 17 00:00:00 2001 From: Siwoo Jeon Date: Sun, 6 Oct 2024 15:57:34 +0900 Subject: [PATCH] feat: Add embed colors (default, fail, success) --- package.json | 2 +- src/Client.ts | 14 +++++++++++--- src/Commands/deleteLearn.ts | 2 +- src/Commands/help.ts | 3 ++- src/Commands/information.ts | 2 +- src/Commands/list.ts | 2 +- src/interaction-handlers/deleteLearn.ts | 4 ++-- 7 files changed, 19 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 12a0e94..26b1c3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "muffinbot", - "version": "4.0.0-pudding.d241004b", + "version": "4.0.0-pudding.d241005a", "main": "dist/index.js", "private": true, "dependencies": { diff --git a/src/Client.ts b/src/Client.ts index 0f43e1a..8cab767 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -17,13 +17,17 @@ const release = version .split('.')[1] container.config = config -container.embedColor = 0xaddb87 container.prefix = config.bot.prefix container.version = version container.database = new PrismaClient() container.dokdoAliases = ['dokdo', 'dok', 'Dokdo', 'Dok', '테스트'] container.chatBot = new ChatBot(container.database) -container.lastUpdated = new Date('2024-10-04') +container.lastUpdated = new Date('2024-10-05') +container.embedColors = { + default: 0xaddb87, + fail: 0xff0000, + success: 0x00ff00, +} if (release.startsWith('e')) { container.channel = 'EXPERIMENTAL' @@ -80,7 +84,11 @@ declare module '@sapphire/framework' { config: Config channel: 'EXPERIMENTAL' | 'DEV' | 'PREVIEW' | 'RELEASE' lastUpdated: Date - embedColor: number + embedColors: { + default: number + fail: number + success: number + } } } diff --git a/src/Commands/deleteLearn.ts b/src/Commands/deleteLearn.ts index 19cfddc..1c1db79 100644 --- a/src/Commands/deleteLearn.ts +++ b/src/Commands/deleteLearn.ts @@ -90,7 +90,7 @@ class DeleteLearnCommand extends Command { title: '삭제', description: `${codeBlock('md', deleteDataList.join('\n'))}`, timestamp: new Date().toISOString(), - color: this.container.embedColor, + color: this.container.embedColors.default, }, ], components: [ diff --git a/src/Commands/help.ts b/src/Commands/help.ts index 40a61ad..02a2ced 100644 --- a/src/Commands/help.ts +++ b/src/Commands/help.ts @@ -63,7 +63,7 @@ class HelpCommand extends Command { footer: { text: `머핀봇 버전: ${this.container.version}`, }, - color: this.container.embedColor, + color: this.container.embedColors.default, timestamp: new Date().toISOString(), }, ], @@ -110,6 +110,7 @@ class HelpCommand extends Command { text: `머핀봇 버전: ${this.container.version}`, }, timestamp: new Date().toISOString(), + color: this.container.embedColors.default, }, ], }) diff --git a/src/Commands/information.ts b/src/Commands/information.ts index 242a515..c28e27d 100644 --- a/src/Commands/information.ts +++ b/src/Commands/information.ts @@ -22,7 +22,7 @@ class InformationCommand extends Command { embeds: [ { title: `${this.container.client.user?.username}의 정ㅂ보`, - color: this.container.embedColor, + color: this.container.embedColors.default, fields: [ { name: '구동ㅎ환경', diff --git a/src/Commands/list.ts b/src/Commands/list.ts index 06f5d49..48efab8 100644 --- a/src/Commands/list.ts +++ b/src/Commands/list.ts @@ -48,7 +48,7 @@ class ListCommand extends Command { 'md', list.map(item => `- ${item}`).join('\n'), )}`, - color: this.container.embedColor, + color: this.container.embedColors.default, timestamp: new Date().toISOString(), }, ], diff --git a/src/interaction-handlers/deleteLearn.ts b/src/interaction-handlers/deleteLearn.ts index bb8c363..42bc5ae 100644 --- a/src/interaction-handlers/deleteLearn.ts +++ b/src/interaction-handlers/deleteLearn.ts @@ -38,7 +38,7 @@ class DeleteLearnHandler extends InteractionHandler { { title: '삭제', description: '아무것도 삭제하지 않았어요.', - color: 0x00ff00, + color: this.container.embedColors.fail, }, ], components: [], @@ -60,7 +60,7 @@ class DeleteLearnHandler extends InteractionHandler { title: '삭제', description: `${Number(itemId[0]!)}번을 정상적으로 삭제하ㅇ였어요.`, timestamp: new Date().toISOString(), - color: this.container.embedColor, + color: this.container.embedColors.success, }, ], components: [],