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 insteadExpand description
Convenience methods for CreateMessage
Required Methods§
Sourcefn with_reply(self, reply: &'a Reply) -> Result<Self, MessageValidationError>
👎Deprecated: Use Reply::create_message instead
fn with_reply(self, reply: &'a Reply) -> Result<Self, MessageValidationError>
Reply::create_message insteadAdd the given reply’s data to the message
Overwrites previous fields
§Errors
Returns MessageValidationError if the
reply is invalid
Sourcefn 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
fn execute_ignore_permissions<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<Response<Message>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
Reply::create_message insteadSend 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>
impl<'a> CreateMessageExt<'a> for CreateMessage<'a>
Source§fn with_reply(self, reply: &'a Reply) -> Result<Self, MessageValidationError>
fn with_reply(self, reply: &'a Reply) -> Result<Self, MessageValidationError>
👎Deprecated: Use
Reply::create_message instead