Skip to main content

EditCurrentApplication

Struct EditCurrentApplication 

Source
#[non_exhaustive]
pub struct EditCurrentApplication {
Show 13 fields pub custom_install_url: Option<CompactString>, pub description: Option<CompactString>, pub role_connections_verification_url: Option<CompactString>, pub install_params: Option<InstallParams>, pub integration_types_config: Option<IntegrationTypesConfig>, pub flags: Option<ApplicationFlags>, pub icon: Patch<ImageData>, pub cover_image: Patch<ImageData>, pub interactions_endpoint_url: Option<CompactString>, pub tags: Option<Vec<CompactString>>, pub event_webhooks_url: Option<CompactString>, pub event_webhooks_status: Option<EventWebhookStatus>, pub event_webhooks_types: Option<Vec<WebhookEventType>>,
}
Expand description

The body of Edit Current Application.

Every field is optional; only the fields that are set change.

discord.js counterpart: the argument of ClientApplication#edit.

§Examples

use djs_model::{
    application::InstallParams,
    oauth2::Scope,
    permissions::Permissions,
    rest::EditCurrentApplication,
};

let mut body = EditCurrentApplication::default();
body.description = Some("A bot written in Rust".into());
body.install_params = Some(InstallParams::new(
    [Scope::Bot, Scope::ApplicationsCommands],
    Permissions::SEND_MESSAGES,
));
assert_eq!(
    serde_json::to_string(&body)?,
    r#"{"description":"A bot written in Rust","install_params":{"scopes":["bot","applications.commands"],"permissions":"2048"}}"#
);

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§custom_install_url: Option<CompactString>

The custom authorization URL, used when the app’s install link is a custom URL.

§description: Option<CompactString>

The description.

§role_connections_verification_url: Option<CompactString>

The URL that users are sent to to verify their linked roles.

§install_params: Option<InstallParams>

The settings of the in-app authorization link, used when the install link is the one Discord provides.

§integration_types_config: Option<IntegrationTypesConfig>

The default scopes and permissions of each installation context.

§flags: Option<ApplicationFlags>

The public flags. Only GATEWAY_PRESENCE_LIMITED, GATEWAY_GUILD_MEMBERS_LIMITED and GATEWAY_MESSAGE_CONTENT_LIMITED can be changed.

§icon: Patch<ImageData>

The new icon; Patch::Clear removes it.

§cover_image: Patch<ImageData>

The new default rich presence invite cover image; Patch::Clear removes it.

§interactions_endpoint_url: Option<CompactString>

The URL that receives interactions over HTTP instead of the gateway. Discord checks that it answers its validation requests.

§tags: Option<Vec<CompactString>>

Tags describing the app (up to 5, 20 characters each).

§event_webhooks_url: Option<CompactString>

The URL that receives webhook events.

§event_webhooks_status: Option<EventWebhookStatus>

Enables (Enabled) or disables (Disabled) webhook events.

§event_webhooks_types: Option<Vec<WebhookEventType>>

The webhook events to receive.

Trait Implementations§

Source§

impl Clone for EditCurrentApplication

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EditCurrentApplication

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EditCurrentApplication

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for EditCurrentApplication

Source§

impl PartialEq for EditCurrentApplication

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for EditCurrentApplication

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for EditCurrentApplication

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.