瀏覽代碼

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

tags/v1.7.0
Roxie Gibson 6 年之前
父節點
當前提交
a38abeb7ce
共有 2 個檔案被更改,包括 5 行新增3 行删除
  1. +1
    -0
      README.md
  2. +4
    -3
      roxbot/cogs/admin.py

+ 1
- 0
README.md 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存