Merge pull request 'Nettoyage de bot.py' (#2) from clean_bot.py into rewrite

Reviewed-on: #2
This commit is contained in:
puma.rc 2020-04-21 13:29:43 +02:00
commit 2989b6ed90

11
bot.py
View file

@ -42,16 +42,6 @@ l_extensions: List[str] = [
async def _prefix_callable(bot, message: discord.message) -> list: async def _prefix_callable(bot, message: discord.message) -> list:
<<<<<<< HEAD
extras = [bot.cluster.get('Name') + '.']
if message.guild is not None:
if str(message.guild.id) in bot.prefixes:
extras.extend(
bot.prefixes.get(str(message.guild.id), "prefixes").split(
bot.config.get("misc", "Separator")
)
)
=======
try: try:
with open(f'./configs/guilds/{message.guild.id}.json', 'r') as f: with open(f'./configs/guilds/{message.guild.id}.json', 'r') as f:
data = json.load(f) data = json.load(f)
@ -62,7 +52,6 @@ async def _prefix_callable(bot, message: discord.message) -> list:
extras = [bot.cluster.get('Name') + '.'] extras = [bot.cluster.get('Name') + '.']
extras.extend(custom_prefix) extras.extend(custom_prefix)
>>>>>>> cce7bb409303e9ad27ef4e5617d0bc9068810f13
return commands.when_mentioned_or(*extras)(bot, message) return commands.when_mentioned_or(*extras)(bot, message)