10 |
|
|
11 |
export async function notAFK(client: DiscordClient, msg: Message | CommandInteraction, data: any) { |
export async function notAFK(client: DiscordClient, msg: Message | CommandInteraction, data: any) { |
12 |
client.db.get('DELETE FROM afk WHERE user_id = ?', [msg.member!.user.id], async (err: any) => { |
client.db.get('DELETE FROM afk WHERE user_id = ?', [msg.member!.user.id], async (err: any) => { |
13 |
await msg.channel!.send({ |
await msg.reply({ |
14 |
embeds: [ |
embeds: [ |
15 |
new MessageEmbed() |
new MessageEmbed() |
16 |
.setDescription('You\'re no longer AFK. You had **' + data.mentions + '** mentions in the servers where SudoBot is joined.') |
.setDescription('You\'re no longer AFK. You had **' + data.mentions + '** mentions in the servers where SudoBot is joined.') |
30 |
} |
} |
31 |
|
|
32 |
client.db.get('INSERT INTO afk(user_id, date, mentions, reason) VALUES(?, ?, ?, ?)', [msg.member!.user.id, new Date().toISOString(), '0', reason === undefined ? '' : reason], async (err: any) => { |
client.db.get('INSERT INTO afk(user_id, date, mentions, reason) VALUES(?, ?, ?, ?)', [msg.member!.user.id, new Date().toISOString(), '0', reason === undefined ? '' : reason], async (err: any) => { |
33 |
await msg.channel!.send({ |
await msg.reply({ |
34 |
embeds: [ |
embeds: [ |
35 |
new MessageEmbed() |
new MessageEmbed() |
36 |
.setDescription('You\'re AFK now.' + (reason === undefined ? '' : ` Your status has been updated to: **${reason.replace(/\*/g, '\\*')}**`)) |
.setDescription('You\'re AFK now.' + (reason === undefined ? '' : ` Your status has been updated to: **${reason.replace(/\*/g, '\\*')}**`)) |