You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Attempting to set the bot token via the token property in the client options results in the token being unable to be loaded. This is caused because the token property is removed from the options object before it can be read by the token loading code.
// called BEFORE the token is readfunctionfilterOptions(options){letfinalOptions=options;if(!options.intents){finalOptions.intents=[discord_js_1.Intents.FLAGS.GUILDS];}elseif(Array.isArray(options.intents)){finalOptions.intents=[...options.intents,discord_js_1.Intents.FLAGS.GUILDS];}elseif(typeofoptions.intents==="number"){finalOptions.intents=options.intents&discord_js_1.Intents.FLAGS.GUILDS;}elseif(typeofoptions.intents==="string"){// this probably shouldn't be used, but maybe the user// needs a specific intent other than GUILDS? just leave// it befinalOptions.intents=options.intents;}deleteoptions.token;// <-- HERE token is erroneously deletedreturnfinalOptions;}
The text was updated successfully, but these errors were encountered:
Probably no reason to delete the token property. The object is only passed to the underlying discord.js client constructor which will do nothing with it.
Describe the bug
Attempting to set the bot token via the token property in the client options results in the token being unable to be loaded. This is caused because the token property is removed from the options object before it can be read by the token loading code.
The text was updated successfully, but these errors were encountered: