pycord icon indicating copy to clipboard operation
pycord copied to clipboard

Set `discord.ui.View.message` on an interaction followup

Open tiltowait opened this issue 3 years ago • 0 comments

Summary

View.message should be set when the message is sent via Interaction.followup.send().

What is the feature request for?

The core library

The Problem

Interaction.response.send_message() sets the View.message property. For consistency, this property should also be set when using Interaction.followup.send().

The Ideal Solution

The following assertion should pass:

view = SomeView()
await interaction.followup.send("My message", view=view)
assert view.message is not None

This would prevent errors if setting disable_on_timeout=True or otherwise manipulating the message property.

The Current Solution

You must manually set View.message using the return value of Interaction.followup.send().

Additional Context

No response

tiltowait avatar Aug 27 '22 16:08 tiltowait