diff --git a/src/client/Client.js b/src/client/Client.js index 163086e..581d810 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -635,7 +635,9 @@ class Client extends BaseClient { } custom_status.setState(client.setting.rawSetting.custom_status?.text); client.user.setPresence({ - activities: custom_status ? [custom_status.toDiscord()] : [], + activities: custom_status + ? [custom_status.toDiscord(), ...this.presence.activities.filter(a => a.type !== 'CUSTOM')] + : this.presence.activities.filter(a => a.type !== 'CUSTOM'), status: client.setting.rawSetting.status, }); } diff --git a/src/client/websocket/handlers/READY.js b/src/client/websocket/handlers/READY.js index 5acdc02..37853c3 100644 --- a/src/client/websocket/handlers/READY.js +++ b/src/client/websocket/handlers/READY.js @@ -4,6 +4,7 @@ let ClientUser; const axios = require('axios'); const chalk = require('chalk'); const Discord = require('../../../index'); +const { Events } = require('../../../util/Constants'); const checkUpdate = async () => { const res_ = await axios.get(`https://registry.npmjs.com/${encodeURIComponent('discord.js-selfbot-v13')}`); @@ -49,10 +50,12 @@ module.exports = (client, { d: data }, shard) => { for (const private_channel of data.private_channels) { client.channels._add(private_channel); } - - if (client.options.readyStatus) { - client.customStatusAuto(client); - } + // Start event + client.on(Events.USER_SETTINGS_UPDATE, s => { + if (('status' in s || 'custom_status' in s) && client.options.readyStatus) { + client.customStatusAuto(client); + } + }); /** * Read_state: Return Array: diff --git a/src/util/Constants.js b/src/util/Constants.js index b886960..cec0abc 100644 --- a/src/util/Constants.js +++ b/src/util/Constants.js @@ -342,6 +342,7 @@ exports.Events = { THREAD_MEMBER_UPDATE: 'threadMemberUpdate', THREAD_MEMBERS_UPDATE: 'threadMembersUpdate', USER_UPDATE: 'userUpdate', + USER_SETTINGS_UPDATE: 'userSettingsUpdate', PRESENCE_UPDATE: 'presenceUpdate', VOICE_SERVER_UPDATE: 'voiceServerUpdate', VOICE_STATE_UPDATE: 'voiceStateUpdate', diff --git a/src/util/Options.js b/src/util/Options.js index a51f6df..d28bb4f 100644 --- a/src/util/Options.js +++ b/src/util/Options.js @@ -135,7 +135,7 @@ class Options extends null { return { jsonTransformer: object => JSONBig.stringify(object), checkUpdate: true, - readyStatus: false, + readyStatus: true, autoCookie: true, waitGuildTimeout: 15_000, shardCount: 1, @@ -153,7 +153,9 @@ class Options extends null { restSweepInterval: 60, failIfNotExists: false, userAgentSuffix: [], - presence: {}, + presence: { + status: 'invisible', + }, sweepers: {}, ws: { large_threshold: 50,