Selfbot update
added headers to discord hard to detect selfbot 'x-fingerprint' cookies 'x-super-properties'
This commit is contained in:
parent
590a778c4a
commit
f361bed628
@ -34,6 +34,7 @@ const client = new Client({
|
|||||||
new Client({
|
new Client({
|
||||||
checkUpdate: true, // Check Package Update (Bot Ready) [Enable Default]
|
checkUpdate: true, // Check Package Update (Bot Ready) [Enable Default]
|
||||||
readyStatus: false, // Set Custom Status sync from Account (Bot Ready) [Disable Default]
|
readyStatus: false, // Set Custom Status sync from Account (Bot Ready) [Disable Default]
|
||||||
|
autoCookie: true, // Auto added Cookie and Fingerprint [Enable Default](https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/DOCUMENT.md#http-options)
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
</details>
|
</details>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "discord.js-selfbot-v13",
|
"name": "discord.js-selfbot-v13",
|
||||||
"version": "1.2.8",
|
"version": "1.3.0",
|
||||||
"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",
|
||||||
|
@ -260,6 +260,46 @@ class Client extends BaseClient {
|
|||||||
.join('.')}`,
|
.join('.')}`,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (this.options.autoCookie) {
|
||||||
|
/* Auto find fingerprint and add Cookie */
|
||||||
|
let cookie = '';
|
||||||
|
await require('axios')({
|
||||||
|
method: 'get',
|
||||||
|
url: 'https://discord.com/api/v9/experiments',
|
||||||
|
headers: this.options.http.headers,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
if (!'set-cookie' in res.headers) return;
|
||||||
|
res.headers['set-cookie'].map((line) => {
|
||||||
|
line.split('; ').map((arr) => {
|
||||||
|
if (
|
||||||
|
arr.startsWith('Expires') ||
|
||||||
|
arr.startsWith('Path') ||
|
||||||
|
arr.startsWith('Domain') ||
|
||||||
|
arr.startsWith('HttpOnly') ||
|
||||||
|
arr.startsWith('Secure') ||
|
||||||
|
arr.startsWith('Max-Age') ||
|
||||||
|
arr.startsWith('SameSite')
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
cookie += `${arr}; `;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
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}`);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.emit(
|
||||||
|
Events.DEBUG,
|
||||||
|
`Finding Cookie and Fingerprint failed: ${err.message}`,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (this.options.presence) {
|
if (this.options.presence) {
|
||||||
this.options.ws.presence = this.presence._parse(this.options.presence);
|
this.options.ws.presence = this.presence._parse(this.options.presence);
|
||||||
}
|
}
|
||||||
|
@ -135,6 +135,7 @@ class Options extends null {
|
|||||||
jsonTransformer: (object) => JSONBig.stringify(object),
|
jsonTransformer: (object) => JSONBig.stringify(object),
|
||||||
checkUpdate: true,
|
checkUpdate: true,
|
||||||
readyStatus: false,
|
readyStatus: false,
|
||||||
|
autoCookie: true,
|
||||||
waitGuildTimeout: 15_000,
|
waitGuildTimeout: 15_000,
|
||||||
shardCount: 1,
|
shardCount: 1,
|
||||||
makeCache: this.cacheWithLimits(this.defaultMakeCacheSettings),
|
makeCache: this.cacheWithLimits(this.defaultMakeCacheSettings),
|
||||||
@ -176,14 +177,15 @@ class Options extends null {
|
|||||||
http: {
|
http: {
|
||||||
headers: {
|
headers: {
|
||||||
Accept: '*/*',
|
Accept: '*/*',
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
// 'Accept-Encoding': 'gzip, deflate, br', => cause axios bug
|
||||||
'Accept-Language': 'en-US,en;q=0.9',
|
'Accept-Language': 'en-US,en;q=0.9',
|
||||||
'Cache-Control': 'no-cache',
|
'Cache-Control': 'no-cache',
|
||||||
Pragma: 'no-cache',
|
Pragma: 'no-cache',
|
||||||
Referer: 'https://discord.com/channels/@me',
|
Referer: 'https://discord.com/channels/@me',
|
||||||
'Sec-Ch-Ua': '" Not A;Brand";v="99" "',
|
'Sec-Ch-Ua':
|
||||||
|
'"Not A;Brand";v="99", "Chromium";v="100", "Google Chrome";v="100',
|
||||||
'Sec-Ch-Ua-Mobile': '?0',
|
'Sec-Ch-Ua-Mobile': '?0',
|
||||||
'Sec-Ch-Ua-Platform': '"iOS"',
|
'Sec-Ch-Ua-Platform': '"Windows"',
|
||||||
'Sec-Fetch-Dest': 'empty',
|
'Sec-Fetch-Dest': 'empty',
|
||||||
'Sec-Fetch-Mode': 'cors',
|
'Sec-Fetch-Mode': 'cors',
|
||||||
'Sec-Fetch-Site': 'same-origin',
|
'Sec-Fetch-Site': 'same-origin',
|
||||||
|
44
typings/index.d.ts
vendored
44
typings/index.d.ts
vendored
@ -641,7 +641,7 @@ export class ClientUser extends User {
|
|||||||
public setPresence(data: PresenceData): ClientPresence;
|
public setPresence(data: PresenceData): ClientPresence;
|
||||||
public setStatus(status: PresenceStatusData, shardId?: number | number[]): ClientPresence;
|
public setStatus(status: PresenceStatusData, shardId?: number | number[]): ClientPresence;
|
||||||
public setUsername(username: string, password: string): Promise<this>;
|
public setUsername(username: string, password: string): Promise<this>;
|
||||||
public setHypeSquad(type: HypeSquadOptions<Number|String>): Promise<void>;
|
public setHypeSquad(type: HypeSquadOptions<Number | String>): Promise<void>;
|
||||||
public setAccentColor(color: ColorResolvable): Promise<this>;
|
public setAccentColor(color: ColorResolvable): Promise<this>;
|
||||||
public setDiscriminator(discriminator: string, password: string): Promise<this>;
|
public setDiscriminator(discriminator: string, password: string): Promise<this>;
|
||||||
public setAboutMe(bio: string): Promise<this>;
|
public setAboutMe(bio: string): Promise<this>;
|
||||||
@ -1046,7 +1046,7 @@ export class GuildAuditLogsEntry<
|
|||||||
TTargetType extends GuildAuditLogsTarget = TAction extends keyof GuildAuditLogsTypes
|
TTargetType extends GuildAuditLogsTarget = TAction extends keyof GuildAuditLogsTypes
|
||||||
? GuildAuditLogsTypes[TAction][0]
|
? GuildAuditLogsTypes[TAction][0]
|
||||||
: 'UNKNOWN',
|
: 'UNKNOWN',
|
||||||
> {
|
> {
|
||||||
private constructor(logs: GuildAuditLogs, guild: Guild, data: RawGuildAuditLogEntryData);
|
private constructor(logs: GuildAuditLogs, guild: Guild, data: RawGuildAuditLogEntryData);
|
||||||
public action: TAction;
|
public action: TAction;
|
||||||
public actionType: TActionType;
|
public actionType: TActionType;
|
||||||
@ -1284,7 +1284,7 @@ export class HTTPError extends Error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line:no-empty-interface - Merge RateLimitData into RateLimitError to not have to type it again
|
// tslint:disable-next-line:no-empty-interface - Merge RateLimitData into RateLimitError to not have to type it again
|
||||||
export interface RateLimitError extends RateLimitData {}
|
export interface RateLimitError extends RateLimitData { }
|
||||||
export class RateLimitError extends Error {
|
export class RateLimitError extends Error {
|
||||||
private constructor(data: RateLimitData);
|
private constructor(data: RateLimitData);
|
||||||
public name: 'RateLimitError';
|
public name: 'RateLimitError';
|
||||||
@ -1337,7 +1337,7 @@ export type CacheTypeReducer<
|
|||||||
RawType = CachedType,
|
RawType = CachedType,
|
||||||
PresentType = CachedType | RawType,
|
PresentType = CachedType | RawType,
|
||||||
Fallback = PresentType | null,
|
Fallback = PresentType | null,
|
||||||
> = [State] extends ['cached']
|
> = [State] extends ['cached']
|
||||||
? CachedType
|
? CachedType
|
||||||
: [State] extends ['raw']
|
: [State] extends ['raw']
|
||||||
? RawType
|
? RawType
|
||||||
@ -1489,7 +1489,7 @@ export type MessageCollectorOptionsParams<T extends MessageComponentTypeResolvab
|
|||||||
export type MessageChannelCollectorOptionsParams<
|
export type MessageChannelCollectorOptionsParams<
|
||||||
T extends MessageComponentTypeResolvable,
|
T extends MessageComponentTypeResolvable,
|
||||||
Cached extends boolean = boolean,
|
Cached extends boolean = boolean,
|
||||||
> =
|
> =
|
||||||
| {
|
| {
|
||||||
componentType?: T;
|
componentType?: T;
|
||||||
} & MessageChannelComponentCollectorOptions<MappedInteractionTypes<Cached>[T]>;
|
} & MessageChannelComponentCollectorOptions<MappedInteractionTypes<Cached>[T]>;
|
||||||
@ -1497,7 +1497,7 @@ export type MessageChannelCollectorOptionsParams<
|
|||||||
export type AwaitMessageCollectorOptionsParams<
|
export type AwaitMessageCollectorOptionsParams<
|
||||||
T extends MessageComponentTypeResolvable,
|
T extends MessageComponentTypeResolvable,
|
||||||
Cached extends boolean = boolean,
|
Cached extends boolean = boolean,
|
||||||
> =
|
> =
|
||||||
| { componentType?: T } & Pick<
|
| { componentType?: T } & Pick<
|
||||||
InteractionCollectorOptions<MappedInteractionTypes<Cached>[T]>,
|
InteractionCollectorOptions<MappedInteractionTypes<Cached>[T]>,
|
||||||
keyof AwaitMessageComponentOptions<any>
|
keyof AwaitMessageComponentOptions<any>
|
||||||
@ -1710,7 +1710,7 @@ export class MessageComponentInteraction<Cached extends CacheType = CacheType> e
|
|||||||
|
|
||||||
export class MessageContextMenuInteraction<
|
export class MessageContextMenuInteraction<
|
||||||
Cached extends CacheType = CacheType,
|
Cached extends CacheType = CacheType,
|
||||||
> extends ContextMenuInteraction<Cached> {
|
> extends ContextMenuInteraction<Cached> {
|
||||||
public readonly targetMessage: NonNullable<CommandInteractionOption<Cached>['message']>;
|
public readonly targetMessage: NonNullable<CommandInteractionOption<Cached>['message']>;
|
||||||
public inGuild(): this is MessageContextMenuInteraction<'present'>;
|
public inGuild(): this is MessageContextMenuInteraction<'present'>;
|
||||||
public inCachedGuild(): this is MessageContextMenuInteraction<'cached'>;
|
public inCachedGuild(): this is MessageContextMenuInteraction<'cached'>;
|
||||||
@ -2965,7 +2965,7 @@ export class ApplicationCommandManager<
|
|||||||
ApplicationCommandScope = ApplicationCommand<{ guild: GuildResolvable }>,
|
ApplicationCommandScope = ApplicationCommand<{ guild: GuildResolvable }>,
|
||||||
PermissionsOptionsExtras = { guild: GuildResolvable },
|
PermissionsOptionsExtras = { guild: GuildResolvable },
|
||||||
PermissionsGuildType = null,
|
PermissionsGuildType = null,
|
||||||
> extends CachedManager<Snowflake, ApplicationCommandScope, ApplicationCommandResolvable> {
|
> extends CachedManager<Snowflake, ApplicationCommandScope, ApplicationCommandResolvable> {
|
||||||
protected constructor(client: Client, iterable?: Iterable<unknown>, user: User);
|
protected constructor(client: Client, iterable?: Iterable<unknown>, user: User);
|
||||||
public permissions: ApplicationCommandPermissionsManager<
|
public permissions: ApplicationCommandPermissionsManager<
|
||||||
{ command?: ApplicationCommandResolvable } & PermissionsOptionsExtras,
|
{ command?: ApplicationCommandResolvable } & PermissionsOptionsExtras,
|
||||||
@ -3012,7 +3012,7 @@ export class ApplicationCommandPermissionsManager<
|
|||||||
FullPermissionsOptions,
|
FullPermissionsOptions,
|
||||||
GuildType,
|
GuildType,
|
||||||
CommandIdType,
|
CommandIdType,
|
||||||
> extends BaseManager {
|
> extends BaseManager {
|
||||||
private constructor(manager: ApplicationCommandManager | GuildApplicationCommandManager | ApplicationCommand, user: User);
|
private constructor(manager: ApplicationCommandManager | GuildApplicationCommandManager | ApplicationCommand, user: User);
|
||||||
private manager: ApplicationCommandManager | GuildApplicationCommandManager | ApplicationCommand;
|
private manager: ApplicationCommandManager | GuildApplicationCommandManager | ApplicationCommand;
|
||||||
|
|
||||||
@ -4140,6 +4140,10 @@ export interface ClientOptions {
|
|||||||
ws?: WebSocketOptions;
|
ws?: WebSocketOptions;
|
||||||
http?: HTTPOptions;
|
http?: HTTPOptions;
|
||||||
rejectOnRateLimit?: string[] | ((data: RateLimitData) => boolean | Promise<boolean>);
|
rejectOnRateLimit?: string[] | ((data: RateLimitData) => boolean | Promise<boolean>);
|
||||||
|
// add
|
||||||
|
checkUpdate?: boolean;
|
||||||
|
readyStatus?: boolean;
|
||||||
|
autoCookie?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ClientPresenceStatus = 'online' | 'idle' | 'dnd';
|
export type ClientPresenceStatus = 'online' | 'idle' | 'dnd';
|
||||||
@ -4714,8 +4718,8 @@ export interface GuildAuditLogsEntryTargetField<TActionType extends GuildAuditLo
|
|||||||
INVITE: Invite;
|
INVITE: Invite;
|
||||||
MESSAGE: TActionType extends 'MESSAGE_BULK_DELETE' ? Guild | { id: Snowflake } : User;
|
MESSAGE: TActionType extends 'MESSAGE_BULK_DELETE' ? Guild | { id: Snowflake } : User;
|
||||||
INTEGRATION: Integration;
|
INTEGRATION: Integration;
|
||||||
CHANNEL: NonThreadGuildBasedChannel | { id: Snowflake; [x: string]: unknown };
|
CHANNEL: NonThreadGuildBasedChannel | { id: Snowflake;[x: string]: unknown };
|
||||||
THREAD: ThreadChannel | { id: Snowflake; [x: string]: unknown };
|
THREAD: ThreadChannel | { id: Snowflake;[x: string]: unknown };
|
||||||
STAGE_INSTANCE: StageInstance;
|
STAGE_INSTANCE: StageInstance;
|
||||||
STICKER: Sticker;
|
STICKER: Sticker;
|
||||||
GUILD_SCHEDULED_EVENT: GuildScheduledEvent;
|
GUILD_SCHEDULED_EVENT: GuildScheduledEvent;
|
||||||
@ -4901,7 +4905,7 @@ export interface GuildScheduledEventCreateOptions {
|
|||||||
export interface GuildScheduledEventEditOptions<
|
export interface GuildScheduledEventEditOptions<
|
||||||
S extends GuildScheduledEventStatus,
|
S extends GuildScheduledEventStatus,
|
||||||
T extends GuildScheduledEventSetStatusArg<S>,
|
T extends GuildScheduledEventSetStatusArg<S>,
|
||||||
> extends Omit<Partial<GuildScheduledEventCreateOptions>, 'channel'> {
|
> extends Omit<Partial<GuildScheduledEventCreateOptions>, 'channel'> {
|
||||||
channel?: GuildVoiceChannelResolvable | null;
|
channel?: GuildVoiceChannelResolvable | null;
|
||||||
status?: T | number;
|
status?: T | number;
|
||||||
}
|
}
|
||||||
@ -4918,7 +4922,7 @@ export type GuildScheduledEventEntityType = keyof typeof GuildScheduledEventEnti
|
|||||||
|
|
||||||
export type GuildScheduledEventManagerFetchResult<
|
export type GuildScheduledEventManagerFetchResult<
|
||||||
T extends GuildScheduledEventResolvable | FetchGuildScheduledEventOptions | FetchGuildScheduledEventsOptions,
|
T extends GuildScheduledEventResolvable | FetchGuildScheduledEventOptions | FetchGuildScheduledEventsOptions,
|
||||||
> = T extends GuildScheduledEventResolvable | FetchGuildScheduledEventOptions
|
> = T extends GuildScheduledEventResolvable | FetchGuildScheduledEventOptions
|
||||||
? GuildScheduledEvent
|
? GuildScheduledEvent
|
||||||
: Collection<Snowflake, GuildScheduledEvent>;
|
: Collection<Snowflake, GuildScheduledEvent>;
|
||||||
|
|
||||||
@ -5475,24 +5479,24 @@ export type Partialize<
|
|||||||
N extends keyof T | null = null,
|
N extends keyof T | null = null,
|
||||||
M extends keyof T | null = null,
|
M extends keyof T | null = null,
|
||||||
E extends keyof T | '' = '',
|
E extends keyof T | '' = '',
|
||||||
> = {
|
> = {
|
||||||
readonly client: Client;
|
readonly client: Client;
|
||||||
id: Snowflake;
|
id: Snowflake;
|
||||||
partial: true;
|
partial: true;
|
||||||
} & {
|
} & {
|
||||||
[K in keyof Omit<T, 'client' | 'id' | 'partial' | E>]: K extends N ? null : K extends M ? T[K] | null : T[K];
|
[K in keyof Omit<T, 'client' | 'id' | 'partial' | E>]: K extends N ? null : K extends M ? T[K] | null : T[K];
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface PartialDMChannel extends Partialize<DMChannel, null, null, 'lastMessageId'> {
|
export interface PartialDMChannel extends Partialize<DMChannel, null, null, 'lastMessageId'> {
|
||||||
lastMessageId: undefined;
|
lastMessageId: undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PartialGuildMember extends Partialize<GuildMember, 'joinedAt' | 'joinedTimestamp'> {}
|
export interface PartialGuildMember extends Partialize<GuildMember, 'joinedAt' | 'joinedTimestamp'> { }
|
||||||
|
|
||||||
export interface PartialMessage
|
export interface PartialMessage
|
||||||
extends Partialize<Message, 'type' | 'system' | 'pinned' | 'tts', 'content' | 'cleanContent' | 'author'> {}
|
extends Partialize<Message, 'type' | 'system' | 'pinned' | 'tts', 'content' | 'cleanContent' | 'author'> { }
|
||||||
|
|
||||||
export interface PartialMessageReaction extends Partialize<MessageReaction, 'count'> {}
|
export interface PartialMessageReaction extends Partialize<MessageReaction, 'count'> { }
|
||||||
|
|
||||||
export interface PartialOverwriteData {
|
export interface PartialOverwriteData {
|
||||||
id: Snowflake | number;
|
id: Snowflake | number;
|
||||||
@ -5507,7 +5511,7 @@ export interface PartialRoleData extends RoleData {
|
|||||||
|
|
||||||
export type PartialTypes = 'USER' | 'CHANNEL' | 'GUILD_MEMBER' | 'MESSAGE' | 'REACTION' | 'GUILD_SCHEDULED_EVENT';
|
export type PartialTypes = 'USER' | 'CHANNEL' | 'GUILD_MEMBER' | 'MESSAGE' | 'REACTION' | 'GUILD_SCHEDULED_EVENT';
|
||||||
|
|
||||||
export interface PartialUser extends Partialize<User, 'username' | 'tag' | 'discriminator'> {}
|
export interface PartialUser extends Partialize<User, 'username' | 'tag' | 'discriminator'> { }
|
||||||
|
|
||||||
export type PresenceStatusData = ClientPresenceStatus | 'invisible';
|
export type PresenceStatusData = ClientPresenceStatus | 'invisible';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user