Discord

What client resources add to the player's Discord activity. KCDS already shows each stage from startup through the menu to a server, with its logo, a timer and a link to its website. While the player is on a server, a resource can set the server's name, shown as "KCDS - <name>", the status line, the logo and small image with tooltips, and one button. KCDS's website button is always second, and the activity's type, timestamps, party and secrets stay with KCDS. Setters only prepare a field, and update() and setPresence() publish. Resources on one machine share one activity.

discord.setName()

Discord.setName(value)

Prepares the server's name, up to 128 UTF-8 bytes. On the server, the line under KCDS reads "KCDS - <name>" rather than "Playing on <server>". The title stays KCDS. '' restores KCDS's line.

discord.setState()

Discord.setState(value)

Prepares the status line, up to 128 UTF-8 bytes. update() publishes it while the player is on a server.

discord.setLargeImage()

Discord.setLargeImage(value)

Prepares the logo, an https image link of up to 128 UTF-8 bytes, shown on the server in place of the KCDS logo. '' restores the KCDS logo.

discord.setLargeText()

Discord.setLargeText(value)

Prepares the logo's tooltip, up to 128 UTF-8 bytes, shown on the server in place of the KCDS version.

discord.setSmallImage()

Discord.setSmallImage(value)

Prepares the small image, up to 128 UTF-8 bytes. update() publishes it while the player is on a server.

discord.setSmallText()

Discord.setSmallText(value)

Prepares the small image's tooltip, up to 128 UTF-8 bytes. update() publishes it while the player is on a server.

discord.setAssets()

Discord.setAssets(assets)

Prepares the images and tooltips together.

discord.setButton()

Discord.setButton(label, url)

Prepares the server's button, with a label of 1 to 32 UTF-8 bytes and an https link. It comes first on the server, and KCDS's "KCDS website" button is always second and cannot be removed. ('', '') removes the server's button. Discord shows buttons to people viewing the player's profile.

discord.setPresence()

Discord.setPresence(options)

Prepares several fields and publishes them, as update() does.

discord.update()

Discord.update()

Publishes the prepared fields while the player is on a server.

discord.clear()

Discord.clear()

Removes resources' fields from the activity, leaving KCDS's presence.

discord.reset()

Discord.reset()

Forgets all prepared fields without publishing.

discord.getUserId()

Discord.getUserId()

The Discord user signed in to the player's app, or '' until Discord has answered.

discord.isAvailable()

Discord.isAvailable()

Whether the player's Discord app is running and connected.