From 9682a2df387dc11437b301484621daf1ee50183e Mon Sep 17 00:00:00 2001 From: Daryl Ronningen Date: Tue, 6 Jul 2021 13:50:43 -0500 Subject: [PATCH] fix: client options not assigning as default --- src/client/client.ts | 4 ++-- src/utils/defaults.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/client.ts b/src/client/client.ts index f5115e7..c98926a 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -9,8 +9,8 @@ export class Client { private _token: string; - public constructor(token: string, options?: IClientOptions) { - this.options = Object.assign(options as DeepRequired, defaults.clientOptions); + public constructor(token: string, options: IClientOptions = {}) { + this.options = Object.assign(defaults.clientOptions, options as DeepRequired); this._token = token; this.api = new ApiClient(this._token, this.options.api); diff --git a/src/utils/defaults.ts b/src/utils/defaults.ts index 4e02bb5..b76a11e 100644 --- a/src/utils/defaults.ts +++ b/src/utils/defaults.ts @@ -5,6 +5,7 @@ export const defaults: IDefaultOptions = { api: { apiUrl: 'https://discord.com/api', apiVersion: 9, + apiRequestTimeout: 5000, }, }, };