Dissonity
Unity SDK for Discord activities
Loading...
Searching...
No Matches
Dissonity.Api.Commands Class Reference

Subclass that allows sending RPC commands. More...

Static Public Member Functions

static async Task CaptureLog (string consoleLevel, string message)
 Forward logs to your own logger.

No scopes required.

-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

 
static async Task< EncourageHardwareAccelerationDataEncourageHardwareAcceleration ()
 Presents a modal dialog to allow enabling of hardware acceleration.

No scopes required.

-------------------—
✅ | Web
⛔️ | iOS
⛔️ | Android
-------------------—

 
static async Task< ChannelRpc?> GetChannel (long channelId)
 Returns information about the channel for a provided channel ID.

Scopes required: guilds (+ dm_channels.read for (G)DM channels.)

dm_channels.read requires approval from Discord.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

 
static async Task< GetChannelPermissionsDataGetChannelPermissions ()
 Returns permissions for the current user in the currently connected channel.

Scopes required: guilds.members.read
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

 
static async Task< Entitlement[]> GetEntitlements ()
 Returns a list of entitlements for the current user.

No scopes required.

-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

 
static async Task< Sku[]> GetSkus ()
 Returns a list of SKU objects. SKUs without prices are automatically filtered out.

No scopes required.

-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

 
static async Task< Entitlement[]> StartPurchase (long skuId)
 Launches the purchase flow for a specific SKU ID.

No scopes required.

-------------------—
✅ | Web
⛔️ | iOS
⛔️ | Android
-------------------—

 
static async Task< GetPlatformBehaviorsDataGetPlatformBehaviors ()
 Returns information about supported platform behaviors.

No scopes required.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

 
static async Task< OpenExternalLinkDataOpenExternalLink (string url)
 Allows for opening an external link from within the Discord client.

No scopes required.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

 
static async Task OpenInviteDialog ()
 Presents a modal dialog with Channel Invite UI.

No scopes required.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

 
static async Task OpenShareMomentDialog (string mediaUrl)
 Presents a modal dialog to share media to a channel or direct message.

No scopes required.
-------------------—
✅ | Web
⛔️ | iOS
⛔️ | Android
-------------------—

 
static async Task< ActivitySetActivity (ActivityBuilder activity)
 Modifies how your activity's rich presence is displayed in the Discord client.

Scopes required: rpc.activities.write
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

 
static async Task< SetConfigDataSetConfig (bool useInteractivePip)
 Set whether or not the PIP (picture-in-picture) is interactive.

No scopes required.
-------------------—
✅ | Web
⛔ | iOS
⛔ | Android
-------------------—

 
static async Task SetOrientationLockState (OrientationLockStateType lockState, OrientationLockStateType? pipLockState=null, OrientationLockStateType? gridLockState=null)
 Locks the application to specific orientations in each of the supported layout modes.

No scopes required.
-------------------—
⛔️ | Web
✅ | iOS
✅ | Android
-------------------—

 
static async Task< UserSettingsGetLocaleDataUserSettingsGetLocale ()
 Returns the current user's locale.

Scopes required: identify
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

 
static async Task< InitiateImageUploadDataInitiateImageUpload ()
 Presents the file upload flow in the Discord client.

No scopes required.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

 
static async Task< Participant[]> GetInstanceConnectedParticipants ()
 Returns all participants connected to the instance.

No scopes required.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

 
static async Task< ShareLinkDataShareLink (string message, string? customId=null, string? linkId=null)
 Presents a modal for the user to share a link to your activity with custom query params.

No scopes required.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

 
static async Task< Relationship[]> GetRelationships ()
 Returns the current user's relationships.

Scopes required: relationships.read

relationships.read requires approval from Discord.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

 

Detailed Description

Subclass that allows sending RPC commands.

Member Function Documentation

◆ CaptureLog()

static async Task Dissonity.Api.Commands.CaptureLog ( string consoleLevel,
string message )
inlinestatic

Forward logs to your own logger.

No scopes required.

-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ EncourageHardwareAcceleration()

static async Task< EncourageHardwareAccelerationData > Dissonity.Api.Commands.EncourageHardwareAcceleration ( )
inlinestatic

Presents a modal dialog to allow enabling of hardware acceleration.

No scopes required.

-------------------—
✅ | Web
⛔️ | iOS
⛔️ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ GetChannel()

