-
Notifications
You must be signed in to change notification settings - Fork 0
GMRPC functions
Call this function before anything else discord related. This will allocate the callback handlers in the dll.
Returns: boolean value: Successful or not, plus:
Triggers a callback EVENT_OTHER_SOCIAL
, aka Asynchronous -> Social Event
The ds map
in social event is called async_load
and can be accessed like a "normal" dsmap
Key | Value |
---|---|
"event_type" | "GMRPC_READY" |
"user_id" | The User's ID |
"username" | The Username |
"discriminator" | The 4 Digit Number |
"avatar" | The hash of the User's avatar |
For example, to get the User's name: In Async Social Event:
show_debug_message(async_load[?"username"])
Call this function when you want to display "Playing since" on the profile. The time passed to this is seconds since epoch. In Gamemaker, you can use
var diff = date_second_span(date_create_datetime(1970,1,1,1,0,0), date_current_datetime());
show_debug_message(diff)
gmrpc_setStarttime(diff)
to get the seconds since epoch and now. Don't forget to call gmrpc_setPresence to actually set the presence.
Call this function when you want to display "Time left" on the profile. Time time passed is seconds since epoch.
This sets the overall presence.
parameter | description |
---|---|
State | is the state text displayed on the user's profile |
Details | are the details displayed on the user's profile |
largeImage | is the large image displayed on the user's profile |
smallImage | is the small image in the bottom right corner of the large image |
Resets the discord presence.
Exits the dll. You have to call init again after this. Current isssue: Please only call this on GAME END! Otherwise, it will break the dll.