Difference between revisions of "Manual:Discord Functions"

From Mudlet
Jump to navigation Jump to search
(Started on API documentation for Discord)
 
m (→‎getDiscordState: add missing headlines)
Line 84: Line 84:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 +
==getDiscordState==
 
;getDiscordState()
 
;getDiscordState()
 
: Returns the text used for the Discord Rich Presence state field. See [https://discordapp.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields Discord docs] for a handy image reference on where the state is shown.
 
: Returns the text used for the Discord Rich Presence state field. See [https://discordapp.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields Discord docs] for a handy image reference on where the state is shown.
Line 97: Line 98:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 +
==setDiscordElapsedStartTime==
 
;setDiscordElapsedStartTime()
 
;setDiscordElapsedStartTime()
 
: Sets the time to be shown for "## elapsed" firled in Discord Rich Presence. See [https://discordapp.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields Discord docs] for a handy image reference on where the elapsed time is shown.
 
: Sets the time to be shown for "## elapsed" firled in Discord Rich Presence. See [https://discordapp.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields Discord docs] for a handy image reference on where the elapsed time is shown.

Revision as of 21:03, 23 September 2018

getDiscordDetail

getDiscordDetail()
Returns the text used for the Discord Rich Presence detail field. See Discord docs for a handy image reference on where the detail is shown.

See also: setDiscordDetail

Note Note: Available since Mudlet 3.14

Example
print("Discord detail is: ".. getDiscordDetail())

getDiscordLargeIcon

getDiscordLargeIcon()
Returns the large icon name used for the Discord Rich Presence. See Discord docs for a handy image reference on where the large icon is shown.

See also: setDiscordLargeIcon

Note Note: Available since Mudlet 3.14

Example
print("Discord large icon is: ".. getDiscordLargeIcon())

getDiscordLargeIconText

getDiscordLargeIconText()
Returns the text used as a tooltip for the large icon in the Discord Rich Presence. See Discord docs for a handy image reference on where the large icon is shown.

See also: setDiscordLargeIconText

Note Note: Available since Mudlet 3.14

Example
print("Discord large icon tooltip is: ".. setDiscordLargeIconText())

getDiscordParty

getDiscordParty()
Returns the current and max party values used in the Discord Rich Presence. See Discord docs for a handy image reference on where the the party info is shown.

See also: setDiscordParty

Note Note: Available since Mudlet 3.14

Example
local currentsize, maxsize = getDiscordParty()
print(string.format("Discord party: %d out of %d", currentsize, maxsize))

getDiscordSmallIcon

getDiscordSmallIcon()
Returns the small icon name used for the Discord Rich Presence. See Discord docs for a handy image reference on where the small icon is shown.

See also: setDiscordSmallIcon

Note Note: Available since Mudlet 3.14

Example
print("Discord small icon is: ".. getDiscordSmallIcon())

getDiscordSmallIconText

getDiscordSmallIconText()
Returns the text used as a tooltip for the small icon in the Discord Rich Presence. See Discord docs for a handy image reference on where the small icon is shown.

See also: setDiscordSmallIconText

Note Note: Available since Mudlet 3.14

Example
print("Discord small icon tooltip is: ".. setDiscordSmallIconText())

getDiscordState

getDiscordState()
Returns the text used for the Discord Rich Presence state field. See Discord docs for a handy image reference on where the state is shown.

See also: setDiscordState

Note Note: Available since Mudlet 3.14

Example
print("Discord state is: ".. getDiscordState())

setDiscordElapsedStartTime

setDiscordElapsedStartTime()
Sets the time to be shown for "## elapsed" firled in Discord Rich Presence. See Discord docs for a handy image reference on where the elapsed time is shown.

Note Note: Available since Mudlet 3.14

Example
-- set the timer to start counting up from now:
setDiscordElapsedStartTime(os.time(os.date("*t")))