From 1e0716b409b557c47010fdfabdb79d2faff91768 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 21 Apr 2021 15:28:49 -0400 Subject: [PATCH] fix issue with member command --- src/commands/members.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/commands/members.ts b/src/commands/members.ts index 678ca09..4d57c59 100644 --- a/src/commands/members.ts +++ b/src/commands/members.ts @@ -35,6 +35,8 @@ export default class Members extends Command { const role = this.client.util.resolveRole(args.join(' '), this.mainGuild); if (!role) return this.error(message.channel, 'The role you specified doesn\'t exist.'); + const check = this.mainGuild.members.filter((m) => m.roles.includes(role.id)); + if (!check || check?.length < 1) return this.error(message.channel, 'There are no members in this role.'); const statusArray: string[] = []; const membersOnline: string[] = []; const membersIdle: string[] = [];