Refactor bot. (#8)

This commit is contained in:
dada513 2022-06-07 11:08:49 +02:00 committed by GitHub
parent e0374bea36
commit 259d540e6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 491 additions and 300 deletions

28
src/commands/members.ts Normal file
View file

@ -0,0 +1,28 @@
import { Command } from '../index';
export const cmd: Command = {
name: 'members',
desc: 'Shows the amount of online users in PolyMC Discord',
aliases: ['mems', 'memcount'],
exec: async (e) => {
const memes = await e.guild?.members.fetch().then((r) => r.toJSON());
if (!memes) return;
return e.reply({
embeds: [
{
title: `${memes.length} total members!`,
description: `${
memes.filter(
(m) =>
m.presence?.status === 'online' ||
m.presence?.status === 'idle' ||
m.presence?.status === 'dnd'
).length
} online members`,
color: 'GOLD',
},
],
});
},
};