From 1b7c28dd46340458568f06256b0f8ccc5ec4f13e Mon Sep 17 00:00:00 2001 From: Elmon11 Date: Sat, 21 Nov 2020 13:54:54 +0100 Subject: [PATCH] Update moderation.py --- commands/moderation.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/commands/moderation.py b/commands/moderation.py index 20485da..190429e 100644 --- a/commands/moderation.py +++ b/commands/moderation.py @@ -3,6 +3,7 @@ import datetime from discord.ext import commands from checks import * +from functions import * muted_role_id = 769659653121900546 @@ -69,11 +70,11 @@ class Moderation(commands.Cog): async def setreaction(self, ctx, role : discord.Role=None, msg : discord.Message=None, emoji=None): if role and msg and emoji : await msg.add_reaction(emoji) - self.bot.reaction_roles.append((role.id,msg.id,str(emoji.encode('utf-8')))) - - async with aiofiles.open("reactionroles.txt", mode='a') as file: - emoji_utf = emoji.encode('utf-8') - await file.write(f'{role.id} {msg.id} {emoji_utf}\n') + self.bot.reaction_roles.append([role.id,msg.id,emoji]) + data = read_json('config') + data['reaction_roles'].append([role.id,msg.id,emoji]) + print(data['reaction_roles']) + write_json('config', data) def setup(bot): bot.add_cog(Moderation(bot))