mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 13:51:51 +00:00
merged all events into one file
This commit is contained in:
parent
0f4f7b446d
commit
d74afbee5c
1 changed files with 58 additions and 0 deletions
|
@ -0,0 +1,58 @@
|
|||
import { guildEventListener } from "knub";
|
||||
import { AutomodContext, AutomodPluginType } from "../types";
|
||||
import { runAutomod } from "../functions/runAutomod";
|
||||
|
||||
export const RunAutomodOnVoiceJoin = guildEventListener<AutomodPluginType>()(
|
||||
"voiceChannelJoin",
|
||||
({ pluginData, args: { member, newChannel } }) => {
|
||||
const context: AutomodContext = {
|
||||
member,
|
||||
timestamp: Date.now(),
|
||||
voiceChannel: {
|
||||
joined: newChannel,
|
||||
},
|
||||
user: member.user,
|
||||
};
|
||||
|
||||
pluginData.state.queue.add(() => {
|
||||
runAutomod(pluginData, context);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
export const RunAutomodOnVoiceLeave = guildEventListener<AutomodPluginType>()(
|
||||
"voiceChannelLeave",
|
||||
({ pluginData, args: { member, oldChannel } }) => {
|
||||
const context: AutomodContext = {
|
||||
member,
|
||||
timestamp: Date.now(),
|
||||
voiceChannel: {
|
||||
left: oldChannel,
|
||||
},
|
||||
user: member.user,
|
||||
};
|
||||
|
||||
pluginData.state.queue.add(() => {
|
||||
runAutomod(pluginData, context);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
export const RunAutomodOnVoiceSwitch = guildEventListener<AutomodPluginType>()(
|
||||
"voiceChannelSwitch",
|
||||
({ pluginData, args: { member, oldChannel, newChannel } }) => {
|
||||
const context: AutomodContext = {
|
||||
member,
|
||||
timestamp: Date.now(),
|
||||
voiceChannel: {
|
||||
left: oldChannel,
|
||||
joined: newChannel,
|
||||
},
|
||||
user: member.user,
|
||||
};
|
||||
|
||||
pluginData.state.queue.add(() => {
|
||||
runAutomod(pluginData, context);
|
||||
});
|
||||
},
|
||||
);
|
Loading…
Add table
Reference in a new issue