mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
refactor: make use of destructuring for Constants (#1942)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const PresenceStore = require('./PresenceStore');
|
||||
const Collection = require('../util/Collection');
|
||||
const Constants = require('../util/Constants');
|
||||
const { ActivityTypes, OPCodes } = require('../util/Constants');
|
||||
const { Presence } = require('../structures/Presence');
|
||||
const { TypeError } = require('../errors');
|
||||
|
||||
@@ -34,7 +34,7 @@ class ClientPresenceStore extends PresenceStore {
|
||||
since: since != null ? since : null, // eslint-disable-line eqeqeq
|
||||
status: status || this.clientPresence.status,
|
||||
game: activity ? {
|
||||
type: typeof activity.type === 'number' ? activity.type : Constants.ActivityTypes.indexOf(activity.type),
|
||||
type: typeof activity.type === 'number' ? activity.type : ActivityTypes.indexOf(activity.type),
|
||||
name: activity.name,
|
||||
url: activity.url,
|
||||
details: activity.details || undefined,
|
||||
@@ -54,7 +54,7 @@ class ClientPresenceStore extends PresenceStore {
|
||||
};
|
||||
|
||||
this.clientPresence.patch(packet);
|
||||
this.client.ws.send({ op: Constants.OPCodes.STATUS_UPDATE, d: packet });
|
||||
this.client.ws.send({ op: OPCodes.STATUS_UPDATE, d: packet });
|
||||
return this.clientPresence;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user