/[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 46 by rakin, Mon Jul 29 17:28:21 2024 UTC trunk/src/commands/automation/DelQueueCommand.ts revision 344 by rakin, Mon Jul 29 17:29:40 2024 UTC
# Line 1  Line 1 
1  const { MessageEmbed } = require("discord.js");  import { 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 MessageEmbed from '../../client/MessageEmbed';
6    import { clearTimeoutv2, getTimeout, getTimeouts } from '../../utils/setTimeout';
7    
8    export default class DelQueueCommand extends BaseCommand {
9        constructor() {
10            super('delqueue', 'automation', []);
11        }
12    
13  module.exports = {      async run(client: DiscordClient, msg: Message, options: CommandOptions) {
14      async handle(msg, cm) {          if (options.args[0] === undefined) {
         if (cm.args[0] === undefined) {  
15              await msg.reply({              await msg.reply({
16                  embeds: [                  embeds: [
17                      new MessageEmbed()                      new MessageEmbed()
# Line 15  module.exports = { Line 23  module.exports = {
23              return;              return;
24          }          }
25    
26          const timeout = await getTimeout(parseInt(cm.args[0]));          const timeout = await getTimeout(parseInt(options.args[0]));
27          console.log(getTimeouts());          console.log(getTimeouts());
28    
29          if (!timeout) {          if (!timeout || timeout.row.guild_id !== msg.guild!.id) {
30              await msg.reply({              await msg.reply({
31                  embeds: [                  embeds: [
32                      new MessageEmbed()                      new MessageEmbed()
# Line 37  module.exports = { Line 45  module.exports = {
45                  new MessageEmbed()                  new MessageEmbed()
46                  .setColor('#f14a60')                  .setColor('#f14a60')
47                  .setDescription(`The queue has been deleted.`)                  .setDescription(`The queue has been deleted.`)
48                    .addField('Command', `\`${timeout.row.cmd}\``)
49                  .setFooter({                  .setFooter({
50                      text: '' + timeout.row.id                      text: 'ID: ' + timeout.row.id
51                  })                  })
52              ]              ]
53          });          });
54      }      }
 };  
55    }

Legend:
Removed from v.46  
changed lines
  Added in v.344

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26