mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 08:20:08 +00:00
fix: client errors
This commit is contained in:
@@ -241,6 +241,8 @@ export class Client extends EventEmitter {
|
||||
lastReconnectDelay: number = 0
|
||||
/** The amount of times it has already tried to reconnect. */
|
||||
reconnectAttempts: number = 0
|
||||
/** The client user */
|
||||
user?: ExtendedUser
|
||||
|
||||
constructor(token: string, options: ClientOptions) {
|
||||
super()
|
||||
@@ -264,6 +266,7 @@ export class Client extends EventEmitter {
|
||||
maxResumeAttempts: options.maxResumeAttempts ?? Infinity,
|
||||
intents: options.intents ?? 0,
|
||||
autoreconnect: options.autoreconnect ?? true,
|
||||
guildCreateTimeout: options.guildCreateTimeout ?? 2000,
|
||||
reconnectDelay: options.reconnectDelay ?? ((lastDelay, attempts) => Math.pow(attempts + 1, 0.7) * 20000),
|
||||
}
|
||||
|
||||
@@ -2313,6 +2316,11 @@ export interface ClientOptions {
|
||||
intents?: GatewayIntents
|
||||
/** Whether or not to automatically reconnect to gateway. */
|
||||
autoreconnect?: boolean
|
||||
/**
|
||||
* How long in milliseconds to wait for a GUILD_CREATE before "ready" is fired. Increase this value if you notice missing guilds
|
||||
* @default 2000
|
||||
*/
|
||||
guildCreateTimeout?: number
|
||||
/** Handler to determine how many milliseconds to wait before reconnecting. */
|
||||
reconnectDelay?: (lastDelay: number, attempts: number) => Promise<number> | number
|
||||
}
|
||||
@@ -2352,6 +2360,8 @@ export interface ParsedClientOptions {
|
||||
intents: GatewayIntents
|
||||
/** Whether or not to automatically reconnect to gateway. */
|
||||
autoreconnect: boolean
|
||||
/** How long in milliseconds to wait for a GUILD_CREATE before "ready" is fired. Increase this value if you notice missing guilds */
|
||||
guildCreateTimeout: number
|
||||
/** Handler to determine how many milliseconds to wait before reconnecting. */
|
||||
reconnectDelay: (lastDelay: number, attempts: number) => Promise<number> | number
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -977,7 +977,7 @@ export interface PartialEmoji {
|
||||
// url: string;
|
||||
// }
|
||||
export interface RequestMembersPromise {
|
||||
members: Member
|
||||
members: Member[]
|
||||
received: number
|
||||
res: (value: Member[]) => void
|
||||
timeout: number
|
||||
|
||||
@@ -2,8 +2,6 @@ import { describe, it } from 'mocha'
|
||||
|
||||
describe('index.ts', () => {
|
||||
it('will import without error', async () => {
|
||||
try {
|
||||
await import('../src/index.js')
|
||||
} catch {}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -173,7 +173,7 @@ export interface StatusUpdate {
|
||||
// /** Unix time (in milliseconds) of when the client went idle, or null if the client is not idle */
|
||||
// since: number | null;
|
||||
/** The user's activities */
|
||||
activities: Camelize<DiscordActivity[]>
|
||||
activities?: Camelize<Array<Omit<DiscordActivity, "created_at">>>
|
||||
/** The user's new status */
|
||||
status: keyof typeof PresenceStatus
|
||||
// /** Whether or not the client is afk */
|
||||
|
||||
Reference in New Issue
Block a user