chore: Rename variable name

This commit is contained in:
Siwoo Jeon 2024-09-28 12:48:35 +09:00
parent 9821bac66a
commit d7faeac384
Signed by: migan
GPG key ID: 036E9A8C5E8E48DA
4 changed files with 11 additions and 11 deletions

View file

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

View file

@ -25,13 +25,13 @@ container.chatBot = new ChatBot(container.database)
container.lastUpdated = new Date('2024-09-28') container.lastUpdated = new Date('2024-09-28')
if (release.startsWith('e')) { if (release.startsWith('e')) {
container.release = 'EXPERIMENTAL' container.channel = 'EXPERIMENTAL'
} else if (release.startsWith('d')) { } else if (release.startsWith('d')) {
container.release = 'DEV' container.channel = 'DEV'
} else if (release.startsWith('p')) { } else if (release.startsWith('p')) {
container.release = 'PREVIEW' container.channel = 'PREVIEW'
} else { } else {
container.release = 'RELEASE' container.channel = 'RELEASE'
} }
export default class MuffinBot extends SapphireClient { export default class MuffinBot extends SapphireClient {
@ -58,11 +58,11 @@ export default class MuffinBot extends SapphireClient {
} }
public override async login(): Promise<string> { public override async login(): Promise<string> {
if (container.release === 'RELEASE') await container.chatBot.train(this) if (container.channel === 'RELEASE') await container.chatBot.train(this)
else else
container.logger.info( container.logger.info(
'[MuffinBot] 해당 채널은 RELEASE 채널이 아니라서 학습 기능이 꺼졌습니다.\n' + '[MuffinBot] 해당 채널은 RELEASE 채널이 아니라서 학습 기능이 꺼졌습니다.\n' +
`현재 채널: ${container.release}`, `현재 채널: ${container.channel}`,
) )
return super.login(config.bot.token) return super.login(config.bot.token)
} }
@ -76,7 +76,7 @@ declare module '@sapphire/framework' {
version: string version: string
dokdoAliases: string[] dokdoAliases: string[]
config: Config config: Config
release: 'EXPERIMENTAL' | 'DEV' | 'PREVIEW' | 'RELEASE' channel: 'EXPERIMENTAL' | 'DEV' | 'PREVIEW' | 'RELEASE'
lastUpdated: Date lastUpdated: Date
} }
} }

View file

@ -29,7 +29,7 @@ class InformationCommand extends Command {
}, },
{ {
name: '채ㄴ널', name: '채ㄴ널',
value: this.container.release.toLowerCase(), value: this.container.channel.toLowerCase(),
inline: true, inline: true,
}, },
{ {

View file

@ -14,7 +14,7 @@ class MessageCreateListener extends Listener {
}) })
if (msg.author.bot) return if (msg.author.bot) return
if (msg.content.startsWith(prefix)) { if (msg.content.startsWith(prefix)) {
if (this.container.release !== 'RELEASE') { if (this.container.channel !== 'RELEASE') {
await msg.reply({ await msg.reply({
embeds: [ embeds: [
{ {
@ -24,7 +24,7 @@ class MessageCreateListener extends Listener {
`만약 오류가 발견되면 ${(await this.container.client.users.fetch(this.container.config.bot.owner_ID)).username}님에게 알려주세요.\n`, `만약 오류가 발견되면 ${(await this.container.client.users.fetch(this.container.config.bot.owner_ID)).username}님에게 알려주세요.\n`,
color: 0xff0000, color: 0xff0000,
footer: { footer: {
text: `현재 브랜치: ${this.container.release.toLowerCase()} 버전: ${this.container.version}`, text: `현재 채널: ${this.container.channel.toLowerCase()} 버전: ${this.container.version}`,
}, },
}, },
], ],