Refactor bot. (#8)
This commit is contained in:
parent
e0374bea36
commit
259d540e6f
18 changed files with 491 additions and 300 deletions
28
src/commands/members.ts
Normal file
28
src/commands/members.ts
Normal 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',
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue