[][src]Struct twilight_http::request::channel::invite::CreateInvite

pub struct CreateInvite<'a> { /* fields omitted */ }

Create an invite, with options.

Examples

use twilight_http::Client;
use twilight_model::id::ChannelId;

let client = Client::new("my token");

let channel_id = ChannelId(123);
let invite = client
    .create_invite(channel_id)
    .max_uses(3)
    .await?;

Implementations

impl<'a> CreateInvite<'a>[src]

pub fn max_age(self, max_age: u64) -> Self[src]

Set the maximum age for an invite.

If no age is specified, Discord sets the age to 86400 seconds, or 24 hours. Set to 0 to never expire.

pub fn max_uses(self, max_uses: u64) -> Self[src]

Set the maximum uses for an invite, or 0 for infinite.

Discord defaults this to 0, or infinite.

pub fn temporary(self, temporary: bool) -> Self[src]

Specify true if the invite should grant temporary membership. Defaults to false.

pub fn unique(self, unique: bool) -> Self[src]

Specify true if the invite should be unique. Defaults to false.

If true, don't try to reuse a similar invite (useful for creating many unique one time use invites). Refer to the discord docs for more information.

pub fn target_user(self, target_user: UserId) -> Self[src]

Set the target user for this invite.

pub fn target_user_type(self, target_user_type: TargetUserType) -> Self[src]

Set the target user type for this invite.

pub fn reason(self, reason: impl Into<String>) -> Self[src]

👎 Deprecated since 0.1.5:

please prefer the request::AuditLogReason trait

Attach an audit log reason to this request.

Trait Implementations

impl<'a> AuditLogReason for CreateInvite<'a>[src]

impl<'_> Future for CreateInvite<'_>[src]

type Output = Result<Invite>

The type of value produced on completion.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for CreateInvite<'a>

impl<'a> Send for CreateInvite<'a>

impl<'a> !Sync for CreateInvite<'a>

impl<'a> Unpin for CreateInvite<'a>

impl<'a> !UnwindSafe for CreateInvite<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FutureExt for T where
    T: Future + ?Sized
[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<F> IntoFuture for F where
    F: Future
[src]

type Output = <F as Future>::Output

🔬 This is a nightly-only experimental API. (into_future)

The output that the future will produce on completion.

type Future = F

🔬 This is a nightly-only experimental API. (into_future)

Which kind of future are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<F, T, E> TryFuture for F where
    F: Future<Output = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<Fut> TryFutureExt for Fut where
    Fut: TryFuture + ?Sized
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.