diff --git a/lib/rest/RequestHandler.ts b/lib/rest/RequestHandler.ts index ebee26a..ee75b2e 100644 --- a/lib/rest/RequestHandler.ts +++ b/lib/rest/RequestHandler.ts @@ -66,9 +66,11 @@ export class RequestHandler { if (!options.path.startsWith("/")) { options.path = `/${options.path}`; } + + if (!options.path.startsWith("/")) options.path = "/" + options.path; const route = options.route ? options.route + "/" + options.path - : `${pkgconfig.GuildedAPI.API_URL}/${options.path}`; + : `${pkgconfig.GuildedAPI.API_URL}${options.path}`; if (!this.ratelimits[route]) { this.ratelimits[route] = new SequentialBucket(1, this.latencyRef); } diff --git a/lib/types/client.d.ts b/lib/types/client.d.ts index 4a2f121..b19dd75 100644 --- a/lib/types/client.d.ts +++ b/lib/types/client.d.ts @@ -54,6 +54,8 @@ export interface ClientOptions { * Data collecting is enabled by default if you use the development build. * * Transparency is key, open-source is transparent, feel free to check the source-code. + * + * [Learn more about what we collect.](https://guide.touchguild.com/data-and-analytics) */ dataCollection?: boolean; /** diff --git a/lib/util/Util.ts b/lib/util/Util.ts index da54568..c496e28 100644 --- a/lib/util/Util.ts +++ b/lib/util/Util.ts @@ -246,7 +246,10 @@ export class Util { profile: await this.getDataCollectionProfile(), collect } - }).catch(err => this.#client.emit("error", err as Error)); + }).catch(err => { + console.log("error linked to data:", collect); + this.#client.emit("error", err as Error); + }); } updateChannel(data: RawChannel): T { if (data.serverId) {