diff --git a/settings/config.py b/settings/config.py index 82fcfac..cccfb29 100644 --- a/settings/config.py +++ b/settings/config.py @@ -69,4 +69,9 @@ LOGGING_CONFIG = { }, } +PERMISSIONS = { + 'dq' : ['O emissário', 'BotMan'], + 'v' : ['Operador'] +} + logger.dictConfig(LOGGING_CONFIG) diff --git a/utils/commands.py b/utils/commands.py index 7cd69cd..4cfa89e 100644 --- a/utils/commands.py +++ b/utils/commands.py @@ -8,6 +8,8 @@ from discord.ext import commands from utils.database import get_by_id, get_quotes, remove_quote, set_quote, count_quotes +from settings.config import PERMISSIONS + client = commands.Bot(command_prefix='--') logger = logging.getLogger(__name__) @@ -105,7 +107,7 @@ async def delete_quote(bot, _id: int=None) -> str: syntax = "`--dq `" roles = [r.name for r in bot.author.roles] - if not 'Operador' in roles: + if len(set(PERMISSIONS['dq']).intersection(roles)) < 1: return await bot.send("_And who the fuck do **YOU** think you are!?_.\n"\ "(You don't have the necessary role for this command)") @@ -157,7 +159,7 @@ async def info(bot: object) -> str: """ roles = [r.name for r in bot.author.roles] - if not 'Operador' in roles: + if len(set(PERMISSIONS['v']).intersection(roles)) < 1: return await bot.send("_And who the fuck do **YOU** think you are!?_.\n"\ "(You don't have the necessary role for this command)")