瀏覽代碼

changed unban to do a single ban lookup through the new function in discord.py

tags/v1.8.0
Roxie Gibson 6 年之前
父節點
當前提交
2800bf4a2f
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. +2
    -4
      roxbot/cogs/admin.py

+ 2
- 4
roxbot/cogs/admin.py 查看文件

@@ -277,10 +277,8 @@ class Admin:
@bot.command()
async def unban(self, ctx, member: roxbot.converters.UserConverter, *, 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
ban = await ctx.guild.get_ban(member)
mem = ban.user
if mem is None:
raise bot.CommandError("User not found in bans.")
try:

Loading…
取消
儲存