mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
feat(ClientOptions): add support for setting an initial presence (#2320)
* docs/feat(WebsocketOptions): Parse ws options presence Allow the `presence` property in `WebsocketOptions` to be used the same way as `ClientUser#setPresence`. * Move presence options to top level
This commit is contained in:
@@ -26,6 +26,7 @@ const browser = exports.browser = typeof window !== 'undefined';
|
||||
* corresponding websocket events
|
||||
* @property {number} [restTimeOffset=500] Extra time in millseconds to wait before continuing to make REST
|
||||
* requests (higher values will reduce rate-limiting errors on bad connections)
|
||||
* @property {PresenceData} [presence] Presence data to use upon login
|
||||
* @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
|
||||
@@ -47,6 +48,7 @@ exports.DefaultOptions = {
|
||||
restWsBridgeTimeout: 5000,
|
||||
disabledEvents: [],
|
||||
restTimeOffset: 500,
|
||||
presence: {},
|
||||
|
||||
/**
|
||||
* WebSocket options (these are left as snake_case to match the API)
|
||||
|
||||
Reference in New Issue
Block a user