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

Paginator fails with ctx.defer(ephemeral=True) #2173

Open
3 tasks done
MacKenzieHnC opened this issue Jul 17, 2023 · 0 comments
Open
3 tasks done

Paginator fails with ctx.defer(ephemeral=True) #2173

MacKenzieHnC opened this issue Jul 17, 2023 · 0 comments
Labels
on hold unconfirmed bug A bug report that needs triaging

Comments

@MacKenzieHnC
Copy link

MacKenzieHnC commented Jul 17, 2023

Summary

Paginator fails when not labeled as ephemeral and responding to an ephemeral defer

Reproduction Steps

See minimal example and attempt to change pages

Minimal Reproducible Code

import discord
import os
from dotenv import load_dotenv
from discord.ext import pages

load_dotenv()
bot = discord.Bot()

@bot.slash_command()
async def paginator(ctx):
    paginator = pages.Paginator(["Pg 1", "Pg 2"])
    await ctx.defer(ephemeral=True)
    await paginator.respond(ctx.interaction)

bot.run(os.getenv('TOKEN'))

Expected Results

paginator works as intended

Actual Results

Paginator displays as expected, but page does not change and raises error:

File "<path-to-pycord>\commands\core.py", line 124, in wrapped
    ret = await coro(arg)
  File "<path-to-pycord>\commands\core.py", line 982, in _invoke
    await self.callback(ctx, **kwargs)
  File "<path-to-bot>\main.py", line 13, in paginator
    await paginator.respond(ctx.interaction)
  File "<path-to-pycord>\ext\pages\pagination.py", line 1171, in respond
    msg = await msg.channel.fetch_message(msg.id)
  File "<path-to-pycord>\abc.py", line 1696, in fetch_message
    data = await self._state.http.get_message(channel.id, id)
  File "<path-to-pycord>\http.py", line 367, in request
    raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message

Intents

?

System Information

  • Python v3.10.3-final
  • py-cord v2.4.1-final
  • aiohttp v3.8.1
  • system info: Windows 10 10.0.19045

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

Easy workaround is await paginator.respond(ctx.interaction, ephemeral=True)

My guess is it's when it tries to edit the message, it can't find it.

Tested buttons and select menus using ctx.send_followup(<etc.>). Both worked as expected.

@MacKenzieHnC MacKenzieHnC added the unconfirmed bug A bug report that needs triaging label Jul 17, 2023
@Dorukyum Dorukyum removed the on hold label Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold unconfirmed bug A bug report that needs triaging
Projects
None yet
Development

No branches or pull requests

3 participants