3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-19 07:20:00 +00:00
zeppelin/backend/src/plugins/LocateUser/utils/fillAlertsList.ts

13 lines
432 B
TypeScript
Raw Normal View History

import { GuildPluginData } from "knub";
import { LocateUserPluginType } from "../types";
export async function fillActiveAlertsList(pluginData: GuildPluginData<LocateUserPluginType>) {
const allAlerts = await pluginData.state.alerts.getAllGuildAlerts();
allAlerts.forEach(alert => {
if (!pluginData.state.usersWithAlerts.includes(alert.user_id)) {
pluginData.state.usersWithAlerts.push(alert.user_id);
}
});
}