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

Annotation of /trunk/commands/stats.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31 - (hide annotations)
Mon Jul 29 17:28:17 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: text/javascript
File size: 1418 byte(s)
Add -stats command
1 rakin 31 const MessageEmbed = require("../src/MessageEmbed");
2    
3     module.exports = {
4     async handle(msg, cm) {
5     let members = 0;
6     let bots = 0;
7    
8     msg.guild.members.cache.forEach(m => {
9     if (m.user.bot)
10     bots++;
11     else
12     members++;
13     });
14    
15     await msg.reply({
16     embeds: [
17     new MessageEmbed()
18     .setAuthor({
19     name: msg.guild.name,
20     iconURL: msg.guild.iconURL(),
21     })
22     .addFields([
23     {
24     name: "Members",
25     inline: true,
26     value: members + ''
27     },
28     {
29     name: "Bots",
30     inline: true,
31     value: bots + ''
32     },
33     {
34     name: "Total",
35     inline: true,
36     value: (members + bots) + ''
37     }
38     ])
39     .addField('Roles', msg.guild.roles.cache.size + '')
40     .addField('Channels', msg.guild.channels.cache.size + '')
41     .addField('Emojis', msg.guild.emojis.cache.size + '')
42     .addField('Stickers', msg.guild.stickers?.cache.size + '')
43     ]
44     });
45     }
46     };

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26