Obi-Wan3 / OB13-Cogs

Utility Cogs for Red by Obi-Wan3
https://github.com/Obi-Wan3/OB13-Cogs
MIT License
18 stars 38 forks source link

[Referrals] TypeError fix #7

Closed elijabesu closed 3 years ago

elijabesu commented 3 years ago

Fixes the following error:

Traceback (most recent call last):
  File "/home/ubuntu/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/ubuntu/.local/share/Red-DiscordBot/data/SauriBot/cogs/CogManager/cogs/referrals/referrals.py", line 63, in _referredby
    log_channel = await ctx.guild.get_channel(log_channel)
TypeError: object TextChannel can't be used in 'await' expression

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ubuntu/redenv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/home/ubuntu/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/ubuntu/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: object TextChannel can't be used in 'await' expression
Obi-Wan3 commented 3 years ago

@elijabesu Thanks for that, I merged above, also led me to find a similar error in my GitHub cog 🤦