update api handler

This commit is contained in:
MARCROCK22 2024-03-11 18:04:26 -04:00
parent 4a95cc962f
commit c97eb19869
2 changed files with 7 additions and 3 deletions

View File

@ -27,6 +27,8 @@ export class ApiHandler {
constructor(options: ApiHandlerOptions) { constructor(options: ApiHandlerOptions) {
this.options = { this.options = {
baseUrl: 'api/v10',
domain: 'https://discord.com',
...options, ...options,
userAgent: DefaultUserAgent, userAgent: DefaultUserAgent,
}; };

View File

@ -1,18 +1,20 @@
import type { MakeRequired } from '../common';
export * from './api'; export * from './api';
export * from './utils/constants'; export * from './utils/constants';
export * from './utils/types'; export * from './utils/types';
export { calculateUserDefaultAvatarIndex } from './utils/utils'; export { calculateUserDefaultAvatarIndex } from './utils/utils';
export interface ApiHandlerOptions { export interface ApiHandlerOptions {
baseUrl: string; baseUrl?: string;
domain: string; domain?: string;
token: string; token: string;
debug?: boolean; debug?: boolean;
agent?: string; agent?: string;
smartBucket?: boolean; smartBucket?: boolean;
} }
export interface ApiHandlerInternalOptions extends ApiHandlerOptions { export interface ApiHandlerInternalOptions extends MakeRequired<ApiHandlerOptions, 'baseUrl' | 'domain'> {
userAgent: string; userAgent: string;
} }