Browse Source

Changed function names inline with discord.py changes.

tags/v2.2.0
Roxie Gibson 5 years ago
parent
commit
1d525527f6
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      roxbot/cogs/admin.py
  2. +2
    -2
      roxbot/converters.py

+ 2
- 2
roxbot/cogs/admin.py View File

@@ -241,7 +241,7 @@ class Admin(commands.Cog):
try:
warned_by = str(ctx.guild.get_member(warning.warned_by))
if warned_by is None:
warned_by = str(await self.bot.get_user_info(warning.warned_by))
warned_by = str(await self.bot.fetch_user(warning.warned_by))
except discord.ext.commands.CommandInvokeError:
warned_by = warning.warned_by
date = datetime.datetime.strftime(warning.date, roxbot.datetime.strip("{:} UTC")+" UTC")
@@ -415,7 +415,7 @@ class Admin(commands.Cog):
# Unban user with ID 478294672394
;unban 478294672394
"""
ban = await ctx.guild.get_ban(member)
ban = await ctx.guild.fetch_ban(member)
mem = ban.user
if mem is None:
embed = discord.Embed(description=self.WARN_UNBAN_NOTFOUND, colour=roxbot.EmbedColours.red)

+ 2
- 2
roxbot/converters.py View File

@@ -39,14 +39,14 @@ class User(commands.UserConverter):
2. Lookup by mention.
3. Lookup by name#discrim
4. Lookup by name
5. Lookup by get_user_info
5. Lookup by fetch_user
"""
async def convert(self, ctx, argument):
try:
result = await super().convert(ctx, argument)
except commands.BadArgument as e:
try:
result = await ctx.bot.get_user_info(argument)
result = await ctx.bot.fetch_user(argument)
except: # Bare except or otherwise it will raise its own BadArgument and have a pretty shitty error message that isn't useful.
raise e


Loading…
Cancel
Save