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

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26