Skip to content

Struct PartialMessage

zaun_client::PartialMessage · Struct

pub struct PartialMessage { … }

A message known only by its id, as an edit, a deletion or a reaction names it: the client keeps no message history, so its text and author are not at hand. It acts like a Message.

pub const fn id(&self) -> MessageId

Its id.

pub const fn channel(&self) -> &Channel

Its channel.

pub const fn community(&self) -> &Community

Its community.

pub fn reply<impl Into<MessageOptions>>(&self, options: impl Into<MessageOptions>) -> Result<Message>

Answers this message in its channel: text, or MessageOptions.

As Channel::send.

pub fn edit<impl Into<EditMessage>>(&self, options: impl Into<EditMessage>) -> Result<()>

Edits this message (one of this member’s): new text, or an EditMessage with its text and new embeds (whose pictures must be attachments the message already has) or mentions.

No text given ([Error::Protocol]: a partial message does not know its own, and the protocol replaces it), or as Message::edit.

pub fn delete(&self) -> Result<()>

Deletes this message (one’s own, or any with MANAGE_MESSAGES).

The host refused or did not answer.

pub fn react(&self, emoji: &str) -> Result<()>

Adds emoji as this member.

The host refused or did not answer.

pub fn unreact(&self, emoji: &str) -> Result<()>

Takes this member’s emoji off.

The host refused or did not answer.

Clone, Debug, From<&Message>, PartialEq

Full rustdoc page