mirror of
https://github.com/TotalFreedomMC/TotalFreedomBot.git
synced 2024-12-22 23:54:58 +00:00
Update moderation.py
This commit is contained in:
parent
82808a42ee
commit
1b7c28dd46
1 changed files with 6 additions and 5 deletions
|
@ -3,6 +3,7 @@ import datetime
|
||||||
|
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from checks import *
|
from checks import *
|
||||||
|
from functions import *
|
||||||
|
|
||||||
muted_role_id = 769659653121900546
|
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):
|
async def setreaction(self, ctx, role : discord.Role=None, msg : discord.Message=None, emoji=None):
|
||||||
if role and msg and emoji :
|
if role and msg and emoji :
|
||||||
await msg.add_reaction(emoji)
|
await msg.add_reaction(emoji)
|
||||||
self.bot.reaction_roles.append((role.id,msg.id,str(emoji.encode('utf-8'))))
|
self.bot.reaction_roles.append([role.id,msg.id,emoji])
|
||||||
|
data = read_json('config')
|
||||||
async with aiofiles.open("reactionroles.txt", mode='a') as file:
|
data['reaction_roles'].append([role.id,msg.id,emoji])
|
||||||
emoji_utf = emoji.encode('utf-8')
|
print(data['reaction_roles'])
|
||||||
await file.write(f'{role.id} {msg.id} {emoji_utf}\n')
|
write_json('config', data)
|
||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
bot.add_cog(Moderation(bot))
|
bot.add_cog(Moderation(bot))
|
||||||
|
|
Loading…
Reference in a new issue