chore: release v3.6.1
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "discord.js-selfbot-v13",
|
"name": "discord.js-selfbot-v13",
|
||||||
"version": "3.6.0",
|
"version": "3.6.1",
|
||||||
"description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]",
|
"description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]",
|
||||||
"main": "./src/index.js",
|
"main": "./src/index.js",
|
||||||
"types": "./typings/index.d.ts",
|
"types": "./typings/index.d.ts",
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ class RelationshipManager extends BaseManager {
|
|||||||
if (user instanceof GuildMember) return user.user.id;
|
if (user instanceof GuildMember) return user.user.id;
|
||||||
if (user instanceof Message) return user.author.id;
|
if (user instanceof Message) return user.author.id;
|
||||||
if (user instanceof User) return user.id;
|
if (user instanceof User) return user.id;
|
||||||
return user;
|
return user.match(/\d{17,19}/)?.[0] || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -168,6 +168,8 @@ class RelationshipManager extends BaseManager {
|
|||||||
* @returns {Promise<boolean>}
|
* @returns {Promise<boolean>}
|
||||||
*/
|
*/
|
||||||
async deleteRelationship(user) {
|
async deleteRelationship(user) {
|
||||||
|
throw new Error('Risky action, not finished yet.');
|
||||||
|
// eslint-disable-next-line no-unreachable
|
||||||
const id = this.resolveId(user);
|
const id = this.resolveId(user);
|
||||||
if (
|
if (
|
||||||
![RelationshipTypes.FRIEND, RelationshipTypes.BLOCKED, RelationshipTypes.PENDING_OUTGOING].includes(
|
![RelationshipTypes.FRIEND, RelationshipTypes.BLOCKED, RelationshipTypes.PENDING_OUTGOING].includes(
|
||||||
@@ -182,21 +184,22 @@ class RelationshipManager extends BaseManager {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {Object} FriendRequestOptions
|
|
||||||
* @property {UserResolvable} [user] Target
|
|
||||||
* @property {string} [username] Discord username
|
|
||||||
* @property {number | null} [discriminator] Discord discriminator
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a friend request.
|
* Sends a friend request.
|
||||||
* @param {FriendRequestOptions} options Target
|
* @param {UserResolvable} options Target (User Object, Username, User Id)
|
||||||
* @returns {Promise<boolean>}
|
* @returns {Promise<boolean>}
|
||||||
*/
|
*/
|
||||||
async sendFriendRequest(options) {
|
async sendFriendRequest(options) {
|
||||||
if (options?.user) {
|
throw new Error('Risky action, not finished yet.');
|
||||||
const username = this.resolveUsername(options.user);
|
// eslint-disable-next-line no-unreachable
|
||||||
|
const id = this.resolveId(options);
|
||||||
|
if (id) {
|
||||||
|
await this.client.api.users['@me'].relationships[id].put({
|
||||||
|
data: {},
|
||||||
|
DiscordContext: { location: 'ContextMenu' },
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
const username = this.resolveUsername(options);
|
||||||
await this.client.api.users['@me'].relationships.post({
|
await this.client.api.users['@me'].relationships.post({
|
||||||
versioned: true,
|
versioned: true,
|
||||||
data: {
|
data: {
|
||||||
@@ -205,18 +208,8 @@ class RelationshipManager extends BaseManager {
|
|||||||
},
|
},
|
||||||
DiscordContext: { location: 'Add Friend' },
|
DiscordContext: { location: 'Add Friend' },
|
||||||
});
|
});
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
await this.client.api.users['@me'].relationships.post({
|
|
||||||
versioned: true,
|
|
||||||
data: {
|
|
||||||
username: options.username,
|
|
||||||
discriminator: null,
|
|
||||||
},
|
|
||||||
DiscordContext: { location: 'Add Friend' },
|
|
||||||
});
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -225,13 +218,15 @@ class RelationshipManager extends BaseManager {
|
|||||||
* @returns {Promise<boolean>}
|
* @returns {Promise<boolean>}
|
||||||
*/
|
*/
|
||||||
async addFriend(user) {
|
async addFriend(user) {
|
||||||
|
throw new Error('Risky action, not finished yet.');
|
||||||
|
// eslint-disable-next-line no-unreachable
|
||||||
const id = this.resolveId(user);
|
const id = this.resolveId(user);
|
||||||
// Check if already friends
|
// Check if already friends
|
||||||
if (this.cache.get(id) === RelationshipTypes.FRIEND) return Promise.resolve(false);
|
if (this.cache.get(id) === RelationshipTypes.FRIEND) return Promise.resolve(false);
|
||||||
// Check if outgoing request
|
// Check if outgoing request
|
||||||
if (this.cache.get(id) === RelationshipTypes.PENDING_OUTGOING) return Promise.resolve(false);
|
if (this.cache.get(id) === RelationshipTypes.PENDING_OUTGOING) return Promise.resolve(false);
|
||||||
await this.client.api.users['@me'].relationships[id].put({
|
await this.client.api.users['@me'].relationships[id].put({
|
||||||
data: {},
|
data: { confirm_stranger_request: true },
|
||||||
DiscordContext: { location: 'Friends' },
|
DiscordContext: { location: 'Friends' },
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
@@ -265,6 +260,8 @@ class RelationshipManager extends BaseManager {
|
|||||||
* @returns {Promise<boolean>}
|
* @returns {Promise<boolean>}
|
||||||
*/
|
*/
|
||||||
async addBlocked(user) {
|
async addBlocked(user) {
|
||||||
|
throw new Error('Risky action, not finished yet.');
|
||||||
|
// eslint-disable-next-line no-unreachable
|
||||||
const id = this.resolveId(user);
|
const id = this.resolveId(user);
|
||||||
// Check
|
// Check
|
||||||
if (this.cache.get(id) === RelationshipTypes.BLOCKED) return Promise.resolve(false);
|
if (this.cache.get(id) === RelationshipTypes.BLOCKED) return Promise.resolve(false);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class APIRequest {
|
|||||||
let headers = {
|
let headers = {
|
||||||
accept: '*/*',
|
accept: '*/*',
|
||||||
'accept-language': 'en-US',
|
'accept-language': 'en-US',
|
||||||
'sec-ch-ua': '"Chromium";v="131", "Not_A Brand";v="24"',
|
'sec-ch-ua': '"Chromium";v="134", "Not:A-Brand";v="24", "Google Chrome";v="134"',
|
||||||
'sec-ch-ua-mobile': '?0',
|
'sec-ch-ua-mobile': '?0',
|
||||||
'sec-ch-ua-platform': '"Windows"',
|
'sec-ch-ua-platform': '"Windows"',
|
||||||
'sec-fetch-dest': 'empty',
|
'sec-fetch-dest': 'empty',
|
||||||
|
|||||||
@@ -485,7 +485,7 @@ class User extends Base {
|
|||||||
* @returns {Promise<boolean>}
|
* @returns {Promise<boolean>}
|
||||||
*/
|
*/
|
||||||
sendFriendRequest() {
|
sendFriendRequest() {
|
||||||
return this.client.relationships.sendFriendRequest({ user: this });
|
return this.client.relationships.sendFriendRequest(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ const { Error, RangeError, TypeError } = require('../errors');
|
|||||||
exports.MaxBulkDeletableMessageAge = 1_209_600_000;
|
exports.MaxBulkDeletableMessageAge = 1_209_600_000;
|
||||||
|
|
||||||
exports.UserAgent =
|
exports.UserAgent =
|
||||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Electron/33.0.0 Safari/537.36';
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Electron/33.4.0 Safari/537.36';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Google Chrome v131 TLS ciphers
|
* Chrome TLS ciphers
|
||||||
* @see {@link https://tls.browserleaks.com/tls}
|
* @see {@link https://tls.browserleaks.com/tls}
|
||||||
* @see {@link https://github.com/yifeikong/curl-impersonate}
|
* @see {@link https://github.com/yifeikong/curl-impersonate}
|
||||||
* @typedef {Array<string>} Ciphers
|
* @typedef {Array<string>} Ciphers
|
||||||
|
|||||||
@@ -192,16 +192,17 @@ class Options extends null {
|
|||||||
os: 'Windows',
|
os: 'Windows',
|
||||||
browser: 'Chrome',
|
browser: 'Chrome',
|
||||||
device: '',
|
device: '',
|
||||||
system_locale: 'vi-VN',
|
system_locale: 'en-US',
|
||||||
|
has_client_mods: false,
|
||||||
browser_user_agent: UserAgent,
|
browser_user_agent: UserAgent,
|
||||||
browser_version: '131.0.0.0',
|
browser_version: '134.0.0.0',
|
||||||
os_version: '10',
|
os_version: '10',
|
||||||
referrer: '',
|
referrer: '',
|
||||||
referring_domain: '',
|
referring_domain: '',
|
||||||
referrer_current: '',
|
referrer_current: '',
|
||||||
referring_domain_current: '',
|
referring_domain_current: '',
|
||||||
release_channel: 'stable',
|
release_channel: 'stable',
|
||||||
client_build_number: 360320,
|
client_build_number: 377668,
|
||||||
client_event_source: null,
|
client_event_source: null,
|
||||||
},
|
},
|
||||||
compress: false,
|
compress: false,
|
||||||
|
|||||||
11
typings/index.d.ts
vendored
11
typings/index.d.ts
vendored
@@ -4251,7 +4251,7 @@ export class RelationshipManager extends BaseManager {
|
|||||||
public resolveId(user: UserResolvable): Snowflake | undefined;
|
public resolveId(user: UserResolvable): Snowflake | undefined;
|
||||||
public fetch(user?: UserResolvable, options?: BaseFetchOptions): Promise<RelationshipTypes | RelationshipManager>;
|
public fetch(user?: UserResolvable, options?: BaseFetchOptions): Promise<RelationshipTypes | RelationshipManager>;
|
||||||
public deleteRelationship(user: UserResolvable): Promise<boolean>;
|
public deleteRelationship(user: UserResolvable): Promise<boolean>;
|
||||||
public sendFriendRequest(options: FriendRequestOptions): Promise<boolean>;
|
public sendFriendRequest(options: UserResolvable): Promise<boolean>;
|
||||||
public addFriend(user: UserResolvable): Promise<boolean>;
|
public addFriend(user: UserResolvable): Promise<boolean>;
|
||||||
public setNickname(user: UserResolvable, nickname: string | null | undefined): Promise<boolean>;
|
public setNickname(user: UserResolvable, nickname: string | null | undefined): Promise<boolean>;
|
||||||
public addBlocked(user: UserResolvable): Promise<boolean>;
|
public addBlocked(user: UserResolvable): Promise<boolean>;
|
||||||
@@ -7847,15 +7847,6 @@ export interface WebhookClientDataURL {
|
|||||||
url: string;
|
url: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type FriendRequestOptions =
|
|
||||||
| {
|
|
||||||
user: UserResolvable;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
username: string;
|
|
||||||
discriminator: number | null;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type WebhookClientOptions = Pick<
|
export type WebhookClientOptions = Pick<
|
||||||
ClientOptions,
|
ClientOptions,
|
||||||
'allowedMentions' | 'restTimeOffset' | 'restRequestTimeout' | 'retryLimit' | 'http'
|
'allowedMentions' | 'restTimeOffset' | 'restRequestTimeout' | 'retryLimit' | 'http'
|
||||||
|
|||||||
Reference in New Issue
Block a user