fix: client options not assigning as default
This commit is contained in:
parent
a82ff71407
commit
9682a2df38
2 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||||
|
|
|
@ -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,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Reference in a new issue