pub struct CreateWebhook<'a> { /* private fields */ }
Expand description
Implementations§
Source§impl<'a> CreateWebhook<'a>
impl<'a> CreateWebhook<'a>
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Creates a new builder with the given webhook name, leaving all other fields empty.
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Set the webhook’s name, replacing the current value as set in Self::new
.
This must be between 1-80 characters.
Sourcepub fn avatar(self, avatar: &CreateAttachment) -> Self
pub fn avatar(self, avatar: &CreateAttachment) -> Self
Set the webhook’s default avatar.
Sourcepub fn audit_log_reason(self, reason: &'a str) -> Self
pub fn audit_log_reason(self, reason: &'a str) -> Self
Sets the request’s audit log reason.
Trait Implementations§
Source§impl Builder for CreateWebhook<'_>
impl Builder for CreateWebhook<'_>
Source§fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates the webhook.
§Errors
If the provided name is less than 2 characters, returns ModelError::NameTooShort
. If it
is more than 100 characters, returns ModelError::NameTooLong
.
Returns a Error::Http
if the current user lacks permission, or if invalid data is
given.
Source§type Context<'ctx> = ChannelId
type Context<'ctx> = ChannelId
Additional data that’s only required when sending a request off to the API.
type Built = Webhook
Source§impl<'a> Clone for CreateWebhook<'a>
impl<'a> Clone for CreateWebhook<'a>
Source§fn clone(&self) -> CreateWebhook<'a>
fn clone(&self) -> CreateWebhook<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for CreateWebhook<'a>
impl<'a> Debug for CreateWebhook<'a>
Auto Trait Implementations§
impl<'a> Freeze for CreateWebhook<'a>
impl<'a> RefUnwindSafe for CreateWebhook<'a>
impl<'a> Send for CreateWebhook<'a>
impl<'a> Sync for CreateWebhook<'a>
impl<'a> Unpin for CreateWebhook<'a>
impl<'a> UnwindSafe for CreateWebhook<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more