pub struct EditWebhook<'a> { /* private fields */ }
Expand description
Implementations§
Source§impl<'a> EditWebhook<'a>
impl<'a> EditWebhook<'a>
Sourcepub fn new() -> Self
pub fn new() -> Self
Equivalent to Self::default
.
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Set the webhook’s name.
This must be between 1-80 characters.
Sourcepub fn channel_id(self, channel_id: impl Into<ChannelId>) -> Self
pub fn channel_id(self, channel_id: impl Into<ChannelId>) -> Self
Set the channel to move the webhook to.
Sourcepub fn avatar(self, avatar: &CreateAttachment) -> Self
pub fn avatar(self, avatar: &CreateAttachment) -> Self
Set the webhook’s default avatar.
Sourcepub fn delete_avatar(self) -> Self
pub fn delete_avatar(self) -> Self
Delete the webhook’s avatar, resetting it to the default logo.
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 EditWebhook<'_>
impl Builder for EditWebhook<'_>
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,
Edits the webhook corresponding to the provided WebhookId
and token, and returns the
resulting new Webhook
.
§Errors
Returns Error::Http
if the content is malformed, or if the token is invalid.
Returns Error::Json
if there is an error in deserialising Discord’s response.
Source§type Context<'ctx> = (WebhookId, Option<&'ctx str>)
type Context<'ctx> = (WebhookId, Option<&'ctx str>)
Additional data that’s only required when sending a request off to the API.
type Built = Webhook
Source§impl<'a> Clone for EditWebhook<'a>
impl<'a> Clone for EditWebhook<'a>
Source§fn clone(&self) -> EditWebhook<'a>
fn clone(&self) -> EditWebhook<'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 EditWebhook<'a>
impl<'a> Debug for EditWebhook<'a>
Source§impl<'a> Default for EditWebhook<'a>
impl<'a> Default for EditWebhook<'a>
Source§fn default() -> EditWebhook<'a>
fn default() -> EditWebhook<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for EditWebhook<'a>
impl<'a> RefUnwindSafe for EditWebhook<'a>
impl<'a> Send for EditWebhook<'a>
impl<'a> Sync for EditWebhook<'a>
impl<'a> Unpin for EditWebhook<'a>
impl<'a> UnwindSafe for EditWebhook<'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