- Slowmode now doesn't effect mods and admins of that guild. | - Slowmode now doesn't effect mods and admins of that guild. | ||||
- Fixed `blacklist` command. | - Fixed `blacklist` command. | ||||
- Fixed backup system because it didn't keep the backup folder there. | - Fixed backup system because it didn't keep the backup folder there. | ||||
- Fixed `unban` command | |||||
#### v1.6.0 | #### v1.6.0 | ||||
###### New Features | ###### New Features |
@commands.has_permissions(ban_members=True) | @commands.has_permissions(ban_members=True) | ||||
@commands.bot_has_permissions(ban_members=True) | @commands.bot_has_permissions(ban_members=True) | ||||
@bot.command() | @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: | 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: | except discord.Forbidden: | ||||
return await ctx.send("I can't kick the owner or users higher or equal to me.") | return await ctx.send("I can't kick the owner or users higher or equal to me.") | ||||
def blacklisted(user): | def blacklisted(user): | ||||
with open("Roxbot/blacklist.txt", "r") as fp: | with open("Roxbot/blacklist.txt", "r") as fp: | ||||
for line in fp.readlines(): | for line in fp.readlines(): | ||||
if user.id+"\n" == line: | |||||
if str(user.id)+"\n" == line: | |||||
return True | return True | ||||
return False | return False | ||||
def blacklisted(user): | def blacklisted(user): | ||||
with open("Roxbot/blacklist.txt", "r") as fp: | with open("Roxbot/blacklist.txt", "r") as fp: | ||||
for line in fp.readlines(): | for line in fp.readlines(): | ||||
if user.id+"\n" == line: | |||||
if str(user.id)+"\n" == line: | |||||
return True | return True | ||||
return False | return False | ||||
def blacklisted(user): | def blacklisted(user): | ||||
with open("Roxbot/blacklist.txt", "r") as fp: | with open("Roxbot/blacklist.txt", "r") as fp: | ||||
for line in fp.readlines(): | for line in fp.readlines(): | ||||
if user.id+"\n" == line: | |||||
if str(user.id)+"\n" == line: | |||||
return True | return True | ||||
return False | return False | ||||