-
Notifications
You must be signed in to change notification settings - Fork 1
Core
Discord SDK: Discord
This module offers a collection of functions designed to address specific tasks and provide utilities for various purposes. Explore the available functions to make the most of the functionalities provided by this module.
This module includes a set of predefined constants that can be utilized for various purposes. Browse through the available constants to find values relevant to your needs and enhance the efficiency of your code.
Discord Function: Create
This function initialises the Discord extension and returns whether this was successful.
The creationFlag
parameter determines if the Discord extension requires or doesn't require Discord to be running. If the optional creationFlag
is set to Discord_CreateFlags_Default
(the default value) and Discord is not running, it will:
- Close your game
- Open Discord
- Attempt to re-open your game
Syntax:
Discord_Core_Create(appId, creationFlag=Discord_CreateFlags_Default)
Argument | Type | Description |
---|---|---|
appId | Int64 | Application identifier |
creationFlag | Discord_CreateFlags |
Discord_CreateFlags_Default or Discord_CreateFlags_NoRequireDiscord
|
Returns:
Example:
if(!Discord_Core_Create(_applicationId, Discord_CreateFlags_Default))
{
show_message_async("Discord Initialisation Error");
exit;
}
Discord Function: RunCallbacks
This function requests the extension instances to do work.
Warning
It is imperative that this function is called at regular intervals to ensure that all the services offered by the SDK function optimally.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
Discord_Core_RunCallbacks()
Returns:
N/A
Triggers:
This async event is triggered whenever the user struct of the currently connected user changes. They may have changed their avatar, username, or something else.
Key | Type | Description |
---|---|---|
result | Real | Result code of the async request |
type | String | The string "Discord_Users_OnCurrentUserUpdate"
|
Example:
/// Step Event
Discord_Core_RunCallbacks();
Discord Enum: Result Enum
Member | Description |
---|---|
Discord_OK |
0 A constant that indicates that the result is OK |
Discord Enum: CreateFlags Enum
These constants are referenced by the following functions:
Member | Description |
---|---|
Discord_CreateFlags_Default |
0 Requires Discord to be running to play the game |
Discord_CreateFlags_NoRequireDiscord |
1 Does not require Discord to be running, use this on other platforms |
YoYoGames 2024