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",
"version": "4.0.0-pudding.d241004b",
"version": "4.0.0-pudding.d241005a",
"main": "dist/index.js",
"private": true,
"dependencies": {

View file

@ -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
}
}
}

View file

@ -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: [

View file

@ -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,
},
],
})

View file

@ -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: '구동ㅎ환경',

View file

@ -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(),
},
],

View file

@ -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: [],