@@ -23,6 +23,7 @@ _Coming Soon_ | |||
- Slowmode now doesn't effect mods and admins of that guild. | |||
- Fixed `blacklist` command. | |||
- Fixed backup system because it didn't keep the backup folder there. | |||
- Fixed `unban` command | |||
#### v1.6.0 | |||
###### New Features |
@@ -231,11 +231,17 @@ class Admin(): | |||
@commands.has_permissions(ban_members=True) | |||
@commands.bot_has_permissions(ban_members=True) | |||
@bot.command() | |||
async def unban(self, ctx, member:discord.Member, *, reason = ""): | |||
"""Unbans mentioned user. Allows you to give a reason.""" | |||
async def unban(self, ctx, member_id:int, *, reason = ""): | |||
"""Unbans user with given ID. Allows you to give a reason.""" | |||
mem = None | |||
for ban in await ctx.guild.bans(): | |||
if ban.user.id == member_id: | |||
mem = ban.user | |||
if mem is None: | |||
raise bot.CommandError("User not found in bans.") | |||
try: | |||
await member.unban(reason=reason) | |||
return await ctx.send("Unbanned {} with reason: '{}'".format(member, reason)) | |||
await ctx.guild.unban(mem, reason=reason) | |||
return await ctx.send("Unbanned {} with reason: '{}'".format(mem, reason)) | |||
except discord.Forbidden: | |||
return await ctx.send("I can't kick the owner or users higher or equal to me.") | |||
@@ -7,7 +7,7 @@ from Roxbot.settings import guild_settings | |||
def blacklisted(user): | |||
with open("Roxbot/blacklist.txt", "r") as fp: | |||
for line in fp.readlines(): | |||
if user.id+"\n" == line: | |||
if str(user.id)+"\n" == line: | |||
return True | |||
return False | |||
@@ -7,7 +7,7 @@ from Roxbot.settings import guild_settings | |||
def blacklisted(user): | |||
with open("Roxbot/blacklist.txt", "r") as fp: | |||
for line in fp.readlines(): | |||
if user.id+"\n" == line: | |||
if str(user.id)+"\n" == line: | |||
return True | |||
return False | |||
@@ -28,7 +28,7 @@ bot = commands.Bot( | |||
def blacklisted(user): | |||
with open("Roxbot/blacklist.txt", "r") as fp: | |||
for line in fp.readlines(): | |||
if user.id+"\n" == line: | |||
if str(user.id)+"\n" == line: | |||
return True | |||
return False | |||