Blueprint API

Blueprint API

DiscordPulse exposes one Blueprint-friendly Game Instance subsystem with:

  • 22 callable or pure Blueprint nodes
  • 9 bindable Blueprint events
  • 3 Blueprint enums
  • 2 Blueprint structs
  • 20 configurable Rich Presence activity fields

All DiscordPulse nodes are available from:

Get Game Instance Subsystem
  Class = Discord Presence Subsystem

Always validate the returned subsystem before using it. In UE 5.7, do not fetch the subsystem from Blueprint Game Instance Event Init; Game Instance Subsystems do not exist yet when that event runs.

Return Values And Asynchronous Results

Most callable nodes return EDiscordPresenceResult.

For activity nodes, an immediate Success means the request passed local validation and was submitted. It does not prove Discord displayed the activity.

Bind these events before initialization:

On Discord Activity Updated
On Discord Error

On Discord Activity Updated confirms Discord accepted an activity update.

Initialization Nodes

Initialize Discord Presence

Loads the Discord Social SDK, creates the client, starts callback polling, and begins connecting.

PinTypeDescription
Application IdStringRequired numeric Discord application ID
Optional Steam App IdStringOptional numeric Steam application ID used for launch registration
Auto RegisterBooleanAttempts Discord launch-command registration when no Steam ID is supplied
Require Discord RunningBooleanFails initialization when Discord desktop is not detected
Return ValueEDiscordPresenceResultImmediate local initialization result

Calling this again with the same Application ID is safe. Calling it with a new Application ID restarts the SDK session.

Shutdown Discord Presence

Stops callback polling, clears local state, disconnects the Discord client, and releases the SDK library handle.

PinTypeDescription
Return ValueEDiscordPresenceResultShutdown result

Safe to call more than once.

Restart Discord Presence

Shuts down the current session and initializes again.

PinTypeDescription
Application IdStringRequired numeric Discord application ID
Optional Steam App IdStringOptional numeric Steam application ID
Auto RegisterBooleanAttempts launch-command registration
Require Discord RunningBooleanRequires Discord desktop to be detected
Return ValueEDiscordPresenceResultImmediate restart result

Is Discord Presence Initialized

OutputTypeDescription
Return ValueBooleanWhether the subsystem owns a valid initialized SDK client

Is Discord Running

OutputTypeDescription
Return ValueBooleanBest-known Discord desktop and SDK connection state

Desktop process detection is best effort. SDK activity and error callbacks are authoritative after initialization.

Get Last Discord Error

OutputTypeDescription
Return ValueStringLatest human-readable plugin or SDK error

Get Last Discord Result

OutputTypeDescription
Return ValueEDiscordPresenceResultLatest structured result value

Get Last Discord Error Code

OutputTypeDescription
Return ValueIntegerLatest native or Discord SDK error code

Full Activity Nodes

Set Discord Activity

Submits a complete FDiscordPresenceActivity.

PinTypeDescription
ActivityFDiscordPresenceActivityFull Rich Presence activity
Return ValueEDiscordPresenceResultImmediate submission result

Wait for On Discord Activity Updated or On Discord Error for the final asynchronous result.

Update Discord Activity

Alias for Set Discord Activity.

PinTypeDescription
ActivityFDiscordPresenceActivityFull replacement activity
Return ValueEDiscordPresenceResultImmediate submission result

Clear Discord Activity

Clears the desired and cached activity, then asks Discord to remove the currently displayed Rich Presence when the SDK client is ready.

PinTypeDescription
Return ValueEDiscordPresenceResultClear result

Returns Not Initialized when no SDK client exists.

Reset Discord Activity

Resets the cached activity and clears Discord when initialized.

PinTypeDescription
Return ValueEDiscordPresenceResultReset result

Safe before initialization; returns Success when there is no SDK client.

Get Current Discord Activity

OutputTypeDescription
Return ValueFDiscordPresenceActivityLast activity accepted by Discord

This is not simply the latest requested activity.

Convenience Presence Nodes

Set Simple Presence

Creates an activity containing only details and state.

PinTypeDescription
DetailsStringPrimary activity text
StateStringSecondary activity text
Return ValueEDiscordPresenceResultImmediate submission result

Set Presence With Images

Creates an activity with text and image assets.

PinTypeDescription
DetailsStringPrimary activity text
StateStringSecondary activity text
Large Image KeyStringUploaded Discord asset key or supported image URL
Large Image TextStringLarge-image hover text
Small Image KeyStringOptional uploaded asset key
Small Image TextStringOptional small-image hover text
Return ValueEDiscordPresenceResultImmediate submission result

Discord saves uploaded asset keys in lowercase.

Set Presence With Time

Creates an activity with optional elapsed time.

PinTypeDescription
DetailsStringPrimary activity text
StateStringSecondary activity text
Use Elapsed TimeBooleanSets the start timestamp to the current UTC Unix time
Return ValueEDiscordPresenceResultImmediate submission result

Set Presence For Main Menu

Publishes the built-in activity:

Details = "In Main Menu"
State = "Preparing a run"
PinTypeDescription
Return ValueEDiscordPresenceResultImmediate submission result

Set Presence For Level

Publishes the supplied level name and starts elapsed time.

Details = "Playing <LevelName>"
State = "<LevelName>"
PinTypeDescription
Level NameStringDisplayed level name
Return ValueEDiscordPresenceResultImmediate submission result

