Fix ban issues

This commit is contained in:
Ave Ozkal 2018-12-25 14:13:02 +03:00
parent 461b7e547c
commit eebcfea2f5
No known key found for this signature in database
GPG key ID: 09356ABAA42C842B
3 changed files with 9 additions and 4 deletions

View file

@ -52,8 +52,9 @@ class AdminCog:
@commands.command(hidden=True) @commands.command(hidden=True)
async def fetchlog(self, ctx): async def fetchlog(self, ctx):
"""Returns log""" """Returns log"""
await ctx.send(file=discord.File(f"{self.bot.script_name}.log"), await ctx.send("This is currently broken.")
content="Here's the current log file:") await ctx.send("Here's the current log file:",
file=discord.File(f"{self.bot.script_name}.log"))
@commands.guild_only() @commands.guild_only()
@commands.check(check_if_bot_manager) @commands.check(check_if_bot_manager)

View file

@ -82,7 +82,7 @@ class Logs:
f"🏷 __User ID__: {member.id}" f"🏷 __User ID__: {member.id}"
await log_channel.send(msg) 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() await self.bot.wait_until_ready()
log_channel = self.bot.get_channel(config.log_channel) log_channel = self.bot.get_channel(config.log_channel)
msg = f"⛔ **Ban**: {member.mention} | "\ msg = f"⛔ **Ban**: {member.mention} | "\
@ -90,7 +90,7 @@ class Logs:
f"🏷 __User ID__: {member.id}" f"🏷 __User ID__: {member.id}"
await log_channel.send(msg) 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() await self.bot.wait_until_ready()
log_channel = self.bot.get_channel(config.log_channel) log_channel = self.bot.get_channel(config.log_channel)
msg = f"⚠️ **Unban**: {user.mention} | "\ msg = f"⚠️ **Unban**: {user.mention} | "\

View file

@ -183,6 +183,10 @@ class ModCog:
", it is recommended to use `.ban <user> [reason]`"\ ", it is recommended to use `.ban <user> [reason]`"\
" as the reason is automatically sent to the user." " 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.guild_only()
@commands.bot_has_permissions(ban_members=True) @commands.bot_has_permissions(ban_members=True)
@commands.check(check_if_staff) @commands.check(check_if_staff)