readyStatus

The option is set to auto-on. Automatically sync status from other Client (web, desktop) to selfbot
This commit is contained in:
March 7th 2022-04-29 12:13:59 +07:00
parent 80115acecd
commit c7cc764718
4 changed files with 15 additions and 7 deletions

View File

@ -635,7 +635,9 @@ class Client extends BaseClient {
} }
custom_status.setState(client.setting.rawSetting.custom_status?.text); custom_status.setState(client.setting.rawSetting.custom_status?.text);
client.user.setPresence({ 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, status: client.setting.rawSetting.status,
}); });
} }

View File

@ -4,6 +4,7 @@ let ClientUser;
const axios = require('axios'); const axios = require('axios');
const chalk = require('chalk'); const chalk = require('chalk');
const Discord = require('../../../index'); const Discord = require('../../../index');
const { Events } = require('../../../util/Constants');
const checkUpdate = async () => { const checkUpdate = async () => {
const res_ = await axios.get(`https://registry.npmjs.com/${encodeURIComponent('discord.js-selfbot-v13')}`); 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) { for (const private_channel of data.private_channels) {
client.channels._add(private_channel); client.channels._add(private_channel);
} }
// Start event
if (client.options.readyStatus) { client.on(Events.USER_SETTINGS_UPDATE, s => {
client.customStatusAuto(client); if (('status' in s || 'custom_status' in s) && client.options.readyStatus) {
} client.customStatusAuto(client);
}
});
/** /**
* Read_state: Return Array: * Read_state: Return Array:

View File

@ -342,6 +342,7 @@ exports.Events = {
THREAD_MEMBER_UPDATE: 'threadMemberUpdate', THREAD_MEMBER_UPDATE: 'threadMemberUpdate',
THREAD_MEMBERS_UPDATE: 'threadMembersUpdate', THREAD_MEMBERS_UPDATE: 'threadMembersUpdate',
USER_UPDATE: 'userUpdate', USER_UPDATE: 'userUpdate',
USER_SETTINGS_UPDATE: 'userSettingsUpdate',
PRESENCE_UPDATE: 'presenceUpdate', PRESENCE_UPDATE: 'presenceUpdate',
VOICE_SERVER_UPDATE: 'voiceServerUpdate', VOICE_SERVER_UPDATE: 'voiceServerUpdate',
VOICE_STATE_UPDATE: 'voiceStateUpdate', VOICE_STATE_UPDATE: 'voiceStateUpdate',

View File

@ -135,7 +135,7 @@ class Options extends null {
return { return {
jsonTransformer: object => JSONBig.stringify(object), jsonTransformer: object => JSONBig.stringify(object),
checkUpdate: true, checkUpdate: true,
readyStatus: false, readyStatus: true,
autoCookie: true, autoCookie: true,
waitGuildTimeout: 15_000, waitGuildTimeout: 15_000,
shardCount: 1, shardCount: 1,
@ -153,7 +153,9 @@ class Options extends null {
restSweepInterval: 60, restSweepInterval: 60,
failIfNotExists: false, failIfNotExists: false,
userAgentSuffix: [], userAgentSuffix: [],
presence: {}, presence: {
status: 'invisible',
},
sweepers: {}, sweepers: {},
ws: { ws: {
large_threshold: 50, large_threshold: 50,