Skip to main content

DiscordClient

Kindclass
Packagebackend
Full namebackend.DiscordClient
Sourcesource/backend/DiscordClient.hx

Public fields​

NameTypeStaticDefaultNotes
isInitializedBoolyesfalse—
clientIDStringyes_defaultIDproperty (default, set)

Public methods​

check​

static function check()

Only compiled when #if DISCORD_ALLOWED && !android.

View source

prepare​

static function prepare()

Only compiled when #if DISCORD_ALLOWED && !android.

View source

shutdown​

static function shutdown()

Only compiled when #if DISCORD_ALLOWED && !android.

View source

initialize​

static function initialize()

Only compiled when #if DISCORD_ALLOWED && !android.

View source

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.

ParameterTypeDefault
details (optional)String'In the Menus'
state (optional)String—
smallImageKey (optional)String—
hasStartTimestamp (optional)Bool—
endTimestamp (optional)Float—
largeImageKey (optional)String'icon'

View source

updatePresence​

static function updatePresence()

Only compiled when #if DISCORD_ALLOWED && !android.

View source

addLuaCallbacks​

static function addLuaCallbacks(lua:State)

Only compiled when #if DISCORD_ALLOWED && !android + #if LUA_ALLOWED.

ParameterTypeDefault
luaState—

View source

addPythonCallbacks​

static function addPythonCallbacks(python:psychlua.PythonScript)

Only compiled when #if DISCORD_ALLOWED && !android + #if PYTHON_ALLOWED.

ParameterTypeDefault
pythonpsychlua.PythonScript—

View source

check​

static function check()

Only compiled when #if DISCORD_ALLOWED && android.

View source

prepare​

static function prepare()

Only compiled when #if DISCORD_ALLOWED && android.

View source

shutdown​

static function shutdown()

Only compiled when #if DISCORD_ALLOWED && android.

View source

initialize​

static function initialize()

Only compiled when #if DISCORD_ALLOWED && android.

View source

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.

ParameterTypeDefault
details (optional)String'In the Menus'
state (optional)String—
smallImageKey (optional)String—
hasStartTimestamp (optional)Bool—
endTimestamp (optional)Float—
largeImageKey (optional)String'icon'

View source

updatePresence​

static function updatePresence():Void

Only compiled when #if DISCORD_ALLOWED && android.

View source

addLuaCallbacks​

static function addLuaCallbacks(lua:State)

Only compiled when #if DISCORD_ALLOWED && android + #if LUA_ALLOWED.

ParameterTypeDefault
luaState—

View source

addPythonCallbacks​

static function addPythonCallbacks(python:psychlua.PythonScript)

Only compiled when #if DISCORD_ALLOWED && android + #if PYTHON_ALLOWED.

ParameterTypeDefault
pythonpsychlua.PythonScript—

View source

check​

static function check():Void

Only compiled when #if !(DISCORD_ALLOWED && android).

No-op stub for builds compiled without Discord RPC (e.g. Neko).

View source

prepare​

static function prepare():Void

Only compiled when #if !(DISCORD_ALLOWED && android).

View source

shutdown​

static function shutdown():Void

Only compiled when #if !(DISCORD_ALLOWED && android).

View source

initialize​

static function initialize():Void

Only compiled when #if !(DISCORD_ALLOWED && android).

View source

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).

ParameterTypeDefault
details (optional)String'In the Menus'
state (optional)String—
smallImageKey (optional)String—
hasStartTimestamp (optional)Bool—
endTimestamp (optional)Float—
largeImageKey (optional)String'icon'

View source

updatePresence​

static function updatePresence():Void

Only compiled when #if !(DISCORD_ALLOWED && android).

View source

addPythonCallbacks​

static function addPythonCallbacks(python:psychlua.PythonScript)

Only compiled when #if !(DISCORD_ALLOWED && android) + #if PYTHON_ALLOWED.

ParameterTypeDefault
pythonpsychlua.PythonScript—

View source

addLuaCallbacks​

static function addLuaCallbacks(lua:State)

Only compiled when #if !(DISCORD_ALLOWED && android) + #if LUA_ALLOWED.

ParameterTypeDefault
luaState—

View source

resetClientID​

static inline function resetClientID()

View source

Internals​

Private / internal members
FieldTypeStatic
_defaultIDStringyes
presenceDiscordRichPresenceyes
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)