mirror of
https://github.com/citra-emu/discord-bot.git
synced 2024-12-23 00:15:31 +00:00
server: temporarily making some commands as admin-only
This commit is contained in:
parent
fde0b14b58
commit
c5bf06fafe
|
@ -196,7 +196,9 @@ 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;
|
||||||
}
|
}
|
||||||
if (cachedModule && cachedModule.roles && !findArray(authorRoles, cachedModule.roles)) {
|
const isAllowed = (cmd === 'case' && findArray(authorRoles, ['Admins', 'Moderators', 'Developer'])) ||
|
||||||
|
(cachedModule?.roles && findArray(authorRoles, cachedModule.roles));
|
||||||
|
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}`);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue