feat: Update
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const { Presence } = require('./Presence');
|
||||
const { CustomStatus } = require('./RichPresence');
|
||||
const { TypeError } = require('../errors');
|
||||
const { Opcodes, ActivityTypes } = require('../util/Constants');
|
||||
|
||||
@@ -48,7 +49,9 @@ class ClientPresence extends Presence {
|
||||
};
|
||||
if (activities?.length) {
|
||||
for (const [i, activity] of activities.entries()) {
|
||||
if (typeof activity.name !== 'string') throw new TypeError('INVALID_TYPE', `activities[${i}].name`, 'string');
|
||||
if (!(activity instanceof CustomStatus) && typeof activity.name !== 'string') {
|
||||
throw new TypeError('INVALID_TYPE', `activities[${i}].name`, 'string');
|
||||
}
|
||||
activity.type ??= 0;
|
||||
data.activities.push(
|
||||
Object.assign(activity, {
|
||||
|
@@ -364,7 +364,7 @@ class ClientUser extends User {
|
||||
* @typedef {Object} PresenceData
|
||||
* @property {PresenceStatusData} [status] Status of the user
|
||||
* @property {boolean} [afk] Whether the user is AFK
|
||||
* @property {ActivitiesOptions[]} [activities] Activity the user is playing
|
||||
* @property {Array[ActivitiesOptions|CustomStatus|RichPresence|SpotifyRPC]} [activities] Activity the user is playing
|
||||
* @property {number|number[]} [shardId] Shard id(s) to have the activity set on
|
||||
*/
|
||||
|
||||
|
@@ -77,6 +77,18 @@ class CustomStatus {
|
||||
state: this.state,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* When concatenated with a string, this automatically returns the activities' name instead of the Activity object.
|
||||
* @returns {string}
|
||||
*/
|
||||
toString() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
_clone() {
|
||||
return Object.assign(Object.create(this), this);
|
||||
}
|
||||
}
|
||||
|
||||
class RichPresence {
|
||||
@@ -520,6 +532,18 @@ https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Documents/RichP
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* When concatenated with a string, this automatically returns the activities' name instead of the Activity object.
|
||||
* @returns {string}
|
||||
*/
|
||||
toString() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
_clone() {
|
||||
return Object.assign(Object.create(this), this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user