Archived
0
0
Fork 0

fix: client options not assigning as default

This commit is contained in:
Daryl Ronningen 2021-07-06 13:50:43 -05:00
parent a82ff71407
commit 9682a2df38
Signed by: Daryl Ronningen
GPG key ID: FD23F0C934A5EC6B
2 changed files with 3 additions and 2 deletions

View file

@ -9,8 +9,8 @@ export class Client {
private _token: string; private _token: string;
public constructor(token: string, options?: IClientOptions) { public constructor(token: string, options: IClientOptions = {}) {
this.options = Object.assign(options as DeepRequired<IClientOptions>, defaults.clientOptions); this.options = Object.assign(defaults.clientOptions, options as DeepRequired<IClientOptions>);
this._token = token; this._token = token;
this.api = new ApiClient(this._token, this.options.api); this.api = new ApiClient(this._token, this.options.api);

View file

@ -5,6 +5,7 @@ export const defaults: IDefaultOptions = {
api: { api: {
apiUrl: 'https://discord.com/api', apiUrl: 'https://discord.com/api',
apiVersion: 9, apiVersion: 9,
apiRequestTimeout: 5000,
}, },
}, },
}; };