Discord Bot Keeps Thinking After Responding Already

Question:

I’m using py-cord and my Discord bot is thinking even after it has already sent a response.

@client.slash_command()
async def response(ctx, input):
    await ctx.defer(ephemeral=True)
    response = chatbot_client.response(input)
    await ctx.send(response.content)

I’m deferring since the .response function takes so long that the bot will exit out from the command if I don’t.

Is there any fix to it?

Image

Asked By: walker

||

Answers:

@client.slash_command()
async def response(ctx, input):
    await ctx.defer(ephemeral=True)
    response = chatbot_client.response(input)
    await ctx.respond(response.content)

ctx.respond will respond to it: it will be viewable by anyone. Idk if i helped u. If no, you can dm me : Liam_#8834 .

Answered By: dpy
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.