zappyzep/backend/src/plugins/LocateUser/utils/clearExpiredAlert.ts
2024-04-09 20:57:18 +03:00

9 lines
462 B
TypeScript

import { GuildPluginData } from "knub";
import { VCAlert } from "../../../data/entities/VCAlert.js";
import { LocateUserPluginType } from "../types.js";
import { removeUserIdFromActiveAlerts } from "./removeUserIdFromActiveAlerts.js";
export async function clearExpiredAlert(pluginData: GuildPluginData<LocateUserPluginType>, alert: VCAlert) {
await pluginData.state.alerts.delete(alert.id);
await removeUserIdFromActiveAlerts(pluginData, alert.user_id);
}