Browse Source

Fixed error when @mentioning a user that is not in the warnings of that server.

tags/v1.7.0
Roxie Gibson 6 years ago
parent
commit
a38abeb7ce
2 changed files with 5 additions and 3 deletions
  1. +1
    -0
      README.md
  2. +4
    -3
      roxbot/cogs/admin.py

+ 1
- 0
README.md View File

@@ -39,6 +39,7 @@ _Coming Soon_
###### Bug Fixes
- Doubled the amount of times subreddit commands will cycle through possible requests to fix JSON decode error.
- Fixed error in reddit cog due to changing JSON outputs thanks to new reddit redesign.
- Fixed error when trying to use `warn list` on a user that isn't in the list returning an unhelpful error.

#### v1.6.1
###### Small changes

+ 4
- 3
roxbot/cogs/admin.py View File

@@ -149,12 +149,13 @@ class Admin():

user_id = str(user.id)

if not settings.warnings.get(user_id):
return await ctx.send("This user doesn't have any warning on record.")

if not settings.warnings[user_id]:
settings.warnings.pop(user_id)
settings.update(settings.warnings, "warnings")
if user_id not in settings.warnings:
return await ctx.send("This user doesn't have any warning on record.")

em = discord.Embed(title="Warnings for {}".format(str(user)), colour=roxbot.EmbedColours.pink)
em.set_thumbnail(url=user.avatar_url)
x = 1

Loading…
Cancel
Save