From eebcfea2f5f106ef2a821953fd72462e4df0dfe9 Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Tue, 25 Dec 2018 14:13:02 +0300 Subject: [PATCH] Fix ban issues --- cogs/admin.py | 5 +++-- cogs/logs.py | 4 ++-- cogs/mod.py | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cogs/admin.py b/cogs/admin.py index 4b3923d..777a806 100644 --- a/cogs/admin.py +++ b/cogs/admin.py @@ -52,8 +52,9 @@ class AdminCog: @commands.command(hidden=True) async def fetchlog(self, ctx): """Returns log""" - await ctx.send(file=discord.File(f"{self.bot.script_name}.log"), - content="Here's the current log file:") + await ctx.send("This is currently broken.") + await ctx.send("Here's the current log file:", + file=discord.File(f"{self.bot.script_name}.log")) @commands.guild_only() @commands.check(check_if_bot_manager) diff --git a/cogs/logs.py b/cogs/logs.py index 68e8e7d..3c02916 100644 --- a/cogs/logs.py +++ b/cogs/logs.py @@ -82,7 +82,7 @@ class Logs: f"🏷 __User ID__: {member.id}" await log_channel.send(msg) - async def on_member_ban(self, member): + async def on_member_ban(self, guild, member): await self.bot.wait_until_ready() log_channel = self.bot.get_channel(config.log_channel) msg = f"⛔ **Ban**: {member.mention} | "\ @@ -90,7 +90,7 @@ class Logs: f"🏷 __User ID__: {member.id}" await log_channel.send(msg) - async def on_member_unban(self, server, user): + async def on_member_unban(self, guild, user): await self.bot.wait_until_ready() log_channel = self.bot.get_channel(config.log_channel) msg = f"⚠️ **Unban**: {user.mention} | "\ diff --git a/cogs/mod.py b/cogs/mod.py index c0f183b..322aea6 100644 --- a/cogs/mod.py +++ b/cogs/mod.py @@ -183,6 +183,10 @@ class ModCog: ", it is recommended to use `.ban [reason]`"\ " as the reason is automatically sent to the user." + log_channel = self.bot.get_channel(config.log_channel) + await log_channel.send(chan_message) + await ctx.send(f"{safe_name} is now b&. 👍") + @commands.guild_only() @commands.bot_has_permissions(ban_members=True) @commands.check(check_if_staff)