Gorialis / jishaku

A debugging and testing cog for discord.py rewrite bots.
https://jishaku.readthedocs.io/en/latest/
MIT License
541 stars 179 forks source link

AttributeError: 'Context' object has no attribute 'add_reaction' #219

Closed Motzumoto closed 5 months ago

Motzumoto commented 10 months ago

Summary

running jsk debug errors. Its unable to add a reaction to the message. However jsk py adds the reaction just fine. image

Reproduction steps

jsk debug and then anything else.

Expected results

add the reaction successfully like jsk py

Actual results

Errors

Traceback (most recent call last):
  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 235, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/container/.local/lib/python3.10/site-packages/jishaku/features/invocation.py", line 196, in jsk_debug
    async with ReplResponseReactor(ctx):
  File "/home/container/.local/lib/python3.10/site-packages/jishaku/exception_handling.py", line 127, in __aexit__
    await attempt_add_reaction(self.message, "\N{WHITE HEAVY CHECK MARK}")
  File "/home/container/.local/lib/python3.10/site-packages/jishaku/exception_handling.py", line 93, in attempt_add_reaction
    return await msg.add_reaction(reaction)
AttributeError: 'Context' object has no attribute 'add_reaction'

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

Traceback (most recent call last):
  File "/home/container/.local/lib/python3.10/site-packages/jishaku/features/invocation.py", line 198, in jsk_debug
    await alt_ctx.command.invoke(alt_ctx)
  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 1650, in invoke
    await ctx.invoked_subcommand.invoke(ctx)
  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 1029, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 244, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Context' object has no attribute 'add_reaction'

Checklist

System information

Name: jishaku Version: 2.5.2a485+g32009b4.master Summary: A discord.py extension including useful tools for bot development and debugging. Home-page: https://github.com/Gorialis/jishaku Author: Devon (Gorialis) R Author-email: License: MIT Location: /home/container/.local/lib/python3.10/site-packages Requires: braceexpand, click, import-expression, tabulate Required-by:

Name: discord.py Version: 2.3.2 Summary: A Python wrapper for the Discord API Home-page: https://github.com/Rapptz/discord.py Author: Rapptz Author-email: License: MIT Location: /home/container/.local/lib/python3.10/site-packages Requires: aiohttp Required-by: discord-ext-menus, wavelink

Gorialis commented 10 months ago

caused by changes introduced in #218, need to revert that bit

Gorialis commented 5 months ago

This was fixed in #220 and I forgot to close this.