refraction/src/commands/members.ts
2022-07-26 21:53:40 +08:00

29 lines
773 B
TypeScript

import type { Command } from '..';
import { COLORS } from '../constants';
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;
await 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: COLORS.blue,
},
],
});
},
};