1 |
const { MessageEmbed } = require("discord.js"); |
import { CommandInteraction, GuildMember, Interaction, Message } from 'discord.js'; |
2 |
const { clearTimeoutv2, getTimeout, getTimeouts } = require("../src/setTimeout"); |
import BaseCommand from '../../utils/structures/BaseCommand'; |
3 |
|
import DiscordClient from '../../client/Client'; |
4 |
|
import CommandOptions from '../../types/CommandOptions'; |
5 |
|
import InteractionOptions from '../../types/InteractionOptions'; |
6 |
|
import MessageEmbed from '../../client/MessageEmbed'; |
7 |
|
import Help from '../../utils/help'; |
8 |
|
import { clearTimeoutv2, getTimeout, getTimeouts } from '../../utils/setTimeout'; |
9 |
|
|
10 |
|
export default class DelQueueCommand extends BaseCommand { |
11 |
|
constructor() { |
12 |
|
super('delqueue', 'automation', []); |
13 |
|
} |
14 |
|
|
15 |
module.exports = { |
async run(client: DiscordClient, msg: Message, options: CommandOptions) { |
16 |
async handle(msg, cm) { |
if (options.args[0] === undefined) { |
|
if (cm.args[0] === undefined) { |
|
17 |
await msg.reply({ |
await msg.reply({ |
18 |
embeds: [ |
embeds: [ |
19 |
new MessageEmbed() |
new MessageEmbed() |
25 |
return; |
return; |
26 |
} |
} |
27 |
|
|
28 |
const timeout = await getTimeout(parseInt(cm.args[0])); |
const timeout = await getTimeout(parseInt(options.args[0])); |
29 |
console.log(getTimeouts()); |
console.log(getTimeouts()); |
30 |
|
|
31 |
if (!timeout || timeout.row.guild_id !== msg.guild.id) { |
if (!timeout || timeout.row.guild_id !== msg.guild!.id) { |
32 |
await msg.reply({ |
await msg.reply({ |
33 |
embeds: [ |
embeds: [ |
34 |
new MessageEmbed() |
new MessageEmbed() |
49 |
.setDescription(`The queue has been deleted.`) |
.setDescription(`The queue has been deleted.`) |
50 |
.addField('Command', `\`${timeout.row.cmd}\``) |
.addField('Command', `\`${timeout.row.cmd}\``) |
51 |
.setFooter({ |
.setFooter({ |
52 |
text: '' + timeout.row.id |
text: 'ID: ' + timeout.row.id |
53 |
}) |
}) |
54 |
] |
] |
55 |
}); |
}); |
56 |
} |
} |
|
}; |
|
57 |
|
} |