mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
upgrade discord.js
This commit is contained in:
parent
036d46f08a
commit
3537305c59
32 changed files with 232 additions and 107 deletions
|
@ -9,6 +9,7 @@ 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";
|
||||
|
||||
export const VcmoveCmd = utilityCmd({
|
||||
trigger: "vcmove",
|
||||
|
@ -45,9 +46,11 @@ export const VcmoveCmd = utilityCmd({
|
|||
channel = potentialChannel;
|
||||
} else {
|
||||
// Search string -> find closest matching voice channel name
|
||||
const voiceChannels = pluginData.guild.channels.cache.array().filter(theChannel => {
|
||||
return theChannel instanceof VoiceChannel;
|
||||
}) as VoiceChannel[];
|
||||
const voiceChannels = [
|
||||
...pluginData.guild.channels.cache
|
||||
.filter((c): c is VoiceChannel => c.type === ChannelTypeStrings.VOICE)
|
||||
.values(),
|
||||
];
|
||||
const closestMatch = simpleClosestStringMatch(args.channel, voiceChannels, ch => ch.name);
|
||||
if (!closestMatch) {
|
||||
sendErrorMessage(pluginData, msg.channel, "No matching voice channels");
|
||||
|
@ -124,9 +127,11 @@ export const VcmoveAllCmd = utilityCmd({
|
|||
channel = potentialChannel;
|
||||
} else {
|
||||
// Search string -> find closest matching voice channel name
|
||||
const voiceChannels = pluginData.guild.channels.cache.array().filter(theChannel => {
|
||||
return theChannel instanceof VoiceChannel;
|
||||
}) as VoiceChannel[];
|
||||
const voiceChannels = [
|
||||
...pluginData.guild.channels.cache
|
||||
.filter((c): c is VoiceChannel => c.type === ChannelTypeStrings.VOICE)
|
||||
.values(),
|
||||
];
|
||||
const closestMatch = simpleClosestStringMatch(args.channel, voiceChannels, ch => ch.name);
|
||||
if (!closestMatch) {
|
||||
sendErrorMessage(pluginData, msg.channel, "No matching voice channels");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue