Add ClientOptions.restTimeOffset for better performance for bots with a good network connection

This commit is contained in:
Amish Shah
2016-12-24 12:13:42 +00:00
parent 3eca3ba95e
commit 544e456302
4 changed files with 12 additions and 4 deletions

View File

@@ -20,6 +20,8 @@ exports.Package = require('../../package.json');
* @property {boolean} [sync=false] Whether to periodically sync guilds (for userbots)
* @property {number} [restWsBridgeTimeout=5000] Maximum time permitted between REST responses and their
* corresponding websocket events
* @property {number} [restTimeOffset=500] The extra time in millseconds to wait before continuing to make REST
* requests (higher values will reduce rate-limiting errors on bad connections)
* @property {WSEventType[]} [disabledEvents] An array of disabled websocket events. Events in this array will not be
* processed, potentially resulting in performance improvements for larger bots. Only disable events you are
* 100% certain you don't need, as many are important, but not obviously so. The safest one to disable with the
@@ -38,6 +40,7 @@ exports.DefaultOptions = {
sync: false,
restWsBridgeTimeout: 5000,
disabledEvents: [],
restTimeOffset: 500,
/**
* Websocket options. These are left as snake_case to match the API.