Difference between revisions of "Manual:Discord Functions/ru"
(Updating translation from gettext import) |
(Updating translation from gettext import) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
[[#setdiscorddetail|setDiscordDetail]] | [[#setdiscorddetail|setDiscordDetail]] | ||
− | {{note}} Доступно с | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
print("Discord detail is: ".. getDiscordDetail()) | print("Discord detail is: ".. getDiscordDetail()) | ||
Line 30: | Line 30: | ||
[[#setdiscordlargeicon|setDiscordLargeIcon]] | [[#setdiscordlargeicon|setDiscordLargeIcon]] | ||
− | {{note}} Доступно с | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
print("Discord large icon is: ".. getDiscordLargeIcon()) | print("Discord large icon is: ".. getDiscordLargeIcon()) | ||
Line 47: | Line 47: | ||
[[#setdiscordlargeicontext|setDiscordLargeIconText]] | [[#setdiscordlargeicontext|setDiscordLargeIconText]] | ||
− | {{note}} Доступно с | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
print("Discord large icon tooltip is: ".. setDiscordLargeIconText()) | print("Discord large icon tooltip is: ".. setDiscordLargeIconText()) | ||
Line 61: | Line 61: | ||
: Returns the current and max party values used in the 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 the party info is shown. | : Returns the current and max party values used in the 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 the party info is shown. | ||
− | + | Смотрите также: | |
[[#setdiscordparty|setDiscordParty]] | [[#setdiscordparty|setDiscordParty]] | ||
− | {{note}} Доступно с | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
local currentsize, maxsize = getDiscordParty() | local currentsize, maxsize = getDiscordParty() | ||
Line 80: | Line 80: | ||
: Returns the small icon name used for the 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 small icon is shown. | : Returns the small icon name used for the 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 small icon is shown. | ||
− | + | Смотрите также: | |
[[#setdiscordsmallicon|setDiscordSmallIcon]] | [[#setdiscordsmallicon|setDiscordSmallIcon]] | ||
− | {{note}} Доступно с | + | {{note}} Доступно с Mudlet 3.14. |
;Пример | ;Пример | ||
Line 99: | Line 99: | ||
[[#setdiscordsmallicontext|setDiscordSmallIconText]] | [[#setdiscordsmallicontext|setDiscordSmallIconText]] | ||
− | {{note}} Доступно с | + | {{note}} Доступно с Mudlet 3.14. |
;Пример | ;Пример | ||
Line 113: | Line 113: | ||
: 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. | ||
− | + | Смотрите также: | |
[[#setdiscordstate|setDiscordState]] | [[#setdiscordstate|setDiscordState]] | ||
− | {{note}} | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
print("Discord state is: ".. getDiscordState()) | print("Discord state is: ".. getDiscordState()) | ||
Line 139: | Line 139: | ||
[[File:Mudlet Discord ApplicationID.png|thumb|right]] | [[File:Mudlet Discord ApplicationID.png|thumb|right]] | ||
− | + | Смотрите также: | |
[[#setdiscordgame|setDiscordGame]], [[#usingmudletsdiscordid|usingMudletsDiscordID]] | [[#setdiscordgame|setDiscordGame]], [[#usingmudletsdiscordid|usingMudletsDiscordID]] | ||
− | {{note}} | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- set the ID to Mudlets own as an example | -- set the ID to Mudlets own as an example | ||
Line 162: | Line 162: | ||
: Sets the text to be shown in the detail field of 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 detail is shown. Note that this will overwrite the same information set by [[#setdiscordgame|setDiscordGame()]]. | : Sets the text to be shown in the detail field of 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 detail is shown. Note that this will overwrite the same information set by [[#setdiscordgame|setDiscordGame()]]. | ||
− | + | Смотрите также: | |
[[#getdiscorddetail|getDiscordDetail]], [[#setdiscordgame|setDiscordGame]] | [[#getdiscorddetail|getDiscordDetail]], [[#setdiscordgame|setDiscordGame]] | ||
{{note}} To ensure privacy, the detail will only be shown if the Lua API is enabled and the detail is not hidden. | {{note}} To ensure privacy, the detail will only be shown if the Lua API is enabled and the detail is not hidden. | ||
− | {{note}} | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- set detail to your character name in-game, as an example | -- set detail to your character name in-game, as an example | ||
Line 185: | Line 185: | ||
* ''time:'' (required) time as a [https://en.wikipedia.org/wiki/Unix_time Unix time]. To get the current Unix time in Lua, use <code>os.time(os.date("*t"))</code>. | * ''time:'' (required) time as a [https://en.wikipedia.org/wiki/Unix_time Unix time]. To get the current Unix time in Lua, use <code>os.time(os.date("*t"))</code>. | ||
− | + | Смотрите также: | |
[[#setdiscordremainingendtime|setDiscordRemainingEndTime]] | [[#setdiscordremainingendtime|setDiscordRemainingEndTime]] | ||
{{note}} To ensure privacy, the time will only be shown if the Lua API is enabled and the time is not hidden. | {{note}} To ensure privacy, the time will only be shown if the Lua API is enabled and the time is not hidden. | ||
− | {{note}} | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- set the timer to start counting up from now: | -- set the timer to start counting up from now: | ||
Line 207: | Line 207: | ||
Currently supported games are: Achaea, Aetolia, Imperian, Luminari, Lusternia, MidMUD, Starmourn, WoTMUD. To add a new game to the list, [https://www.mudlet.org/contact/ get in touch]. | Currently supported games are: Achaea, Aetolia, Imperian, Luminari, Lusternia, MidMUD, Starmourn, WoTMUD. To add a new game to the list, [https://www.mudlet.org/contact/ get in touch]. | ||
− | + | Смотрите также: | |
[[#setdiscordapplicationid|setDiscordApplicationID]] | [[#setdiscordapplicationid|setDiscordApplicationID]] | ||
{{note}} To ensure privacy, the game and icon will only be shown if the Lua API is enabled, and detail and large icon are set to show. | {{note}} To ensure privacy, the game and icon will only be shown if the Lua API is enabled, and detail and large icon are set to show. | ||
− | {{note}} | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
setDiscordGame("WoTMUD") | setDiscordGame("WoTMUD") | ||
Line 230: | Line 230: | ||
If you're a game author, you can register your own game with Discord and upload your own icons instead of using the ones registered by Mudlet, see [[#setdiscordapplicationid|setDiscordApplicationID()]]. | If you're a game author, you can register your own game with Discord and upload your own icons instead of using the ones registered by Mudlet, see [[#setdiscordapplicationid|setDiscordApplicationID()]]. | ||
− | + | Смотрите также: | |
[[#getdiscordlargeicon|getDiscordLargeIcon]], [[#setdiscordlargeicontext|setDiscordLargeIconText]], [[#setdiscordapplicationid|setDiscordApplicationID]] | [[#getdiscordlargeicon|getDiscordLargeIcon]], [[#setdiscordlargeicontext|setDiscordLargeIconText]], [[#setdiscordapplicationid|setDiscordApplicationID]] | ||
{{note}} To ensure privacy, the icon will only be shown if the Lua API is enabled and the large icon is not hidden. | {{note}} To ensure privacy, the icon will only be shown if the Lua API is enabled and the large icon is not hidden. | ||
− | {{note}} | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
setDiscordLargeIcon("coin") | setDiscordLargeIcon("coin") | ||
Line 251: | Line 251: | ||
: Sets the tooltip for the large icon in the 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 the large icon is shown. | : Sets the tooltip for the large icon in the 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 the large icon is shown. | ||
− | + | Смотрите также: | |
[[#setdiscordlargeicon|setDiscordLargeIcon]] | [[#setdiscordlargeicon|setDiscordLargeIcon]] | ||
{{note}} To ensure privacy, the tooltip will only be shown if the Lua API is enabled, and large icon with the large icon tooltip is set to show. | {{note}} To ensure privacy, the tooltip will only be shown if the Lua API is enabled, and large icon with the large icon tooltip is set to show. | ||
− | {{note}} | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
setDiscordLargeIcon("axe") | setDiscordLargeIcon("axe") | ||
Line 275: | Line 275: | ||
* ''max:'' (optional) max party amount - if not provided, then the max is set to the current amount. | * ''max:'' (optional) max party amount - if not provided, then the max is set to the current amount. | ||
− | + | Смотрите также: | |
[[#getdiscordparty|getDiscordParty]] | [[#getdiscordparty|getDiscordParty]] | ||
{{note}} To ensure privacy, the party will only be shown if the Lua API is enabled and the party information is not hidden. | {{note}} To ensure privacy, the party will only be shown if the Lua API is enabled and the party information is not hidden. | ||
− | {{note}} | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- show that 5 out of 10 people are in currently in the party | -- show that 5 out of 10 people are in currently in the party | ||
Line 298: | Line 298: | ||
* ''time:'' (required) time as a [https://en.wikipedia.org/wiki/Unix_time Unix time]. To get the current Unix time in Lua, use <code>os.time(os.date("*t"))</code>. | * ''time:'' (required) time as a [https://en.wikipedia.org/wiki/Unix_time Unix time]. To get the current Unix time in Lua, use <code>os.time(os.date("*t"))</code>. | ||
− | + | Смотрите также: | |
[[#setdiscordelapsedstarttime|setDiscordElapsedStartTime]] | [[#setdiscordelapsedstarttime|setDiscordElapsedStartTime]] | ||
{{note}} To ensure privacy, the time will only be shown if the Lua API is enabled and the time is not hidden. | {{note}} To ensure privacy, the time will only be shown if the Lua API is enabled and the time is not hidden. | ||
− | {{note}} | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- set the timer to start counting down from an hour from now | -- set the timer to start counting down from an hour from now | ||
Line 322: | Line 322: | ||
If you're a game author, you can register your own game with Discord and upload your own icons instead of using the ones registered by Mudlet, see [[#setdiscordapplicationid|setDiscordApplicationID()]]. | If you're a game author, you can register your own game with Discord and upload your own icons instead of using the ones registered by Mudlet, see [[#setdiscordapplicationid|setDiscordApplicationID()]]. | ||
− | + | Смотрите также: | |
[[#getdiscordsmallicon|getDiscordSmallIcon]], [[#setdiscordsmallicontext|setDiscordSmallIconText]], [[#setdiscordapplicationid|setDiscordApplicationID]] | [[#getdiscordsmallicon|getDiscordSmallIcon]], [[#setdiscordsmallicontext|setDiscordSmallIconText]], [[#setdiscordapplicationid|setDiscordApplicationID]] | ||
{{note}} To ensure privacy, the icon will only be shown if the Lua API is enabled and the small icon is not hidden. | {{note}} To ensure privacy, the icon will only be shown if the Lua API is enabled and the small icon is not hidden. | ||
− | {{note}} | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
setDiscordSmallIcon("envelope") | setDiscordSmallIcon("envelope") | ||
Line 343: | Line 343: | ||
: Sets the tooltip for the small icon in the 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 the small icon is shown. | : Sets the tooltip for the small icon in the 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 the small icon is shown. | ||
− | + | Смотрите также: | |
[[#setdiscordsmallicon|setDiscordSmallIcon]] | [[#setdiscordsmallicon|setDiscordSmallIcon]] | ||
{{note}} To ensure privacy, the tooltip will only be shown if the Lua API is enabled, and small icon with the small icon tooltip is set to show. | {{note}} To ensure privacy, the tooltip will only be shown if the Lua API is enabled, and small icon with the small icon tooltip is set to show. | ||
− | {{note}} | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
setDiscordSmallIcon("map") | setDiscordSmallIcon("map") | ||
Line 363: | Line 363: | ||
: Sets the text to be shown in the state field of 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 state is shown. | : Sets the text to be shown in the state field of 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 state is shown. | ||
− | + | Смотрите также: | |
[[#getdiscordstate|getDiscordState]], [[#setdiscorddetail|setDiscordDetail]] | [[#getdiscordstate|getDiscordState]], [[#setdiscorddetail|setDiscordDetail]] | ||
{{note}} To ensure privacy, the state will only be shown if the Lua API is enabled and the state is not hidden. | {{note}} To ensure privacy, the state will only be shown if the Lua API is enabled and the state is not hidden. | ||
− | {{note}} | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- set state to your current area | -- set state to your current area | ||
Line 385: | Line 385: | ||
: Returns true if the currently playing game is set to "Mudlet". You can change this with [[#setdiscordapplicationid|setDiscordApplicationID()]]. | : Returns true if the currently playing game is set to "Mudlet". You can change this with [[#setdiscordapplicationid|setDiscordApplicationID()]]. | ||
− | + | Смотрите также: | |
[[#setdiscordapplicationid|setDiscordApplicationID]] | [[#setdiscordapplicationid|setDiscordApplicationID]] | ||
− | {{note}} | + | {{note}} Доступно с Mudlet 3.14. |
− | ; | + | ;Пример |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
if usingMudletsDiscordID() then | if usingMudletsDiscordID() then |
Latest revision as of 01:10, 2 December 2020
For an overview on how all of these functions tie in together, see our Discord scripting overview.
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.
Смотрите также: setDiscordDetail
Note: Доступно с Mudlet 3.14.
- Пример
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.
Смотрите также: setDiscordLargeIcon
Note: Доступно с Mudlet 3.14.
- Пример
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.
Смотрите также: setDiscordLargeIconText
Note: Доступно с Mudlet 3.14.
- Пример
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.
Смотрите также: setDiscordParty
Note: Доступно с Mudlet 3.14.
- Пример
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.
Смотрите также: setDiscordSmallIcon
Note: Доступно с Mudlet 3.14.
- Пример
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.
Смотрите также: setDiscordSmallIconText
Note: Доступно с Mudlet 3.14.
- Пример
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.
Смотрите также: setDiscordState
Note: Доступно с Mudlet 3.14.
- Пример
print("Discord state is: ".. getDiscordState())
setDiscordApplicationID
- setDiscordApplicationID(id)
- Set a custom Discord ID so Discord Rich Presence will show "Playing <your game>" instead of "Playing Mudlet". This function is intended for game authors. Note that you can also set it automatically over GMCP, no pre-installation of scripts required. The Discord privacy option "Enable Lua API" must be enabled for this to work. Returns true if the Discord application ID is in the correct format.
If you're a game author, you can register your game over at Discord to obtain the "client ID" to be used for this function. Once you do so, make sure to upload the games icon as an art asset under the name of server-icon
.
Mudlet calls the client ID an application ID to avoid confusion with the Mudlet internal Discord client ID.
- Parameters
- id: (required) id as a string.
Смотрите также: setDiscordGame, usingMudletsDiscordID
Note: Доступно с Mudlet 3.14.
- Пример
-- set the ID to Mudlets own as an example
setDiscordApplicationID("450571881909583884")
Note: So you do not have to remember that long number you can also reset to the default Mudlet ID by calling this function without an argument:
setDiscordApplicationID()
setDiscordDetail
- setDiscordDetail()
- Sets the text to be shown in the detail field of Discord Rich Presence. See Discord docs for a handy image reference on where the detail is shown. Note that this will overwrite the same information set by setDiscordGame().
Смотрите также: getDiscordDetail, setDiscordGame
Note: To ensure privacy, the detail will only be shown if the Lua API is enabled and the detail is not hidden.
Note: Доступно с Mudlet 3.14.
- Пример
-- set detail to your character name in-game, as an example
setDiscordDetail("Vadi")
setDiscordElapsedStartTime
- setDiscordElapsedStartTime(time)
- Sets the time to be shown for "## elapsed" field in Discord Rich Presence. See Discord docs for a handy image reference on where the elapsed time is shown.
- Parameters
- time: (required) time as a Unix time. To get the current Unix time in Lua, use
os.time(os.date("*t"))
.
Смотрите также: setDiscordRemainingEndTime
Note: To ensure privacy, the time will only be shown if the Lua API is enabled and the time is not hidden.
Note: Доступно с Mudlet 3.14.
- Пример
-- set the timer to start counting up from now:
setDiscordElapsedStartTime(os.time(os.date("*t")))
setDiscordGame
- setDiscordGame()
- Sets the given game to be shown in the "detail" field and the game's icon as the large icon in Discord Rich Presence. See Discord docs for a handy image reference on where the detail and large icon is shown. This is an alternative way of showing which game you're playing - a better way, if you're the game author, is to use GMCP (no pre-installation of scripts required) or setDiscordApplicationID().
Currently supported games are: Achaea, Aetolia, Imperian, Luminari, Lusternia, MidMUD, Starmourn, WoTMUD. To add a new game to the list, get in touch.
Смотрите также: setDiscordApplicationID
Note: To ensure privacy, the game and icon will only be shown if the Lua API is enabled, and detail and large icon are set to show.
Note: Доступно с Mudlet 3.14.
- Пример
setDiscordGame("WoTMUD")
setDiscordLargeIcon
- setDiscordLargeIcon()
- Sets the large icon to be shown in Discord Rich Presence. See Discord docs for a handy image reference the icon is shown.
Icons supported by default in Mudlet: armor, axe, backpack, bow, coin, dagger, envelope, gem-blue, gem-green, gem-red, hammer, heart, helmet, map, shield, tome, tools, wand, wood-sword (icons credit). To add a new icon to the list, get in touch (the Discord limit is 150 icons).
If you're a game author, you can register your own game with Discord and upload your own icons instead of using the ones registered by Mudlet, see setDiscordApplicationID().
Смотрите также: getDiscordLargeIcon, setDiscordLargeIconText, setDiscordApplicationID
Note: To ensure privacy, the icon will only be shown if the Lua API is enabled and the large icon is not hidden.
Note: Доступно с Mudlet 3.14.
- Пример
setDiscordLargeIcon("coin")
setDiscordLargeIconText("Fishing")
setDiscordState("Fishing")
setDiscordLargeIconText
- setDiscordLargeIconText()
- Sets the tooltip for the large icon in the Discord Rich Presence. See Discord docs for a handy image reference the large icon is shown.
Смотрите также: setDiscordLargeIcon
Note: To ensure privacy, the tooltip will only be shown if the Lua API is enabled, and large icon with the large icon tooltip is set to show.
Note: Доступно с Mudlet 3.14.
- Пример
setDiscordLargeIcon("axe")
setDiscordLargeIconText("Killing heterics")
setDiscordParty
- setDiscordParty(current, max)
- Sets the party information the Discord Rich Presence. See Discord docs for a handy image reference the party is shown.
- Parameters
- current: (required) current party amount.
- max: (optional) max party amount - if not provided, then the max is set to the current amount.
Смотрите также: getDiscordParty
Note: To ensure privacy, the party will only be shown if the Lua API is enabled and the party information is not hidden.
Note: Доступно с Mudlet 3.14.
- Пример
-- show that 5 out of 10 people are in currently in the party
setDiscordParty(5, 10)
setDiscordRemainingEndTime
- setDiscordRemainingEndTime(time)
- Sets the time to be shown for "## remaining" field in Discord Rich Presence. See Discord docs for a handy image reference on where the remaining time is shown.
- Parameters
- time: (required) time as a Unix time. To get the current Unix time in Lua, use
os.time(os.date("*t"))
.
Смотрите также: setDiscordElapsedStartTime
Note: To ensure privacy, the time will only be shown if the Lua API is enabled and the time is not hidden.
Note: Доступно с Mudlet 3.14.
- Пример
-- set the timer to start counting down from an hour from now
setDiscordRemainingEndTime(os.time(os.date("*t"))+(60 * 60))
setDiscordSmallIcon
- setDiscordSmallIcon()
- Sets the small icon to be shown in Discord Rich Presence. See Discord docs for a handy image reference the icon is shown.
Icons supported by default in Mudlet: armor, axe, backpack, bow, coin, dagger, envelope, gem-blue, gem-green, gem-red, hammer, heart, helmet, map, shield, tome, tools, wand, wood-sword (icons credit). To add a new icon to the list, get in touch (the Discord limit is 150 icons).
If you're a game author, you can register your own game with Discord and upload your own icons instead of using the ones registered by Mudlet, see setDiscordApplicationID().
Смотрите также: getDiscordSmallIcon, setDiscordSmallIconText, setDiscordApplicationID
Note: To ensure privacy, the icon will only be shown if the Lua API is enabled and the small icon is not hidden.
Note: Доступно с Mudlet 3.14.
- Пример
setDiscordSmallIcon("envelope")
setDiscordSmallIconText("Writing letters")
setDiscordState("Writing letters")
setDiscordSmallIconText
- setDiscordSmallIconText()
- Sets the tooltip for the small icon in the Discord Rich Presence. See Discord docs for a handy image reference the small icon is shown.
Смотрите также: setDiscordSmallIcon
Note: To ensure privacy, the tooltip will only be shown if the Lua API is enabled, and small icon with the small icon tooltip is set to show.
Note: Доступно с Mudlet 3.14.
- Пример
setDiscordSmallIcon("map")
setDiscordSmallIconText("Exploring")
setDiscordState
- setDiscordState(state)
- Sets the text to be shown in the state field of Discord Rich Presence. See Discord docs for a handy image reference on where the state is shown.
Смотрите также: getDiscordState, setDiscordDetail
Note: To ensure privacy, the state will only be shown if the Lua API is enabled and the state is not hidden.
Note: Доступно с Mudlet 3.14.
- Пример
-- set state to your current area
local currentarea = getRoomArea(getPlayerRoom())
local areaname = getAreaTableSwap()[currentarea]
setDiscordDetail(areaname)
usingMudletsDiscordID
- usingMudletsDiscordID()
- Returns true if the currently playing game is set to "Mudlet". You can change this with setDiscordApplicationID().
Смотрите также: setDiscordApplicationID
Note: Доступно с Mudlet 3.14.
- Пример
if usingMudletsDiscordID() then
print('It is showing "Playing Mudlet" right now!')
end