diff --git a/bot.py b/bot.py index 47b9cc2..cab6a90 100644 --- a/bot.py +++ b/bot.py @@ -43,14 +43,15 @@ async def on_ready(): if not hasattr(bot, 'uptime'): bot.uptime = datetime.datetime.utcnow() + @bot.event async def on_member_join(member): notifications = config.getContent('user_notifications') or {} server_notifications = notifications.get(member.server.id) if not server_notifications: return - - channel = discord.utils.get(member.server.channels,id=server_notifications) + + channel = discord.utils.get(member.server.channels, id=server_notifications) await bot.send_message(channel, "Welcome to the '{0.server.name}' server {0.mention}!".format(member)) @@ -60,10 +61,11 @@ async def on_member_remove(member): server_notifications = notifications.get(member.server.id) if not server_notifications: return - - channel = discord.utils.get(member.server.channels,id=server_notifications) + + channel = discord.utils.get(member.server.channels, id=server_notifications) await bot.send_message(channel, - "{0} has left the server, I hope it wasn't because of something I said :c".format(member.display_name)) + "{0} has left the server, I hope it wasn't because of something I said :c".format( + member.display_name)) @bot.event @@ -72,6 +74,7 @@ async def on_message(message): return await bot.process_commands(message) + @bot.event async def on_command_error(error, ctx): if isinstance(error, commands.BadArgument): @@ -81,10 +84,9 @@ async def on_command_error(error, ctx): fmt = "You can't tell me what to do!" await bot.send_message(ctx.message.channel, fmt) elif isinstance(error, commands.CommandOnCooldown): - fmt = "This command is on cooldown! Hold your horses! >:c" + fmt = "This command is on cooldown! Hold your horses! >:c\nTry again in {}".format(error.retry_after) await bot.send_message(ctx.message.channel, fmt) elif not isinstance(error, commands.CommandNotFound): - fmt = 'An error occurred while processing this request: ```py\n{}: {}\n```' with open("/home/phxntx5/public_html/Bonfire/error_log", 'a') as f: print('In {0.command.qualified_name}:'.format(ctx), file=f) traceback.print_tb(error.original.__traceback__, file=f) diff --git a/cogs/interaction.py b/cogs/interaction.py index 61420ee..7ac3af5 100644 --- a/cogs/interaction.py +++ b/cogs/interaction.py @@ -97,13 +97,12 @@ class Interaction: battling = config.getContent('battling') or {} battling[ctx.message.author.id] = ctx.message.mentions[0].id - config.saveContent('battling',battling) + config.saveContent('battling', battling) fmt = "{0.mention} has challenged you to a battle {1.mention}\n!accept or !decline" await self.bot.say(fmt.format(ctx.message.author, player2)) await self.bot.delete_message(ctx.message) config.loop.call_later(180,battlingOff,ctx.message.author.id) - @commands.command(pass_context=True, no_pm=True) @checks.customPermsOrRole(send_messages=True) @@ -156,7 +155,7 @@ class Interaction: battlingOff(ctx.message.author.id) @commands.command(pass_context=True, no_pm=True) - @commands.cooldown(1,180,BucketType.user) + @commands.cooldown(1, 180, BucketType.user) @checks.customPermsOrRole(send_messages=True) async def boop(self, ctx, boopee: discord.Member): """Boops the mentioned person""" diff --git a/cogs/roles.py b/cogs/roles.py index e2ec1d8..714b726 100644 --- a/cogs/roles.py +++ b/cogs/roles.py @@ -212,4 +212,3 @@ class Roles: def setup(bot): bot.add_cog(Roles(bot)) - \ No newline at end of file