diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index 3266587..f73098c 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -24,9 +24,11 @@ export default class { hasUserPerms = resolved.permissions.users.includes(message.author.id); } let hasRolePerms: boolean = false; - for (const role of resolved.permissions.roles) { - if (message.member && message.member.roles.includes(role)) { - hasRolePerms = true; break; + if (resolved.permissions.roles) { + for (const role of resolved.permissions.roles) { + if (message.member && message.member.roles.includes(role)) { + hasRolePerms = true; break; + } } } if (!hasRolePerms && !hasUserPerms) return;