/[sudobot]/trunk/src/commands/automation/DelQueueCommand.ts
ViewVC logotype

Diff of /trunk/src/commands/automation/DelQueueCommand.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/commands/delqueue.js revision 49 by rakin, Mon Jul 29 17:28:21 2024 UTC trunk/src/commands/automation/DelQueueCommand.ts revision 51 by rakin, Mon Jul 29 17:28:23 2024 UTC
# Line 1  Line 1 
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()
# Line 15  module.exports = { Line 25  module.exports = {
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()
# Line 39  module.exports = { Line 49  module.exports = {
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    }

Legend:
Removed from v.49  
changed lines
  Added in v.51

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26