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

Annotation of /trunk/commands/queues.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: 1123 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 49 const MessageEmbed = require('../src/MessageEmbed');
2     const { getTimeouts } = require('../src/setTimeout');
3     const { timeSince, timeProcess } = require('../src/util');
4    
5     module.exports = {
6     async handle(msg) {
7     const map = await getTimeouts();
8     let str = '';
9    
10     await map.forEach(value => {
11     if (value.row.guild_id !== msg.guild.id)
12     return;
13    
14     console.log(new Date(value.row.time).getTime() - new Date().getTime());
15     str += `**${value.row.id}**\n**User Command**: \`${value.row.cmd}\`\n**Internal Command**: \`${value.row.params}\`\n**ETA**: ${timeProcess((new Date(value.row.time).getTime() - new Date().getTime()) / 1000).replace(' ago', '')}\n**Queue Added**: ${new Date(value.row.created_at).toLocaleString()} (${timeSince(new Date(value.row.created_at).getTime())})\n\n`;
16     });
17    
18     await msg.reply({
19     embeds: [
20     new MessageEmbed()
21     .setTitle('Queue List')
22     .setDescription(str === '' ? 'No queue.' : str)
23     .setTimestamp()
24     ]
25     });
26     }
27     };

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26