3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

remove channels config from join/leave vc

This commit is contained in:
almeidx 2021-11-14 14:47:43 +00:00
parent c19ca674d8
commit 3acb089f47
No known key found for this signature in database
GPG key ID: C5FF0C40763546C5
2 changed files with 4 additions and 14 deletions

View file

@ -1,5 +1,6 @@
import * as t from "io-ts";
import { ChannelTypeStrings } from "../../../types";
import { tNullable } from "../../../utils";
import { automodTrigger } from "../helpers";
interface JoinVoiceChannelResult {
@ -8,8 +9,7 @@ interface JoinVoiceChannelResult {
export const JoinVoiceChannelTrigger = automodTrigger<JoinVoiceChannelResult>()({
configType: t.type({
channels: t.union([t.string, t.array(t.string)]),
include_moves: t.boolean,
include_moves: tNullable(t.boolean),
}),
defaultConfig: {
@ -25,11 +25,6 @@ export const JoinVoiceChannelTrigger = automodTrigger<JoinVoiceChannelResult>()(
return;
}
const triggerChannels = Array.isArray(triggerConfig.channels) ? triggerConfig.channels : [triggerConfig.channels];
if (!triggerChannels.includes(matchedChannelId)) {
return;
}
return {
extra: {
matchedChannelId,

View file

@ -1,5 +1,6 @@
import * as t from "io-ts";
import { ChannelTypeStrings } from "../../../types";
import { tNullable } from "../../../utils";
import { automodTrigger } from "../helpers";
interface LeaveVoiceChannelResult {
@ -8,8 +9,7 @@ interface LeaveVoiceChannelResult {
export const LeaveVoiceChannelTrigger = automodTrigger<LeaveVoiceChannelResult>()({
configType: t.type({
channels: t.union([t.string, t.array(t.string)]),
include_moves: t.boolean,
include_moves: tNullable(t.boolean),
}),
defaultConfig: {
@ -25,11 +25,6 @@ export const LeaveVoiceChannelTrigger = automodTrigger<LeaveVoiceChannelResult>(
return;
}
const triggerChannels = Array.isArray(triggerConfig.channels) ? triggerConfig.channels : [triggerConfig.channels];
if (!triggerChannels.includes(matchedChannelId)) {
return;
}
return {
extra: {
matchedChannelId,