mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
feat(Client): add apiResponse and apiRequest events (#6739)
Co-authored-by: Shubham Parihar <shubhamparihar391@gmail.com> Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com> Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Co-authored-by: SpaceEEC <24881032+SpaceEEC@users.noreply.github.com>
This commit is contained in:
13
typings/index.d.ts
vendored
13
typings/index.d.ts
vendored
@@ -49,6 +49,7 @@ import {
|
||||
import { ChildProcess } from 'node:child_process';
|
||||
import { EventEmitter } from 'node:events';
|
||||
import { AgentOptions } from 'node:https';
|
||||
import { Response } from 'node-fetch';
|
||||
import { Stream } from 'node:stream';
|
||||
import { MessagePort, Worker } from 'node:worker_threads';
|
||||
import * as WebSocket from 'ws';
|
||||
@@ -3129,6 +3130,14 @@ export interface APIErrors {
|
||||
STICKER_ANIMATION_DURATION_EXCEEDS_MAXIMUM_OF_5_SECONDS: 170007;
|
||||
}
|
||||
|
||||
export interface APIRequest {
|
||||
method: 'get' | 'post' | 'delete' | 'patch' | 'put';
|
||||
options: unknown;
|
||||
path: string;
|
||||
retries: number;
|
||||
route: string;
|
||||
}
|
||||
|
||||
export interface ApplicationAsset {
|
||||
name: string;
|
||||
id: Snowflake;
|
||||
@@ -3439,6 +3448,8 @@ export interface ChannelWebhookCreateOptions {
|
||||
}
|
||||
|
||||
export interface ClientEvents {
|
||||
apiResponse: [request: APIRequest, response: Response];
|
||||
apiRequest: [request: APIRequest];
|
||||
applicationCommandCreate: [command: ApplicationCommand];
|
||||
applicationCommandDelete: [command: ApplicationCommand];
|
||||
applicationCommandUpdate: [oldCommand: ApplicationCommand | null, newCommand: ApplicationCommand];
|
||||
@@ -3677,6 +3688,8 @@ export interface ConstantsColors {
|
||||
export interface ConstantsEvents {
|
||||
RATE_LIMIT: 'rateLimit';
|
||||
INVALID_REQUEST_WARNING: 'invalidRequestWarning';
|
||||
API_RESPONSE: 'apiResponse';
|
||||
API_REQUEST: 'apiRequest';
|
||||
CLIENT_READY: 'ready';
|
||||
APPLICATION_COMMAND_CREATE: 'applicationCommandCreate';
|
||||
APPLICATION_COMMAND_DELETE: 'applicationCommandDelete';
|
||||
|
||||
Reference in New Issue
Block a user