question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Return a disnake.Message object when inter.send() -ing

See original GitHub issue

Summary

Doing ctx.send with disnake.Context returns a disnake. Message object, while inter.send doesn’t return anything. I suggest to return the message

What is the feature request for?

The core library

The Problem

Disclaimer: I’m going to use ctx as a keyword, but that’s still an interaction. If I use ctx.send('Hello world') in a message command (with disnake.Context), the method returns a disnake.Message. In the contrary, using ctx.send('Hello world') in a slash command, component… (with disnake.Interaction), the method doesn’t return anything.

The Ideal Solution

Using ctx.send('Hello world') with disnake.Interaction returns a disnake.Message object.

The Current Solution

Using ctx.send('Hello world') with disnake.Interaction doesn’t return anything (because the API doesn’t return anything, I consider fetching the message after sending it to return an object).

Additional Context

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
PetitPotironcommented, Nov 17, 2021

Indeed, the API doesn’t return the message when responding to application command interactions. This is intended behavior, if you really need a message object and edit_original_message/delete_original_message isn’t an option for you, use await ctx.original_message().

I think I badly explained. I want to get the interaction response message.

If I understand correctly, the best solution for you would be await ctx.original_message(), which fetches and returns the original message. Link to documentation.

That’s exactly what I want, thanks for your help.

0reactions
Victorsitoucommented, Nov 17, 2021

I think I badly explained. I want to get the interaction response message.

If I understand correctly, the best solution for you would be await ctx.original_message(), which fetches and returns the original message. Link to documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

API Reference - disnake
Returns a partial messageable with the given channel ID. This is useful if you have a channel_id but don't want to do an...
Read more >
How to get the interaction response message object - discord.py
await interaction.original_response() returns the message of the interaction response. Integrating this into the full code:
Read more >
Frequently Asked Questions - discord.py
Messageable.send() returns the Message that was sent. The ID of a message can be ... To upload something to Discord you have to...
Read more >
disnake.utils.get Example - Program Talk
3: await message.channel.send(Messages.verify_verify_format) return login ... to Member if isinstance(item, int): role = disnake.utils.get(ctx.author.roles, ...
Read more >
All you need to know about Buttons in Discord.py & Pycord
This is the Ultimate Python Guide on Buttons with Discord.py or Pycord. In this video, I talk about how to create buttons in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found