summaryrefslogtreecommitdiff
path: root/server/src/commands/owner
diff options
context:
space:
mode:
authorSin-MacBook <[email protected]>2020-08-17 15:37:36 +0200
committerSin-MacBook <[email protected]>2020-08-17 15:37:36 +0200
commit752296a41a19a59fa4f241ef534b61c607a2b377 (patch)
tree3f4acd2fd60bb252dfb174877447cfa2a2db1f5f /server/src/commands/owner
parentenhance: refactor, add duck (thx van) (diff)
downloaddep-core-752296a41a19a59fa4f241ef534b61c607a2b377.tar.xz
dep-core-752296a41a19a59fa4f241ef534b61c607a2b377.zip
feat: mcss and serverlist cmd + small fix
Diffstat (limited to 'server/src/commands/owner')
-rw-r--r--server/src/commands/owner/ServerList.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/server/src/commands/owner/ServerList.ts b/server/src/commands/owner/ServerList.ts
new file mode 100644
index 0000000..18c618f
--- /dev/null
+++ b/server/src/commands/owner/ServerList.ts
@@ -0,0 +1,30 @@
+import { Command } from 'discord-akairo';
+import { Message } from 'discord.js';
+
+export default class ServerListOwner extends Command {
+ public constructor() {
+ super('serverlist', {
+ aliases: ['serverlist', 'server-list'],
+ category: 'owner',
+ description: {
+ content: 'Check what servers the bot is in.',
+ usage: '',
+ examples: [
+ ''
+ ]
+ },
+ ratelimit: 3,
+ ownerOnly: true
+ });
+ }
+
+ public exec(msg: Message): Promise<Message> {
+ const list = this.client.guilds.cache.map(g => {
+ const servers = g.name;
+ return `- **${servers}:** ${g.id} - ${g.owner?.user.tag} - ${g.memberCount}`;
+ });
+
+ const text = `Total: ${this.client.guilds.cache.size}\n\n### Servers\n\n${list.join("\n")}`;
+ return msg.author.send({ files: [{ attachment: Buffer.from(text), name: "ServerList.txt" }] });
+ }
+} \ No newline at end of file