Use gateway intents, add extraIntents config option
parent
2beadbe924
commit
b30e615200
15
src/bot.js
15
src/bot.js
|
@ -1,8 +1,23 @@
|
|||
const Eris = require("eris");
|
||||
const config = require("./cfg");
|
||||
|
||||
const intents = [
|
||||
"directMessages", // For core functionality
|
||||
"guildMessages", // For bot commands and mentions
|
||||
"guilds", // For core functionality
|
||||
"guildVoiceStates", // For member information in the thread header
|
||||
"guildMessageTyping", // For typing indicators
|
||||
"directMessageTyping", // For typing indicators
|
||||
|
||||
...config.extraIntents, // Any extra intents added to the config
|
||||
];
|
||||
|
||||
const bot = new Eris.Client(config.token, {
|
||||
restMode: true,
|
||||
intents: Array.from(new Set(intents)),
|
||||
});
|
||||
|
||||
/**
|
||||
* @type {Eris.Client}
|
||||
*/
|
||||
module.exports = bot;
|
||||
|
|
|
@ -220,4 +220,7 @@ if (! configIsValid) {
|
|||
console.log("Configuration ok!");
|
||||
process.exit(0);
|
||||
|
||||
/**
|
||||
* @type {ModmailConfig}
|
||||
*/
|
||||
module.exports = config;
|
||||
|
|
|
@ -50,4 +50,5 @@
|
|||
* @property {string} [dbDir]
|
||||
* @property {object} [knex]
|
||||
* @property {string} [logDir]
|
||||
* @property {array} [extraIntents=[]]
|
||||
*/
|
||||
|
|
|
@ -262,6 +262,11 @@
|
|||
"logDir": {
|
||||
"type": "string",
|
||||
"deprecationMessage": "This option is no longer used"
|
||||
},
|
||||
|
||||
"extraIntents": {
|
||||
"$ref": "#/definitions/stringArray",
|
||||
"default": []
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
|
|
Loading…
Reference in New Issue