1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando';
module.exports = class GenerateServersBot extends Command {
constructor(client: CommandoClient) {
super(client, {
name: 'generateservers',
aliases: [
'generate-servers',
'genservers',
'gen-servers'
],
group: 'bot',
memberName: 'generateservers',
description: 'Generates a .txt file with all of the servers uwufier is in.',
examples: ['uwu!genservers'],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
throttling: {
usages: 5,
duration: 30
},
ownerOnly: true,
guarded: true,
hidden: true
});
}
async run(msg: CommandoMessage) {
const list = this.client.guilds.cache
.map(g => {
const servers = g.name
return `* ** ${servers}:** ${g.id} - ${g.owner?.user.tag}`
})
const text = `Total: ${this.client.guilds.cache.size}\n\n### Servers\n\n${list.join('\n')}`
return msg.reply({ files: [{ attachment: Buffer.from(text), name: 'servers.txt' }] })
}
};
|