mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-12 05:27:19 +00:00
Migrate LocateUser to new Plugin structure
This commit is contained in:
parent
ef1b993d58
commit
7b191093b3
16 changed files with 380 additions and 0 deletions
22
backend/src/plugins/LocateUser/events/ChannelJoinEvt.ts
Normal file
22
backend/src/plugins/LocateUser/events/ChannelJoinEvt.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
import { locateUserEvent } from "../types";
|
||||
import { sendAlerts } from "../utils/sendAlerts";
|
||||
|
||||
export const ChannelJoinEvt = locateUserEvent({
|
||||
event: "voiceChannelJoin",
|
||||
|
||||
async listener(meta) {
|
||||
if (meta.pluginData.state.usersWithAlerts.includes(meta.args.member.id)) {
|
||||
sendAlerts(meta.pluginData, meta.args.member.id);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
export const ChannelSwitchEvt = locateUserEvent({
|
||||
event: "voiceChannelSwitch",
|
||||
|
||||
async listener(meta) {
|
||||
if (meta.pluginData.state.usersWithAlerts.includes(meta.args.member.id)) {
|
||||
sendAlerts(meta.pluginData, meta.args.member.id);
|
||||
}
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue