interactions-py / interactions.py

A highly extensible, easy to use, and feature complete bot framework for Discord
https://interactions-py.github.io/interactions.py/
MIT License
839 stars 184 forks source link

Overridden `.send` command doesn't work in discord.py master branch (v2) #287

Closed noaione closed 3 years ago

noaione commented 3 years ago

Apparently, discord-slash overrides some of the original discord.py method and since I'm using the master v2 branch, the command broke if I'm trying to add view kwargs since the kwargs doesn't exist in the overrides.

Traceback:

[2021-08-11 22:33:47 REDACTED][ERROR] (REDACTED[20332]): on_command_error: Ignoring exception in command kbbi:
[2021-08-11 22:33:47 REDACTED][ERROR] (REDACTED[20332]): echo_error: Exception occured
Traceback (most recent call last):
  File "[REDACTED]\env\lib\site-packages\discord\ext\commands\core.py", line 125, in wrapped
    ret = await coro(*args, **kwargs)
  File "[REDACTED]\cogs\kutubuku\kbbi.py", line 478, in _kbbi_cmd_main
    await ctx.send(embed=first_embed, view=ui_paginate)
  File "[REDACTED]\env\lib\site-packages\discord_slash\dpy_overrides.py", line 323, in send_override
    return await send(channel, *args, **kwargs)
TypeError: send() got an unexpected keyword argument 'view'

Version used: Discord.py: https://github.com/Rapptz/discord.py/commit/58ca9e99325ac2678a51cd63afd7ae917f14bc8d discord-slash: 2.4.1

i0bs commented 3 years ago

This has been internally discussed with the contributors a short time back but it is to be expected for d.py 2.0 to generally bring compatibility issues to our library. Our library supports only 1.7.3 and below at this time because the new discord.py 2.0 logic affects the way we're able to make things work. Our overrides are a small monkeypatch to keep stability for the most part between both worlds.

noaione commented 3 years ago

I'm guessing, if I try to monkey-patch again the function (maintaining both dpy and dslash difference) it would work just fine?

noaione commented 3 years ago

After tinkering for a while, this works for me: https://gist.github.com/noaione/738ce5ba570b4d27e00f8e69679b0bff

I monkey-patched it again after binding SlashCommand to the bot.

i0bs commented 3 years ago

I'm moving this to be a wontfix because this is going to be addressed personally as-is in v4.0 by not supporting the view kwarg. That's an arbitrary field that was created for discord.py 2.0 that I don't see a need to also support since we will be heading to become an independent API wrapper.