mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 14:38:49 +00:00
feat: Setup caching in discord.js client for optimization
This commit is contained in:
1 parent
12d9234271
commit
623502c48a
1 file changed
+23
-1
+23
-1
@@ -8,7 +8,29 @@ require('dotenv').config();
|
||||
|
||||
// Setup required permissions for the bot to work
|
||||
const client = new Discord.Client({
|
||||
intents: [Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildVoiceStates]
|
||||
intents: [Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildVoiceStates],
|
||||
makeCache: Discord.Options.cacheWithLimits({
|
||||
...Discord.Options.DefaultMakeCacheSettings,
|
||||
MessageManager: 25,
|
||||
ThreadManager: 25,
|
||||
PresenceManager: 0,
|
||||
ReactionManager: 0,
|
||||
GuildMemberManager: {
|
||||
maxSize: 50,
|
||||
keepOverLimit: (member) => member.id === client.user.id
|
||||
}
|
||||
}),
|
||||
sweepers: {
|
||||
...Discord.Options.DefaultSweeperSettings,
|
||||
messages: {
|
||||
interval: 3600,
|
||||
lifetime: 1800
|
||||
},
|
||||
users: {
|
||||
interval: 3600,
|
||||
filter: () => (user) => user.id !== client.user.id
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const player = new Player(client, {
|
||||
|
||||
Reference in new issue
Block a user