CreateMessageExt

Trait CreateMessageExt 

Source
pub trait CreateMessageExt<'a>: Sized {
    // Required methods
    fn with_reply(
        self,
        reply: &'a Reply,
    ) -> Result<Self, MessageValidationError>;
    fn execute_ignore_permissions<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Message>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
👎Deprecated: Use Reply::create_message instead
Expand description

Convenience methods for CreateMessage

Required Methods§

Source

fn with_reply(self, reply: &'a Reply) -> Result<Self, MessageValidationError>

👎Deprecated: Use Reply::create_message instead

Add the given reply’s data to the message

Overwrites previous fields

§Errors

Returns MessageValidationError if the reply is invalid

Source

fn execute_ignore_permissions<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<Response<Message>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,

👎Deprecated: Use Reply::create_message instead

Send the message, ignoring the error if it’s HttpErrorExt::missing_permissions

Useful when trying to report an error by sending a message

§Errors

Returns Error::Http if creating the response fails and the error is not HttpErrorExt::missing_permissions

Returns Error::User with UserError::Ignore if the error is HttpErrorExt::missing_permissions

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a> CreateMessageExt<'a> for CreateMessage<'a>

Source§

fn with_reply(self, reply: &'a Reply) -> Result<Self, MessageValidationError>

👎Deprecated: Use Reply::create_message instead
Source§

fn execute_ignore_permissions<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<Response<Message>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,

👎Deprecated: Use Reply::create_message instead

Implementors§