discord.app.context.InteractionContext.respond() should return a Message refrence like discord.ext.commands.context.Context.send() does
Summary
It shouldn't return none like it currently does.
What is the feature request for?
The core library
The Problem
I need a reference to a message after sending it. How do I go about it with the .respond() method? Before, this code worked:
Msg: discord.Message = await ctx.send(
embed=discord.Embed(title="Loading...")
)
after migration, this is the code I came up with
Msg: discord.Message = await ctx.response.send_message(
embed=discord.Embed(title="Loading...")
)
But now it doesn't, as sending returns none
The Ideal Solution
I dug into the inner workings, but it was too complex for me to understand, maybe return the adapter.create_interaction_response?
The Current Solution
There isn't any that I know of. I tried ctx.channel.send, that works, but it fails when there is a view= parameter, which I need in some parts of the code as well. Please help!!!
Additional Context
No response
WAIT. AFTER LOSING MANY SLEEPS I THINK I HAVE ANSWER. You send the message using chcannel.send to get id, then do a .edit with the view. Brute force af but noth better rn
But if theres a better solution lmk
You might be looking for Interaction.original_message.
You might be looking for
Interaction.original_message.
acutally, upon further digging, I was able to use await ctx.interaction.original_message(). So thanks! it actually did work
At a first look, I agree with this. I have to look further but we may implement this.
thank you!
This was addressed in #356. While InteractionResponse.send_message() doesn't return the Message as that would require an API call, it does now return the Interaction object, from which the message can then be retrieved by users.