feat: Add embed colors (default, fail, success)

This commit is contained in:
Siwoo Jeon 2024-10-06 15:57:34 +09:00
parent c8fec5b0c7
commit 8e9855f6eb
Signed by: migan
GPG key ID: 036E9A8C5E8E48DA
7 changed files with 19 additions and 10 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "muffinbot", "name": "muffinbot",
"version": "4.0.0-pudding.d241004b", "version": "4.0.0-pudding.d241005a",
"main": "dist/index.js", "main": "dist/index.js",
"private": true, "private": true,
"dependencies": { "dependencies": {

View file

@ -17,13 +17,17 @@ const release = version
.split('.')[1] .split('.')[1]
container.config = config container.config = config
container.embedColor = 0xaddb87
container.prefix = config.bot.prefix container.prefix = config.bot.prefix
container.version = version container.version = version
container.database = new PrismaClient() container.database = new PrismaClient()
container.dokdoAliases = ['dokdo', 'dok', 'Dokdo', 'Dok', '테스트'] container.dokdoAliases = ['dokdo', 'dok', 'Dokdo', 'Dok', '테스트']
container.chatBot = new ChatBot(container.database) 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')) { if (release.startsWith('e')) {
container.channel = 'EXPERIMENTAL' container.channel = 'EXPERIMENTAL'
@ -80,7 +84,11 @@ declare module '@sapphire/framework' {
config: Config config: Config
channel: 'EXPERIMENTAL' | 'DEV' | 'PREVIEW' | 'RELEASE' channel: 'EXPERIMENTAL' | 'DEV' | 'PREVIEW' | 'RELEASE'
lastUpdated: Date lastUpdated: Date
embedColor: number embedColors: {
default: number
fail: number
success: number
}
} }
} }

View file

@ -90,7 +90,7 @@ class DeleteLearnCommand extends Command {
title: '삭제', title: '삭제',
description: `${codeBlock('md', deleteDataList.join('\n'))}`, description: `${codeBlock('md', deleteDataList.join('\n'))}`,
timestamp: new Date().toISOString(), timestamp: new Date().toISOString(),
color: this.container.embedColor, color: this.container.embedColors.default,
}, },
], ],
components: [ components: [

View file

@ -63,7 +63,7 @@ class HelpCommand extends Command {
footer: { footer: {
text: `머핀봇 버전: ${this.container.version}`, text: `머핀봇 버전: ${this.container.version}`,
}, },
color: this.container.embedColor, color: this.container.embedColors.default,
timestamp: new Date().toISOString(), timestamp: new Date().toISOString(),
}, },
], ],
@ -110,6 +110,7 @@ class HelpCommand extends Command {
text: `머핀봇 버전: ${this.container.version}`, text: `머핀봇 버전: ${this.container.version}`,
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString(),
color: this.container.embedColors.default,
}, },
], ],
}) })

View file

@ -22,7 +22,7 @@ class InformationCommand extends Command {
embeds: [ embeds: [
{ {
title: `${this.container.client.user?.username}의 정ㅂ보`, title: `${this.container.client.user?.username}의 정ㅂ보`,
color: this.container.embedColor, color: this.container.embedColors.default,
fields: [ fields: [
{ {
name: '구동ㅎ환경', name: '구동ㅎ환경',

View file

@ -48,7 +48,7 @@ class ListCommand extends Command {
'md', 'md',
list.map(item => `- ${item}`).join('\n'), list.map(item => `- ${item}`).join('\n'),
)}`, )}`,
color: this.container.embedColor, color: this.container.embedColors.default,
timestamp: new Date().toISOString(), timestamp: new Date().toISOString(),
}, },
], ],

View file

@ -38,7 +38,7 @@ class DeleteLearnHandler extends InteractionHandler {
{ {
title: '삭제', title: '삭제',
description: '아무것도 삭제하지 않았어요.', description: '아무것도 삭제하지 않았어요.',
color: 0x00ff00, color: this.container.embedColors.fail,
}, },
], ],
components: [], components: [],
@ -60,7 +60,7 @@ class DeleteLearnHandler extends InteractionHandler {
title: '삭제', title: '삭제',
description: `${Number(itemId[0]!)}번을 정상적으로 삭제하ㅇ였어요.`, description: `${Number(itemId[0]!)}번을 정상적으로 삭제하ㅇ였어요.`,
timestamp: new Date().toISOString(), timestamp: new Date().toISOString(),
color: this.container.embedColor, color: this.container.embedColors.success,
}, },
], ],
components: [], components: [],