.
This commit is contained in:
parent
f3bbbdc532
commit
785db5431b
2 changed files with 19 additions and 11 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "muffin-ai-arujak",
|
||||
"version": "2.0.0-81-oreo",
|
||||
"version": "2.0.0-82-oreo",
|
||||
"main": "dist/index.js",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -57,24 +57,32 @@ export default class MuffinAI extends Client {
|
|||
|
||||
console.log(`먹힐 준비 완료`)
|
||||
}).on('messageCreate', async msg => {
|
||||
const args: string[] = msg.content
|
||||
.slice(prefix.length)
|
||||
.trim()
|
||||
.split(/ +/g)
|
||||
|
||||
if (NODE_ENV === 'development') console.log(args)
|
||||
if (msg.author.bot) return
|
||||
if (msg.content.startsWith('머핀아 ')) {
|
||||
if (msg.channel instanceof TextChannel) {
|
||||
await msg.channel.sendTyping()
|
||||
this.chatBot //
|
||||
.getResponse(msg)
|
||||
.then(response => {
|
||||
msg.channel.send(response)
|
||||
})
|
||||
const command = this.#modules.get(args.shift()!.toLowerCase())
|
||||
|
||||
if (command) {
|
||||
if (command.noPerm && msg.author.id !== config.bot.owner_ID)
|
||||
return await noPerm(msg)
|
||||
|
||||
command.execute(msg, args)
|
||||
} else {
|
||||
const response = await this.chatBot.getResponse(msg)
|
||||
await msg.channel.send(response)
|
||||
}
|
||||
}
|
||||
} else if (msg.content.startsWith(prefix)) {
|
||||
if (msg.channel instanceof TextChannel) if (msg.channel.nsfw) return
|
||||
await msg.channel.sendTyping()
|
||||
|
||||
const args: string[] = msg.content
|
||||
.slice(prefix.length)
|
||||
.trim()
|
||||
.split(/ +/g)
|
||||
if (NODE_ENV === 'development') console.log(args)
|
||||
const command = this.#modules.get(args.shift()!.toLowerCase())
|
||||
if (!command) return
|
||||
if (command.noPerm && msg.author.id !== config.bot.owner_ID)
|
||||
|
|
Loading…
Reference in a new issue