Struct twilight_http::request::channel::webhook::CreateWebhook
source · [−]pub struct CreateWebhook<'a> { /* private fields */ }
Expand description
Create a webhook in a channel.
Examples
use twilight_http::Client;
use twilight_model::id::Id;
let client = Client::new("my token".to_owned());
let channel_id = Id::new(123);
let webhook = client
.create_webhook(channel_id, "Twily Bot")?
.exec()
.await?;
Implementations
sourceimpl<'a> CreateWebhook<'a>
impl<'a> CreateWebhook<'a>
sourcepub const fn avatar(self, avatar: &'a str) -> Self
pub const fn avatar(self, avatar: &'a str) -> Self
Set the avatar of the webhook.
This must be a Data URI, in the form of
data:image/{type};base64,{data}
where {type}
is the image MIME type
and {data}
is the base64-encoded image. See Discord Docs/Image Data.
sourcepub fn exec(self) -> ResponseFuture<Webhook>ⓘNotable traits for ResponseFuture<T>impl<T: Unpin> Future for ResponseFuture<T> type Output = Result<Response<T>, Error>;
pub fn exec(self) -> ResponseFuture<Webhook>ⓘNotable traits for ResponseFuture<T>impl<T: Unpin> Future for ResponseFuture<T> type Output = Result<Response<T>, Error>;
Execute the request, returning a future resolving to a Response
.
Trait Implementations
sourceimpl<'a> AuditLogReason<'a> for CreateWebhook<'a>
impl<'a> AuditLogReason<'a> for CreateWebhook<'a>
sourceimpl TryIntoRequest for CreateWebhook<'_>
impl TryIntoRequest for CreateWebhook<'_>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more