I’m using py-cord and my Discord bot is thinking even after it has already sent a response.
JavaScript
x
6
1
@client.slash_command()
2
async def response(ctx, input):
3
await ctx.defer(ephemeral=True)
4
response = chatbot_client.response(input)
5
await ctx.send(response.content)
6
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?
Advertisement
Answer
JavaScript
1
6
1
@client.slash_command()
2
async def response(ctx, input):
3
await ctx.defer(ephemeral=True)
4
response = chatbot_client.response(input)
5
await ctx.respond(response.content)
6
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 .