Set Presence For Match

Publishes a mode name, player counts, party values, and elapsed time.

Details = "Playing <ModeName>"
State = "<CurrentPlayers> of <MaxPlayers> players"
PinTypeDescription
Mode NameStringMatch or game-mode name
Current PlayersIntegerCurrent party size; negative values are clamped to zero
Max PlayersIntegerMaximum party size; negative values are clamped to zero
Return ValueEDiscordPresenceResultImmediate submission result

This convenience node does not set a Party ID or Join Secret. Use Set Discord Activity for joinable matches.

Clear Presence

Alias for Clear Discord Activity.

PinTypeDescription
Return ValueEDiscordPresenceResultClear result

Invite Node

Respond To Discord Join Request

Responds to a pending request received from On Discord Join Request Received.

PinTypeDescription
User IdStringUser ID supplied by the incoming request event
ResponseEDiscordPresenceJoinResponseYes, No, or Ignore
Return ValueEDiscordPresenceResultImmediate response result

Yes sends a positive reply through the Social SDK. No and Ignore remove the pending request locally because the SDK helper does not expose a distinct reject reply.

Utility Node

Get Discord Unix Timestamp Now

Static pure utility node that returns the current UTC Unix timestamp.

OutputTypeDescription
Return ValueInteger 64Timestamp suitable for activity start and end fields

Blueprint Events

EventPayloadFires When
On Discord InitializedApplication IdLocal SDK initialization and connection startup complete
On Discord Initialization FailedResult, Error Code, Error MessageInitialization fails
On Discord Activity UpdatedActivityDiscord accepts an activity update
On Discord Activity ClearedNoneA clear request completes locally
On Discord DisconnectedError Code, Error MessageDiscord becomes unavailable after being known as running
On Discord ErrorResult, Error Code, Error MessageA plugin or SDK operation fails
On Discord Join RequestedSecretThe local user accepts an invite and Discord supplies a join secret
On Discord Spectate RequestedSecretCompatibility event; not expected from the current Social SDK activity implementation
On Discord Join Request ReceivedUserAnother Discord user requests to join the current activity

FDiscordPresenceActivity

FDiscordPresenceActivity is the full Rich Presence configuration struct.

FieldTypePurpose
DetailsStringPrimary activity text; Discord limit is 128 UTF-8 bytes
StateStringSecondary activity text; Discord limit is 128 UTF-8 bytes
Large Image KeyStringLarge uploaded asset key or supported image URL
Large Image TextStringLarge-image hover text
Small Image KeyStringSmall uploaded asset key
Small Image TextStringSmall-image hover text
Start TimestampInteger 64Unix timestamp used for elapsed time
End TimestampInteger 64Unix timestamp used for countdown/end time
Party IdStringStable party or lobby identifier
Party SizeIntegerCurrent party size
Party MaxIntegerMaximum party size
Join SecretStringOpaque secret delivered to joining users
Spectate SecretStringLegacy compatibility field; ignored with a warning
Match SecretStringLegacy compatibility field; ignored with a warning
Button 1 LabelStringFirst activity button label
Button 1 UrlStringFirst activity button URL
Button 2 LabelStringSecond activity button label
Button 2 UrlStringSecond activity button URL
Is InstanceBooleanLegacy compatibility field; ignored
Activity TypeEDiscordPresenceActivityTypePlaying, Streaming, Listening, or Watching

Both the label and URL are required for each activity button.

FDiscordPresenceUser

Supplied by On Discord Join Request Received.

FieldTypeNotes
User IdStringPopulated from the Social SDK invite
UsernameStringMay be empty in the current wrapper
DiscriminatorStringMay be empty in the current wrapper
AvatarStringMay be empty in the current wrapper
Is BotBooleanDefaults to false; may not be populated

EDiscordPresenceResult

ValueMeaning
SuccessThe synchronous operation succeeded locally or the asynchronous request was submitted
Not InitializedThe operation requires an initialized SDK client
Invalid Client IDApplication ID is empty, non-numeric, zero, or out of range
Discord Not RunningDiscord was not detected or an SDK operation reported it unavailable
SDK Load FailedThe runtime SDK library could not be found or loaded
SDK Call FailedDiscord rejected or failed an SDK operation
Unsupported PlatformCompatible SDK binaries were not linked for the target
Unknown ErrorThe failure did not map to a more specific result

EDiscordPresenceActivityType

ValuePurpose
PlayingStandard game activity and recommended default
StreamingStreaming activity type
ListeningListening activity type
WatchingWatching activity type

EDiscordPresenceJoinResponse

ValueBehavior
YesSends a positive join-request reply through the Social SDK
NoRemoves the pending request locally
IgnoreRemoves the pending request locally

Recommended Blueprint Pattern

Local Player Controller: Event BeginPlay
  -> Is Local Controller
  -> Branch (True)
  -> Get Game Instance Subsystem
       Class = Discord Presence Subsystem
  -> Is Valid
  -> Bind On Discord Activity Updated
  -> Bind On Discord Error
  -> Initialize Discord Presence(ApplicationId)
  -> Branch: Return Value == Success
       True:
         -> Set Simple Presence("In Main Menu", "Preparing a run")

Do not update Rich Presence every frame. Publish only when meaningful game state changes.