mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
fix: made options.type optional in ClientUser#setActivity (#1875)
* fix: made options.type optional in ClientUser#setActivity * some changes, smol fix due to too many types being possible, it should just be defaulted to 0. this means streamers will have to set the type manually, though. also mistake with activity.name check
This commit is contained in:
@@ -2,6 +2,7 @@ const PresenceStore = require('./PresenceStore');
|
||||
const Collection = require('../util/Collection');
|
||||
const Constants = require('../util/Constants');
|
||||
const { Presence } = require('../structures/Presence');
|
||||
const { TypeError } = require('../errors');
|
||||
|
||||
class ClientPresenceStore extends PresenceStore {
|
||||
constructor(...args) {
|
||||
@@ -14,7 +15,9 @@ class ClientPresenceStore extends PresenceStore {
|
||||
});
|
||||
}
|
||||
|
||||
async setClientPresence({ status, since, afk, activity }) {
|
||||
async setClientPresence({ status, since, afk, activity }) { // eslint-disable-line complexity
|
||||
if (typeof activity.name !== 'string') throw new TypeError('INVALID_TYPE', 'name', 'string');
|
||||
if (!activity.type) activity.type = 0;
|
||||
const applicationID = activity && (activity.application ? activity.application.id || activity.application : null);
|
||||
let assets = new Collection();
|
||||
if (activity && activity.assets && applicationID) {
|
||||
|
||||
Reference in New Issue
Block a user