From 309286b5289bda508953706ac44282cd57e27e05 Mon Sep 17 00:00:00 2001 From: benji7425 Date: Mon, 22 Jan 2018 23:41:14 +0000 Subject: [PATCH] Disable a few unused websocket events Hopefully will improve memory usage somewhat --- discord-bot-core/Client.js | 3 ++- discord-bot-core/internal-config.json | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/discord-bot-core/Client.js b/discord-bot-core/Client.js index 9b39fbe..573e1d6 100644 --- a/discord-bot-core/Client.js +++ b/discord-bot-core/Client.js @@ -18,7 +18,8 @@ module.exports = class Client extends Discord.Client { */ constructor(token, commandsDir, guildDataModel) { super({ - messageCacheMaxSize: 16 + messageCacheMaxSize: 16, + disabledEvents: InternalConfig.disabledEvents }); this._token = token; diff --git a/discord-bot-core/internal-config.json b/discord-bot-core/internal-config.json index 5d25d53..a99ca98 100644 --- a/discord-bot-core/internal-config.json +++ b/discord-bot-core/internal-config.json @@ -8,5 +8,14 @@ "[ws] [connection] Sending a heartbeat", "[ws] [connection] Heartbeat acknowledged" ], + "disabledEvents": [ + "CHANNEL_PINS_UPDATE", + "GUILD_BAN_ADD", + "GUILD_BAN_REMOVE", + "PRESENCE_UPDATE", + "TYPING_START", + "USER_NOTE_UPDATE", + "USER_SETTINGS_UPDATE" + ], "askTimeout": 60000 } \ No newline at end of file