mirror of
https://github.com/danbulant/discord.js
synced 2026-07-08 04:31:05 +00:00
Added setPlaying to docs
This commit is contained in:
parent
46846fcacc
commit
32a9321cfd
3 changed files with 26 additions and 2 deletions
|
|
@ -402,9 +402,22 @@ Gets a PMChannel_ that matches the specified criteria. E.g:
|
||||||
setPlayingGame(id)
|
setPlayingGame(id)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Aliases** : `playGame`, `playingGame`
|
||||||
|
|
||||||
Sets the client as playing the specified game name/id.
|
Sets the client as playing the specified game name/id.
|
||||||
|
|
||||||
- **id** - Either a `Number` or a `String`. If it's a Number, it's assumed that you are using the Discord Game ID
|
- **id** - Either a `Number` or a `String`. If it's a Number, it's assumed that you are using a `Discord Game ID`_ and know what you want. If you supply a `String`, it will assume you are entering a game name and try resolving it to a Discord Game ID if it's available. Example:
|
||||||
|
|
||||||
|
.. code-block:: js
|
||||||
|
|
||||||
|
client.setPlayingGame(18);
|
||||||
|
// sets the client as playing Minecraft, game ID 18
|
||||||
|
|
||||||
|
client.setPlayingGame("Minecraft");
|
||||||
|
// sets the client as playing Minecraft by resolving the ID to 18
|
||||||
|
|
||||||
|
client.setPlayingGame("my magical made up game")
|
||||||
|
// will stop the client from playing anything as it is unresolved, not a valid game.
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|
@ -593,3 +606,5 @@ Called when a WebSocket message is received and it gives you the message.
|
||||||
- **data** - A `JSON Object` which is the message received over WebSocket.
|
- **data** - A `JSON Object` which is the message received over WebSocket.
|
||||||
|
|
||||||
.. _official API here : https://discordapp.com/api/voice/regions
|
.. _official API here : https://discordapp.com/api/voice/regions
|
||||||
|
|
||||||
|
.. _Discord Game ID : https://raw.githubusercontent.com/hydrabolt/discord.js/master/ref/gameMap.json
|
||||||
|
|
@ -1844,6 +1844,11 @@ var Client = (function () {
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
key: "playGame",
|
||||||
|
value: function playGame(id) {
|
||||||
|
this.setPlayingGame(id);
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "playingGame",
|
key: "playingGame",
|
||||||
value: function playingGame(id) {
|
value: function playingGame(id) {
|
||||||
|
|
|
||||||
|
|
@ -1571,6 +1571,10 @@ class Client {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
playGame(id){
|
||||||
|
this.setPlayingGame(id);
|
||||||
|
}
|
||||||
|
|
||||||
playingGame(id){
|
playingGame(id){
|
||||||
|
|
||||||
this.setPlayingGame(id);
|
this.setPlayingGame(id);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue