Configuration

// Config: Engine - [], Toolkit - [v1.0.0]

Beyond the initial settings covered in Initialization, Discord Social exposes its runtime events through an Inspector-friendly component and through the Game Framework Bus.

Discord Event Triggers #

Heathen.DiscordSocialIntegration.DiscordEventTriggers subscribes to the events DiscordSocialApp raises, covering connection state, relationships, lobbies, voice and activities, and re-exposes each as a public UnityEvent you can wire in the Inspector with no code. Its custom editor lets you pick which events to show, so you do not have to scroll past the ones you do not need.

Add one DiscordEventTriggers component wherever you want to react to Discord state changes, for example to refresh a friends list when a relationship event fires, or to update a call HUD when voice state changes.

Bus messages #

Every event is also published on the Game Framework Bus under Heathen.Discord, so systems that do not hold a reference to DiscordSocialApp can still listen.

Remember Sign In #

Remember Sign In is on by default. The Foundation keeps the token with PersistentDiscordTokenStore, encrypted in PlayerPrefs with a key derived from the device, and signs the player in again on the next launch. That is obfuscation tied to the device, not a vault. To store tokens somewhere of your own, assign your own IDiscordTokenStore to DiscordSocialApp.TokenStore before initialising, backed by encrypted or platform-protected storage. Turn the setting off in Project Settings, Subsystems, Discord Social to stop remembering the player.

Logging #

Logging goes through System Log, with a category per area: Discord.App, Discord.Auth, Discord.Lobby, Discord.Voice, Discord.Presence, Discord.Messaging, Discord.Relationships and Discord.Guilds. No credential is ever logged.

uGUI components #

The paid Toolkit for Discord Social adds ready-made uGUI components that consume the same event surface: DiscordUserProfile, DiscordUserList, DiscordUserGroupsDisplay, DiscordGuildList, DiscordGuildProfile, SetDiscordUserAvatar and SetDiscordUserName.

Rate This Article!