mirror of
https://github.com/citra-emu/discord-bot.git
synced 2024-12-23 01:35:33 +00:00
server: fix the workaround logic issue
This commit is contained in:
parent
31d188933b
commit
6e27ab6c91
|
@ -196,8 +196,8 @@ client.on('messageCreate', async (message) => {
|
||||||
logger.error(`Unable to get the roles for ${message.author}`);
|
logger.error(`Unable to get the roles for ${message.author}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const isAllowed = (cmd === 'case' && findArray(authorRoles, ['Admins', 'Moderators', 'Developer'])) ||
|
const allowedRoles = cmd === 'case' ? ['Admins', 'Moderators', 'Developer'] : cachedModule?.roles;
|
||||||
(cachedModule?.roles && findArray(authorRoles, cachedModule.roles));
|
const isAllowed = (!allowedRoles) || (allowedRoles && findArray(authorRoles, allowedRoles));
|
||||||
if (!isAllowed) {
|
if (!isAllowed) {
|
||||||
await state.logChannel?.send(`${message.author.toString()} attempted to use admin command: ${message.content}`);
|
await state.logChannel?.send(`${message.author.toString()} attempted to use admin command: ${message.content}`);
|
||||||
logger.info(`${message.author.username} ${message.author} attempted to use admin command: ${message.content}`);
|
logger.info(`${message.author.username} ${message.author} attempted to use admin command: ${message.content}`);
|
||||||
|
|
Loading…
Reference in a new issue