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:
parent
d09d6b776a
commit
121628e6b1
5 changed files with 30 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue