pycord: ctx.defer() doesnt always work

Summary

ctx.defer() doesnt always work

Reproduction Steps

use /ping a couple times or every once in a while (As sometimes it works fine for 30m before it does it) and boom this application did not respond.

I have tested this on my bot host, my own vps, locally, and on my friend dedi server.

YUQENOVI09 python_eTmhNfGter

Minimal Reproducible Code

@CLIENT.slash_command(name = "ping", description = "Check the latency to ensure the bot is running.")
@commands.cooldown(1, 30, commands.BucketType.user)
async def ping(ctx):
    await ctx.defer()

    await ctx.respond(f'Pong! {round (CLIENT.latency * 1000)} ms')

@ping.error
async def ping_error(ctx, error):
    if isinstance(error, commands.CommandOnCooldown):
        error = 'Please try again in {:.2f}s'.format(error.retry_after)
        await ctx.respond(error, ephemeral=True)

    else:
        raise error

Expected Results

to not get the “this application did not respond”

Actual Results

got “this application did not respond”

Intents

CLIENT = discord.Bot(intents=discord.Intents.all())

System Information

cmd_5m9ycsQRD7

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

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (2 by maintainers)

Most upvoted comments

referring to https://github.com/Pycord-Development/pycord/pull/1039 I dont think this is related to my issue as I downloaded mih fork of the library and still experience the issue of application did not respond

We consider bugs confirmed once we’ve actually done our due diligence in reviewing them, not based on the number of reports.

That being said, it does seem like this could be related to the aforementioned issue, but it needs more review still to confirm. Appreciate you calling out their potential link, thank you!