static async Task< ChannelRpc?> Dissonity.Api.Commands.GetChannel ( long channelId)
inlinestatic

Returns information about the channel for a provided channel ID.

Scopes required: guilds (+ dm_channels.read for (G)DM channels.)

dm_channels.read requires approval from Discord.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ GetChannelPermissions()

static async Task< GetChannelPermissionsData > Dissonity.Api.Commands.GetChannelPermissions ( )
inlinestatic

Returns permissions for the current user in the currently connected channel.

Scopes required: guilds.members.read
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ GetEntitlements()

static async Task< Entitlement[]> Dissonity.Api.Commands.GetEntitlements ( )
inlinestatic

Returns a list of entitlements for the current user.

No scopes required.

-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ GetInstanceConnectedParticipants()

static async Task< Participant[]> Dissonity.Api.Commands.GetInstanceConnectedParticipants ( )
inlinestatic

Returns all participants connected to the instance.

No scopes required.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ GetPlatformBehaviors()

static async Task< GetPlatformBehaviorsData > Dissonity.Api.Commands.GetPlatformBehaviors ( )
inlinestatic

Returns information about supported platform behaviors.

No scopes required.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ GetRelationships()

static async Task< Relationship[]> Dissonity.Api.Commands.GetRelationships ( )
inlinestatic

Returns the current user's relationships.

Scopes required: relationships.read

relationships.read requires approval from Discord.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ GetSkus()

static async Task< Sku[]> Dissonity.Api.Commands.GetSkus ( )
inlinestatic

Returns a list of SKU objects. SKUs without prices are automatically filtered out.

No scopes required.

-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ InitiateImageUpload()

static async Task< InitiateImageUploadData > Dissonity.Api.Commands.InitiateImageUpload ( )
inlinestatic

Presents the file upload flow in the Discord client.

No scopes required.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ OpenExternalLink()

static async Task< OpenExternalLinkData > Dissonity.Api.Commands.OpenExternalLink ( string url)
inlinestatic

Allows for opening an external link from within the Discord client.

No scopes required.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ OpenInviteDialog()

static async Task Dissonity.Api.Commands.OpenInviteDialog ( )
inlinestatic

Presents a modal dialog with Channel Invite UI.

No scopes required.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ OpenShareMomentDialog()

static async Task Dissonity.Api.Commands.OpenShareMomentDialog ( string mediaUrl)
inlinestatic

Presents a modal dialog to share media to a channel or direct message.

No scopes required.
-------------------—
✅ | Web
⛔️ | iOS
⛔️ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ SetActivity()

static async Task< Activity > Dissonity.Api.Commands.SetActivity ( ActivityBuilder activity)
inlinestatic

Modifies how your activity's rich presence is displayed in the Discord client.

Scopes required: rpc.activities.write
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ SetConfig()

static async Task< SetConfigData > Dissonity.Api.Commands.SetConfig ( bool useInteractivePip)
inlinestatic

Set whether or not the PIP (picture-in-picture) is interactive.

No scopes required.
-------------------—
✅ | Web
⛔ | iOS
⛔ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ SetOrientationLockState()

static async Task Dissonity.Api.Commands.SetOrientationLockState ( OrientationLockStateType lockState,
OrientationLockStateType? pipLockState = null,
OrientationLockStateType? gridLockState = null )
inlinestatic

Locks the application to specific orientations in each of the supported layout modes.

No scopes required.
-------------------—
⛔️ | Web
✅ | iOS
✅ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ ShareLink()

static async Task< ShareLinkData > Dissonity.Api.Commands.ShareLink ( string message,
string? customId = null,
string? linkId = null )
inlinestatic

Presents a modal for the user to share a link to your activity with custom query params.

No scopes required.
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ StartPurchase()

static async Task< Entitlement[]> Dissonity.Api.Commands.StartPurchase ( long skuId)
inlinestatic

Launches the purchase flow for a specific SKU ID.

No scopes required.

-------------------—
✅ | Web
⛔️ | iOS
⛔️ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

◆ UserSettingsGetLocale()

static async Task< UserSettingsGetLocaleData > Dissonity.Api.Commands.UserSettingsGetLocale ( )
inlinestatic

Returns the current user's locale.

Scopes required: identify
-------------------—
✅ | Web
✅ | iOS
✅ | Android
-------------------—

Exceptions
InvalidOperationException
CommandException

The documentation for this class was generated from the following file: