async def off(self, ctx, channel: discord.TextChannel = None): if channel is None: channel = ctx.channel ch = str(channel.id) try: a = DataManager.read('data/votereact.json')['channels'] except KeyError: DataManager.write('data/votereact.json', 'channels', []) await Formatter.error(ctx, 'Votereact was never enabled!') if channel.id in a: DataManager.list_remove('data/votereact.json', 'channels', channel.id) try: DataManager.list_update('data/votereact.json', ch, []) except KeyError: pass await ctx.send("✅ | Disabled vote reacting!") else: await Formatter.error(ctx, "Votereact wasn't ever enabled.")
async def owner(self, ctx, member: discord.Member): DataManager.list_update('data/bot.json', 'OWNERS', member.id) await ctx.send("Updated owner!")
async def block(self, ctx, member: discord.Member): DataManager.list_update('data/ignorelist.json', 'ignore', member.id) await Formatter.success(ctx, f'Successfully blocked {member.name}')
async def ignore(self, ctx, channel: discord.TextChannel): DataManager.list_update('data/activity.json', 'ignore-list', channel.id) await ctx.send("Updated ignore list!")
async def on(self, ctx, channel: discord.TextChannel = None, *args): if channel is None: channel = ctx.channel ch = str(channel.id) args = ''.join(args) DataManager.write('data/votereact.json', ch, []) try: a = DataManager.read('data/votereact.json')['channels'] except KeyError: DataManager.write('data/votereact.json', 'channels', []) print(args) if '--arrows' or '-a' in args: print("Hm. 1") DataManager.list_update('data/votereact.json', ch, 'arrows') print("Interest.") if channel.id not in a: DataManager.list_update('data/votereact.json', 'channels', channel.id) await ctx.send("✅ | Enabled vote reacting here!") else: await Formatter.error( ctx, "Vote reacting is already enabled here!") elif '-nd' or '--no-downvote' in args: print("Hm. 2") if channel.id not in a: DataManager.list_update('data/votereact.json', 'channels', channel.id) await ctx.send("✅ | Enabled vote reacting here!") else: await Formatter.error( ctx, "Vote reacting is already enabled here!") DataManager.list_update('data/votereact.json', ch, 'nd') elif '-np' or '--no-upvote' in args: print("Hm. 3") if channel.id not in a: DataManager.list_update('data/votereact.json', 'channels', channel.id) await ctx.send("✅ | Enabled vote reacting here!") else: await Formatter.error( ctx, "Vote reacting is already enabled here!") DataManager.list_update('data/votereact.json', ch, 'np') else: print("Hm. 4") DataManager.list_update('data/votereact.json', ch, None) if channel.id not in a: print("/") DataManager.list_update('data/votereact.json', 'channels', channel.id) await ctx.send("✅ | Enabled vote reacting here!") else: await Formatter.error( ctx, "Vote reacting is already enabled here!")