3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-11 12:55:01 +00:00

perf: use a memory cache for Slowmode

This commit is contained in:
Dragory 2021-11-02 23:38:02 +02:00
parent d09d6b776a
commit 121628e6b1
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
5 changed files with 30 additions and 4 deletions

View file

@ -144,7 +144,12 @@ export const SlowmodeSetCmd = slowmodeCmd({
});
}
// Set bot-maintained slowmode
await pluginData.state.slowmodes.setChannelSlowmode(channel.id, rateLimitSeconds);
// Update cache
const slowmode = await pluginData.state.slowmodes.getChannelSlowmode(channel.id);
await pluginData.state.channelSlowmodeCache.set(channel.id, slowmode ?? null);
}
const humanizedSlowmodeTime = humanizeDuration(args.time);