3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-14 22:05:01 +00:00

channel typings

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
metal 2023-03-11 12:43:04 +00:00 committed by GitHub
parent c33a216857
commit 8347095fa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 91 additions and 103 deletions

View file

@ -1,4 +1,4 @@
import { Snowflake, VoiceChannel } from "discord.js";
import { ChannelType, Snowflake, VoiceChannel } from "discord.js";
import {
channelToTemplateSafeChannel,
memberToTemplateSafeMember,
@ -9,7 +9,6 @@ import { LogType } from "../../../data/LogType";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { channelMentionRegex, isSnowflake, simpleClosestStringMatch } from "../../../utils";
import { utilityCmd } from "../types";
import { ChannelTypeStrings } from "../../../types";
import { LogsPlugin } from "../../Logs/LogsPlugin";
export const VcmoveCmd = utilityCmd({
@ -48,7 +47,7 @@ export const VcmoveCmd = utilityCmd({
} else {
// Search string -> find closest matching voice channel name
const voiceChannels = [...pluginData.guild.channels.cache.values()].filter(
(c): c is VoiceChannel => c.type === ChannelTypeStrings.VOICE,
(c): c is VoiceChannel => c.type === ChannelType.GuildVoice,
);
const closestMatch = simpleClosestStringMatch(args.channel, voiceChannels, (ch) => ch.name);
if (!closestMatch) {
@ -127,7 +126,7 @@ export const VcmoveAllCmd = utilityCmd({
} else {
// Search string -> find closest matching voice channel name
const voiceChannels = [...pluginData.guild.channels.cache.values()].filter(
(c): c is VoiceChannel => c.type === ChannelTypeStrings.VOICE,
(c): c is VoiceChannel => c.type === ChannelType.GuildVoice,
);
const closestMatch = simpleClosestStringMatch(args.channel, voiceChannels, (ch) => ch.name);
if (!closestMatch) {