DiscordClient
| Kind | class |
| Package | backend |
| Full name | backend.DiscordClient |
| Source | source/backend/DiscordClient.hx |
Public fields
| Name | Type | Static | Default | Notes |
|---|---|---|---|---|
isInitialized | Bool | yes | false | — |
clientID | String | yes | _defaultID | property (default, set) |
Public methods
check
static function check()
Only compiled when #if DISCORD_ALLOWED && !android.
prepare
static function prepare()
Only compiled when #if DISCORD_ALLOWED && !android.
shutdown
static function shutdown()
Only compiled when #if DISCORD_ALLOWED && !android.
initialize
static function initialize()
Only compiled when #if DISCORD_ALLOWED && !android.
changePresence
static function changePresence(details:String = 'In the Menus', ?state:String, ?smallImageKey:String, ?hasStartTimestamp:Bool, ?endTimestamp:Float, largeImageKey:String = 'icon')
Only compiled when #if DISCORD_ALLOWED && !android.
| Parameter | Type | Default |
|---|---|---|
details (optional) | String | 'In the Menus' |
state (optional) | String | — |
smallImageKey (optional) | String | — |
hasStartTimestamp (optional) | Bool | — |
endTimestamp (optional) | Float | — |
largeImageKey (optional) | String | 'icon' |
updatePresence
static function updatePresence()
Only compiled when #if DISCORD_ALLOWED && !android.
addLuaCallbacks
static function addLuaCallbacks(lua:State)
Only compiled when #if DISCORD_ALLOWED && !android + #if LUA_ALLOWED.
| Parameter | Type | Default |
|---|---|---|
lua | State | — |
addPythonCallbacks
static function addPythonCallbacks(python:psychlua.PythonScript)
Only compiled when #if DISCORD_ALLOWED && !android + #if PYTHON_ALLOWED.
| Parameter | Type | Default |
|---|---|---|
python | psychlua.PythonScript | — |
check
static function check()
Only compiled when #if DISCORD_ALLOWED && android.
prepare
static function prepare()
Only compiled when #if DISCORD_ALLOWED && android.
shutdown
static function shutdown()
Only compiled when #if DISCORD_ALLOWED && android.
initialize
static function initialize()
Only compiled when #if DISCORD_ALLOWED && android.
changePresence
static function changePresence(details:String = 'In the Menus', ?state:String, ?smallImageKey:String, ?hasStartTimestamp:Bool, ?endTimestamp:Float, largeImageKey:String = 'icon')
Only compiled when #if DISCORD_ALLOWED && android.
| Parameter | Type | Default |
|---|---|---|
details (optional) | String | 'In the Menus' |
state (optional) | String | — |
smallImageKey (optional) | String | — |
hasStartTimestamp (optional) | Bool | — |
endTimestamp (optional) | Float | — |
largeImageKey (optional) | String | 'icon' |
updatePresence
static function updatePresence():Void
Only compiled when #if DISCORD_ALLOWED && android.
addLuaCallbacks
static function addLuaCallbacks(lua:State)
Only compiled when #if DISCORD_ALLOWED && android + #if LUA_ALLOWED.
| Parameter | Type | Default |
|---|---|---|
lua | State | — |
addPythonCallbacks
static function addPythonCallbacks(python:psychlua.PythonScript)
Only compiled when #if DISCORD_ALLOWED && android + #if PYTHON_ALLOWED.
| Parameter | Type | Default |
|---|---|---|
python | psychlua.PythonScript | — |
check
static function check():Void
Only compiled when #if !(DISCORD_ALLOWED && android).
No-op stub for builds compiled without Discord RPC (e.g. Neko).
prepare
static function prepare():Void
Only compiled when #if !(DISCORD_ALLOWED && android).
shutdown
static function shutdown():Void
Only compiled when #if !(DISCORD_ALLOWED && android).
initialize
static function initialize():Void
Only compiled when #if !(DISCORD_ALLOWED && android).
changePresence
static function changePresence(details:String = 'In the Menus', ?state:String, ?smallImageKey:String, ?hasStartTimestamp:Bool, ?endTimestamp:Float, largeImageKey:String = 'icon'):Void
Only compiled when #if !(DISCORD_ALLOWED && android).
| Parameter | Type | Default |
|---|---|---|
details (optional) | String | 'In the Menus' |
state (optional) | String | — |
smallImageKey (optional) | String | — |
hasStartTimestamp (optional) | Bool | — |
endTimestamp (optional) | Float | — |
largeImageKey (optional) | String | 'icon' |
updatePresence
static function updatePresence():Void
Only compiled when #if !(DISCORD_ALLOWED && android).
addPythonCallbacks
static function addPythonCallbacks(python:psychlua.PythonScript)
Only compiled when #if !(DISCORD_ALLOWED && android) + #if PYTHON_ALLOWED.
| Parameter | Type | Default |
|---|---|---|
python | psychlua.PythonScript | — |
addLuaCallbacks
static function addLuaCallbacks(lua:State)
Only compiled when #if !(DISCORD_ALLOWED && android) + #if LUA_ALLOWED.
| Parameter | Type | Default |
|---|---|---|
lua | State | — |
resetClientID
static inline function resetClientID()
Internals
Private / internal members
| Field | Type | Static |
|---|---|---|
_defaultID | String | yes |
presence | DiscordRichPresence | yes |
| Method |
|---|
static function onReady(request:RawConstPointer<DiscordUser>):Void |
static function onError(errorCode:Int, message:ConstCharStar):Void |
static function onDisconnected(errorCode:Int, message:ConstCharStar):Void |
static function set_clientID(newID:String) |