mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
10 lines
398 B
TypeScript
10 lines
398 B
TypeScript
import { GuildPluginData } from "knub";
|
|
import { AutomodPluginType } from "../types";
|
|
import { RECENT_SPAM_EXPIRY_TIME } from "../constants";
|
|
|
|
export function clearOldRecentSpam(pluginData: GuildPluginData<AutomodPluginType>) {
|
|
const now = Date.now();
|
|
pluginData.state.recentSpam = pluginData.state.recentSpam.filter(spam => {
|
|
return spam.timestamp + RECENT_SPAM_EXPIRY_TIME > now;
|
|
});
|
|
}
|