Automod actions + ModActions public interface
This commit is contained in:
parent
0f0728bc1c
commit
86023877a2
22 changed files with 508 additions and 16 deletions
|
@ -0,0 +1,12 @@
|
|||
import { PluginData } from "knub";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { RECENT_NICKNAME_CHANGE_EXPIRY_TIME, RECENT_SPAM_EXPIRY_TIME } from "../constants";
|
||||
|
||||
export function clearOldRecentNicknameChanges(pluginData: PluginData<AutomodPluginType>) {
|
||||
const now = Date.now();
|
||||
for (const [userId, { timestamp }] of pluginData.state.recentNicknameChanges) {
|
||||
if (timestamp + RECENT_NICKNAME_CHANGE_EXPIRY_TIME <= now) {
|
||||
pluginData.state.recentNicknameChanges.delete(userId);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue