Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ext.bridge] Ephemeral kwarg causing errors in defer() and respond() #1449

Closed
3 tasks done
krishnans2006 opened this issue Jun 27, 2022 · 0 comments · Fixed by #1453
Closed
3 tasks done

[ext.bridge] Ephemeral kwarg causing errors in defer() and respond() #1449

krishnans2006 opened this issue Jun 27, 2022 · 0 comments · Fixed by #1453
Assignees
Labels
bug Something isn't working

Comments

@krishnans2006
Copy link
Contributor

krishnans2006 commented Jun 27, 2022

Summary

Using the ephemeral= keyword argument causes errors when it is passed into the prefix-command version of the bridge command.

Reproduction Steps

Using any ephemeral keyword arguments

Minimal Reproducible Code

    @bridge_command(name="commands", description="This page lists all commands")
    async def _commands(self, context: ApplicationContext) -> None:
        await context.defer(ephemeral=True)
        await context.respond("Commands List", ephemeral=True)

Expected Results

The ephemeral keyword argument should instead be ignored. This could be as simple as a:

if kwargs.get("ephemeral") is not None:
    del kwargs["ephemeral"]

This is in fact exactly what I added in both discord/message.py line 1625 and discord/ext/bridge/context.py line 153 to get it to work temporarily.

Actual Results

Ignoring exception in command commands:
Traceback (most recent call last):
  File "/home/krishnan/Coding/Hobby/ChessCord/ChessCordv2.0/venv/lib/python3.10/site-packages/discord/ext/commands/core.py", line 181, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/krishnan/Coding/Hobby/ChessCord/ChessCordv2.0/slash/help.py", line 38, in _commands
    await context.defer(ephemeral=True)
  File "/home/krishnan/Coding/Hobby/ChessCord/ChessCordv2.0/venv/lib/python3.10/site-packages/discord/ext/bridge/context.py", line 101, in defer
    return await self._defer(*args, **kwargs)
  File "/home/krishnan/Coding/Hobby/ChessCord/ChessCordv2.0/venv/lib/python3.10/site-packages/discord/ext/bridge/context.py", line 153, in _defer
    return await self._get_super("trigger_typing")(*args, **kwargs)
TypeError: Messageable.trigger_typing() got an unexpected keyword argument 'ephemeral'

and

Ignoring exception in command commands:
Traceback (most recent call last):
  File "/home/krishnan/Coding/Hobby/ChessCord/ChessCordv2.0/venv/lib/python3.10/site-packages/discord/ext/commands/core.py", line 181, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/krishnan/Coding/Hobby/ChessCord/ChessCordv2.0/slash/help.py", line 40, in _commands
    await context.respond(
  File "/home/krishnan/Coding/Hobby/ChessCord/ChessCordv2.0/venv/lib/python3.10/site-packages/discord/ext/bridge/context.py", line 81, in respond
    return await self._respond(*args, **kwargs)
  File "/home/krishnan/Coding/Hobby/ChessCord/ChessCordv2.0/venv/lib/python3.10/site-packages/discord/ext/bridge/context.py", line 147, in _respond
    message = await self._get_super("reply")(*args, **kwargs)
  File "/home/krishnan/Coding/Hobby/ChessCord/ChessCordv2.0/venv/lib/python3.10/site-packages/discord/ext/commands/context.py", line 399, in reply
    return await self.message.reply(content, **kwargs)
  File "/home/krishnan/Coding/Hobby/ChessCord/ChessCordv2.0/venv/lib/python3.10/site-packages/discord/message.py", line 1625, in reply
    return await self.channel.send(content, reference=self, **kwargs)
TypeError: Messageable.send() got an unexpected keyword argument 'ephemeral'

Intents

discord.Intents.all

System Information

  • Python v3.10.5-final
  • py-cord v2.0.0-candidate
    • py-cord pkg_resources: v2.0.0rc1
  • aiohttp v3.8.1
  • system info: Linux 5.15.48-1-MANJARO Update README.rst #1 SMP PREEMPT Thu Jun 16 12:33:56 UTC 2022

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

This can also apply to other slash-command-specific kwargs, which I can't specifically think of off the top of my head.

@krishnans2006 krishnans2006 added the unconfirmed bug A bug report that needs triaging label Jun 27, 2022
@Lulalaby Lulalaby added bug Something isn't working and removed unconfirmed bug A bug report that needs triaging labels Jun 27, 2022
@Middledot Middledot assigned krishnans2006 and unassigned plun1331 Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants