/
GeneralCommands.ts
40 lines (33 loc) · 1.34 KB
/
GeneralCommands.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import Discord from 'discord.js'
import Bot from "../../Bot"
import AUTH from '../../user_creds.json'
export default class BotGeneralCommands {
static redoLastAction(trigger: string) {
let bot: Bot = globalThis.bot
bot.preliminary(trigger, 'Redo command', true)
if (bot.lastMessage === null)
return bot.context.channel.send(`I haven't done anything yet though!`)
else if (bot.lastMessage.toString().startsWith('redoin, ')) {
bot.lastMessage =
new Discord.Message(bot,
{ content: bot.lastMessage.toString().substring(8) },
bot.context.channel)
}
return bot.context.channel.send('redoin, ' + bot.lastMessage.toString())
}
static async killBot(adminOnly = true, trigger: string) {
let bot: Bot = globalThis.bot
bot.preliminary(trigger, 'Bot kill', true)
if (adminOnly) {
if (bot.context.author.id === AUTH.you.admin_user_id) {
await bot.context.channel.send('Yes master. ✅')
process.exit(69)
} else {
bot.context.channel.send(`You can't quite tell me to, ${bot.context.author.username}. `)
}
} else {
await bot.context.channel.send('Restarting.')
process.exit(100)
}
}
}