/[sudobot]/trunk/commands/delqueue.js
ViewVC logotype

Annotation of /trunk/commands/delqueue.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 49 - (hide annotations)
Mon Jul 29 17:28:21 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: text/javascript
File size: 1349 byte(s)
Release version 1.10.0

* Added -queues command to list all queued jobs
* Added -joke command to fetch random jokes
* Added support of user tags in some user-based commands
1 rakin 46 const { MessageEmbed } = require("discord.js");
2     const { clearTimeoutv2, getTimeout, getTimeouts } = require("../src/setTimeout");
3    
4     module.exports = {
5     async handle(msg, cm) {
6     if (cm.args[0] === undefined) {
7     await msg.reply({
8     embeds: [
9     new MessageEmbed()
10     .setColor('#f14a60')
11     .setDescription(`This command requires at least one argument.`)
12     ]
13     });
14    
15     return;
16     }
17    
18     const timeout = await getTimeout(parseInt(cm.args[0]));
19     console.log(getTimeouts());
20    
21 rakin 49 if (!timeout || timeout.row.guild_id !== msg.guild.id) {
22 rakin 46 await msg.reply({
23     embeds: [
24     new MessageEmbed()
25     .setColor('#f14a60')
26     .setDescription(`Invalid queue ID given.`)
27     ]
28     });
29    
30     return;
31     }
32    
33     await clearTimeoutv2(timeout);
34    
35     await msg.reply({
36     embeds: [
37     new MessageEmbed()
38     .setColor('#f14a60')
39     .setDescription(`The queue has been deleted.`)
40 rakin 49 .addField('Command', `\`${timeout.row.cmd}\``)
41 rakin 46 .setFooter({
42     text: '' + timeout.row.id
43     })
44     ]
45     });
46     }
47     };

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26