#[non_exhaustive]pub enum Scope {
Show 30 variants
ActivitiesRead,
ActivitiesWrite,
ApplicationsBuildsRead,
ApplicationsBuildsUpload,
ApplicationsCommands,
ApplicationsCommandsUpdate,
ApplicationsCommandsPermissionsUpdate,
ApplicationsEntitlements,
ApplicationsStoreUpdate,
Bot,
Connections,
DmChannelsRead,
Email,
GdmJoin,
Guilds,
GuildsJoin,
GuildsMembersRead,
Identify,
IdentifyPremium,
MessagesRead,
RelationshipsRead,
RoleConnectionsWrite,
Rpc,
RpcActivitiesWrite,
RpcNotificationsRead,
RpcVoiceRead,
RpcVoiceWrite,
Voice,
WebhookIncoming,
Unknown(CompactString),
}Expand description
An OAuth2 scope: what an application may do on a user’s behalf.
discord.js counterpart: OAuth2Scopes.
§Examples
use djs_model::oauth2::Scope;
let scope: Scope = serde_json::from_str(r#""applications.commands""#).unwrap();
assert_eq!(scope, Scope::ApplicationsCommands);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ActivitiesRead
Read the user’s “Now Playing/Recently Played” list (not available for apps).
ActivitiesWrite
Update the user’s activity (not available for apps).
ApplicationsBuildsRead
Read build data of the user’s applications.
ApplicationsBuildsUpload
Upload builds for the user’s applications (approved partners only).
ApplicationsCommands
Add application commands to a guild (included with bot).
ApplicationsCommandsUpdate
Update the app’s commands with a client-credentials bearer token.
ApplicationsCommandsPermissionsUpdate
Update the permissions of the app’s commands in a guild the user can manage.
ApplicationsEntitlements
Read entitlements of the user’s applications.
ApplicationsStoreUpdate
Read and update store data of the user’s applications.
Bot
Add the app’s bot to the guild the user selects.
Connections
List the user’s linked third-party accounts.
DmChannelsRead
See the user’s DMs and group DMs (approved partners only).
Read the user’s email address.
GdmJoin
Add the user to group DMs.
Guilds
List the user’s guilds.
GuildsJoin
Add the user to guilds.
GuildsMembersRead
Read the user’s member data in their guilds.
Identify
Read the user’s account (without email).
IdentifyPremium
Read the user’s Nitro subscription type.
MessagesRead
Read messages from all client channels (local RPC server).
RelationshipsRead
Read the user’s friends, pending requests and blocked users (Social SDK).
RoleConnectionsWrite
Update the user’s connection and metadata for the app (linked roles).
Rpc
Control the user’s local Discord client (approved partners only).
RpcActivitiesWrite
Update the user’s activity over RPC (approved partners only).
RpcNotificationsRead
Receive notifications pushed to the user over RPC (approved partners only).
RpcVoiceRead
Read the user’s voice settings over RPC (approved partners only).
RpcVoiceWrite
Update the user’s voice settings over RPC (approved partners only).
Voice
Connect to voice on the user’s behalf (approved partners only).
WebhookIncoming
Create a webhook returned in the OAuth2 token response.
Unknown(CompactString)
A value that this version of the library does not know about.
Discord may add new values at any time. They are preserved here so that no
information is lost and deserialization never fails because of them. Prefer
Scope::from over constructing this variant directly.
Implementations§
Source§impl Scope
impl Scope
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the string Discord uses for this value.
discord.js counterpart: the enum’s string value in discord-api-types.
Sourcepub const fn is_unknown(&self) -> bool
pub const fn is_unknown(&self) -> bool
Returns true for a value this version of the library does not know about.
discord.js counterpart: none (discord.js passes unknown strings through).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Scope
impl<'de> Deserialize<'de> for Scope
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl Eq for Scope
Source§impl Ord for Scope
impl Ord for Scope
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Auto Trait Implementations§
impl Forget for Scope
impl Freeze for Scope
impl Move for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnsafeUnpin for Scope
impl UnwindSafe for Scope
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more