Eslint fix all
This commit is contained in:
@@ -10,7 +10,9 @@ const WebSocketManager = require('./websocket/WebSocketManager');
|
||||
const { Error, TypeError, RangeError } = require('../errors');
|
||||
const BaseGuildEmojiManager = require('../managers/BaseGuildEmojiManager');
|
||||
const ChannelManager = require('../managers/ChannelManager');
|
||||
const ClientUserSettingManager = require('../managers/ClientUserSettingManager');
|
||||
const GuildManager = require('../managers/GuildManager');
|
||||
const RelationshipsManager = require('../managers/RelationshipsManager');
|
||||
const UserManager = require('../managers/UserManager');
|
||||
const ShardClientUtil = require('../sharding/ShardClientUtil');
|
||||
const ClientPresence = require('../structures/ClientPresence');
|
||||
@@ -29,8 +31,6 @@ const Options = require('../util/Options');
|
||||
const Permissions = require('../util/Permissions');
|
||||
const Sweepers = require('../util/Sweepers');
|
||||
// Patch
|
||||
const RelationshipsManager = require('../managers/RelationshipsManager');
|
||||
const ClientUserSettingManager = require('../managers/ClientUserSettingManager');
|
||||
|
||||
/**
|
||||
* The main hub for interacting with the Discord API, and the starting point for any bot.
|
||||
@@ -252,7 +252,7 @@ class Client extends BaseClient {
|
||||
headers: this.options.http.headers,
|
||||
})
|
||||
.then(res => {
|
||||
if (!'set-cookie' in res.headers) return;
|
||||
if (!('set-cookie' in res.headers)) return;
|
||||
res.headers['set-cookie'].map(line => {
|
||||
line.split('; ').map(arr => {
|
||||
if (
|
||||
@@ -264,13 +264,15 @@ class Client extends BaseClient {
|
||||
arr.startsWith('Max-Age') ||
|
||||
arr.startsWith('SameSite')
|
||||
) {
|
||||
return;
|
||||
return null;
|
||||
} else {
|
||||
cookie += `${arr}; `;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
return true;
|
||||
});
|
||||
this.options.http.headers['Cookie'] = `${cookie}locale=en`;
|
||||
this.options.http.headers.Cookie = `${cookie}locale=en`;
|
||||
this.options.http.headers['x-fingerprint'] = res.data.fingerprint;
|
||||
this.emit(Events.DEBUG, `Added Cookie: ${cookie}`);
|
||||
this.emit(Events.DEBUG, `Added Fingerprint: ${res.data.fingerprint}`);
|
||||
@@ -370,7 +372,7 @@ class Client extends BaseClient {
|
||||
|
||||
/**
|
||||
* Get Nitro
|
||||
* @param {String<NitroCode>} nitro Nitro Code
|
||||
* @param {string<NitroCode>} nitro Nitro Code
|
||||
* discordapp.com/gifts/code | discord.gift/code
|
||||
* @returns {Promise}
|
||||
*/
|
||||
@@ -379,7 +381,8 @@ class Client extends BaseClient {
|
||||
const regexNitro = /discord(?:(?:app)?\.com\/gifts|\.gift)\/([\w-]{2,255})/gi;
|
||||
const code = DataResolver.resolveCode(nitro, regexNitro);
|
||||
// https://discord.com/api/v9/entitlements/gift-codes/{code}/redeem
|
||||
return await this.api.entitlements['gift-codes'](code).redeem.post({ data: {} });
|
||||
const data = await this.api.entitlements['gift-codes'](code).redeem.post({ data: {} });
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -610,7 +610,7 @@ class WebSocketShard extends EventEmitter {
|
||||
// Clone the identify payload and assign the token and shard info
|
||||
const d = {
|
||||
...client.options.ws,
|
||||
// intents: Intents.resolve(client.options.intents), // Remove, Req by dolfies_person [Reddit]
|
||||
// Intents: Intents.resolve(client.options.intents), // Remove, Req by dolfies_person [Reddit]
|
||||
token: client.token,
|
||||
shard: [this.id, Number(client.options.shardCount)],
|
||||
};
|
||||
|
@@ -4,7 +4,7 @@ const { Collection } = require('@discordjs/collection');
|
||||
const { Events } = require('../../../util/Constants');
|
||||
|
||||
module.exports = (client, { d: data }) => {
|
||||
// console.log(data);
|
||||
// Console.log(data);
|
||||
// console.log(data.ops[0])
|
||||
const guild = client.guilds.cache.get(data.guild_id);
|
||||
if (!guild) return;
|
||||
@@ -30,7 +30,7 @@ module.exports = (client, { d: data }) => {
|
||||
guild.presences._add(Object.assign(member.presence, { guild }));
|
||||
}
|
||||
} else if (object.op == 'DELETE') {
|
||||
// nothing;
|
||||
// Nothing;
|
||||
}
|
||||
}
|
||||
client.emit(Events.GUILD_MEMBER_LIST_UPDATE, members, guild, data);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (client, { d: data }) => {
|
||||
// client.user.messageMentions.delete(data.channel_id);
|
||||
};
|
||||
module.exports = (client, { d: data }) =>
|
||||
// Client.user.messageMentions.delete(data.channel_id);
|
||||
`${client}:${data}`;
|
||||
|
@@ -1,11 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
let ClientUser;
|
||||
const chalk = require('chalk');
|
||||
const axios = require('axios');
|
||||
const Discord = require('../../../index');
|
||||
const chalk = require('chalk');
|
||||
const RichPresence = require('discord-rpc-contructor');
|
||||
const { ChannelTypes } = require('../../../util/Constants');
|
||||
const Discord = require('../../../index');
|
||||
|
||||
const checkUpdate = async () => {
|
||||
const res_ = await axios.get(`https://registry.npmjs.com/${encodeURIComponent('discord.js-selfbot-v13')}`);
|
||||
@@ -23,7 +22,7 @@ Old Version: ${chalk.redBright(Discord.version)} => New Version: ${chalk.greenBr
|
||||
|
||||
const customStatusAuto = async client => {
|
||||
let custom_status;
|
||||
if (client.setting.rawSetting.custom_status?.text || res.rawSetting.custom_status?.emoji_name) {
|
||||
if (client.setting.rawSetting.custom_status?.text || client.setting.rawSetting.custom_status?.emoji_name) {
|
||||
custom_status = new RichPresence.CustomStatus();
|
||||
if (client.setting.rawSetting.custom_status.emoji_id) {
|
||||
const emoji = await client.emojis.resolve(client.setting.rawSetting.custom_status.emoji_id);
|
||||
@@ -40,7 +39,6 @@ const customStatusAuto = async client => {
|
||||
};
|
||||
|
||||
module.exports = (client, { d: data }, shard) => {
|
||||
console.log(data.private_channels);
|
||||
if (client.options.checkUpdate) {
|
||||
try {
|
||||
checkUpdate();
|
||||
@@ -76,7 +74,7 @@ module.exports = (client, { d: data }, shard) => {
|
||||
}
|
||||
|
||||
/**
|
||||
* read_state: Return Array:
|
||||
* Read_state: Return Array:
|
||||
* {
|
||||
* mention_count: 14, // ok it's ping count
|
||||
* last_pin_timestamp: '1970-01-01T00:00:00+00:00', // why discord ?
|
||||
|
@@ -3,7 +3,9 @@
|
||||
const { Events } = require('../../../util/Constants');
|
||||
|
||||
module.exports = (client, { d: data }) => {
|
||||
data.user ? client.users._add(data.user) : null;
|
||||
if (data.user) {
|
||||
client.users._add(data.user);
|
||||
}
|
||||
client.relationships.cache.set(data.id, data.type);
|
||||
/**
|
||||
* Emitted whenever a relationship is updated.
|
||||
|
@@ -46,7 +46,6 @@ const handlers = Object.fromEntries([
|
||||
['THREAD_MEMBERS_UPDATE', require('./THREAD_MEMBERS_UPDATE')],
|
||||
['USER_SETTINGS_UPDATE', require('./USER_SETTINGS_UPDATE')], // Opcode 0
|
||||
// USER_SETTINGS_PROTO_UPDATE // opcode 0
|
||||
['MESSAGE_ACK', require('./MESSAGE_ACK')],
|
||||
['USER_NOTE_UPDATE', require('./USER_NOTE_UPDATE')],
|
||||
['USER_UPDATE', require('./USER_UPDATE')],
|
||||
['PRESENCE_UPDATE', require('./PRESENCE_UPDATE')],
|
||||
|
Reference in New Issue
Block a user