pub struct ReplyHandle<'a>(/* private fields */);
Expand description
Returned from send_reply()
to operate on the sent message
Discord sometimes returns the serenity::Message
object directly, but sometimes you have to
request it manually. This enum abstracts over the two cases
Implementations§
Source§impl ReplyHandle<'_>
impl ReplyHandle<'_>
Sourcepub async fn into_message(self) -> Result<Message, Error>
pub async fn into_message(self) -> Result<Message, Error>
Retrieve the message object of the sent reply.
Note: to delete or edit, use ReplyHandle::delete()
and ReplyHandle::edit()
directly!
Doing it via the methods from a Message object will fail for ephemeral messages
If you don’t need ownership of Message, you can use ReplyHandle::message
Only needs to do an HTTP request in the application command response case
Sourcepub async fn message(&self) -> Result<Cow<'_, Message>, Error>
pub async fn message(&self) -> Result<Cow<'_, Message>, Error>
Retrieve the message object of the sent reply.
Note: to delete or edit, use ReplyHandle::delete()
and ReplyHandle::edit()
directly!
Doing it via the methods from a Message object will fail for ephemeral messages
Returns a reference to the known Message object, or fetches the message from the discord API.
To get an owned serenity::Message
, use Self::into_message()
Sourcepub async fn edit<U, E>(
&self,
ctx: Context<'_, U, E>,
builder: CreateReply,
) -> Result<(), Error>
pub async fn edit<U, E>( &self, ctx: Context<'_, U, E>, builder: CreateReply, ) -> Result<(), Error>
Edits the message that this ReplyHandle
points to
Trait Implementations§
Source§impl<'a> Clone for ReplyHandle<'a>
impl<'a> Clone for ReplyHandle<'a>
Source§fn clone(&self) -> ReplyHandle<'a>
fn clone(&self) -> ReplyHandle<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more