Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added port option to rest options #78

Merged
merged 2 commits into from
Jul 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ declare namespace Dysnomia {
baseURL?: string;
disableLatencyCompensation?: boolean;
domain?: string;
port?: string;
https?: boolean;
latencyThreshold?: number;
ratelimiterOffset?: number;
Expand Down
1 change: 1 addition & 0 deletions lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ class Client extends EventEmitter {
* @arg {String} [options.rest.domain="discord.com"] The domain to use for API requests
* @arg {Boolean} [options.rest.https=true] Whether to make requests to the Discord API over HTTPS (true) or HTTP (false)
* @arg {Number} [options.rest.latencyThreshold=30000] The average request latency at which Dysnomia will start emitting latency errors
* @arg {Number} [options.rest.port] The port to use for API requests. Defaults to 443 (HTTPS) or 80 (HTTP)
* @arg {Number} [options.rest.ratelimiterOffset=0] A number of milliseconds to offset the ratelimit timing calculations by
* @arg {Number} [options.rest.requestTimeout=15000] A number of milliseconds before REST requests are considered timed out
* @arg {Boolean} [options.restMode=false] Whether to enable getting objects over REST. Even with this option enabled, it is recommended that you check the cache first before using REST
Expand Down
1 change: 1 addition & 0 deletions lib/rest/RequestHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class RequestHandler {
req = requester.request({
method: method,
host: this.options.domain,
port: this.options.port,
path: this.options.baseURL + finalURL,
headers: headers,
agent: this.options.agent
Expand Down