mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 02:53:31 +01:00
Add support for new game types (#1777)
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
const Constants = require('../util/Constants');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a user's presence.
|
* Represents a user's presence.
|
||||||
*/
|
*/
|
||||||
@@ -53,9 +55,9 @@ class Game {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The type of the game status
|
* The type of the game status
|
||||||
* @type {number}
|
* @type {GameType}
|
||||||
*/
|
*/
|
||||||
this.type = data.type;
|
this.type = Constants.GameTypes[data.type];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the game is being streamed, a link to the stream
|
* If the game is being streamed, a link to the stream
|
||||||
@@ -70,7 +72,7 @@ class Game {
|
|||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get streaming() {
|
get streaming() {
|
||||||
return this.type === 1;
|
return this.type === Constants.GameTypes[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -349,6 +349,21 @@ exports.MessageTypes = [
|
|||||||
'GUILD_MEMBER_JOIN',
|
'GUILD_MEMBER_JOIN',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type of a game of a users presence, e.g. `PLAYING`. Here are the available types:
|
||||||
|
* - PLAYING
|
||||||
|
* - STREAMING
|
||||||
|
* - LISTENING
|
||||||
|
* - WATCHING
|
||||||
|
* @typedef {string} GameType
|
||||||
|
*/
|
||||||
|
exports.GameTypes = [
|
||||||
|
'PLAYING',
|
||||||
|
'STREAMING',
|
||||||
|
'LISTENING',
|
||||||
|
'WATCHING',
|
||||||
|
];
|
||||||
|
|
||||||
exports.ExplicitContentFilterTypes = [
|
exports.ExplicitContentFilterTypes = [
|
||||||
'DISABLED',
|
'DISABLED',
|
||||||
'NON_FRIENDS',
|
'NON_FRIENDS',
|
||||||
|
|||||||
Reference in New Issue
Block a user