/[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 393 by rakin, Mon Jul 29 17:29:59 2024 UTC
# Line 1  Line 1 
1  const { MessageEmbed } = require("discord.js");  /**
2  const { clearTimeoutv2, getTimeout, getTimeouts } = require("../src/setTimeout");  * This file is part of SudoBot.
3    *
4    * Copyright (C) 2021-2022 OSN Inc.
5    *
6    * SudoBot is free software; you can redistribute it and/or modify it
7    * under the terms of the GNU Affero General Public License as published by
8    * the Free Software Foundation, either version 3 of the License, or
9    * (at your option) any later version.
10    *
11    * SudoBot is distributed in the hope that it will be useful, but
12    * WITHOUT ANY WARRANTY; without even the implied warranty of
13    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14    * GNU Affero General Public License for more details.
15    *
16    * You should have received a copy of the GNU Affero General Public License
17    * along with SudoBot. If not, see <https://www.gnu.org/licenses/>.
18    */
19    
20    import { Message } from 'discord.js';
21    import BaseCommand from '../../utils/structures/BaseCommand';
22    import DiscordClient from '../../client/Client';
23    import CommandOptions from '../../types/CommandOptions';
24    import MessageEmbed from '../../client/MessageEmbed';
25    import { clearTimeoutv2, getTimeout, getTimeouts } from '../../utils/setTimeout';
26    
27    export default class DelQueueCommand extends BaseCommand {
28        constructor() {
29            super('delqueue', 'automation', []);
30        }
31    
32  module.exports = {      async run(client: DiscordClient, msg: Message, options: CommandOptions) {
33      async handle(msg, cm) {          if (options.args[0] === undefined) {
         if (cm.args[0] === undefined) {  
34              await msg.reply({              await msg.reply({
35                  embeds: [                  embeds: [
36                      new MessageEmbed()                      new MessageEmbed()
# Line 15  module.exports = { Line 42  module.exports = {
42              return;              return;
43          }          }
44    
45          const timeout = await getTimeout(parseInt(cm.args[0]));          const timeout = await getTimeout(parseInt(options.args[0]));
46          console.log(getTimeouts());          console.log(getTimeouts());
47    
48          if (!timeout || timeout.row.guild_id !== msg.guild.id) {          if (!timeout || timeout.row.guild_id !== msg.guild!.id) {
49              await msg.reply({              await msg.reply({
50                  embeds: [                  embeds: [
51                      new MessageEmbed()                      new MessageEmbed()
# Line 39  module.exports = { Line 66  module.exports = {
66                  .setDescription(`The queue has been deleted.`)                  .setDescription(`The queue has been deleted.`)
67                  .addField('Command', `\`${timeout.row.cmd}\``)                  .addField('Command', `\`${timeout.row.cmd}\``)
68                  .setFooter({                  .setFooter({
69                      text: '' + timeout.row.id                      text: 'ID: ' + timeout.row.id
70                  })                  })
71              ]              ]
72          });          });
73      }      }
 };  
74    }

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26