3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Upgrade DJS, fix bugs

This commit is contained in:
Dark 2021-06-30 18:43:42 +02:00
parent 0822fc15e5
commit be71357ff9
No known key found for this signature in database
GPG key ID: 384C4B4F5B1E25A8
17 changed files with 123 additions and 66 deletions

View file

@ -1,4 +1,4 @@
import { VoiceChannel } from "discord.js";
import { Snowflake, VoiceChannel } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { LogType } from "../../../data/LogType";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
@ -21,7 +21,7 @@ export const VcmoveCmd = utilityCmd({
if (isSnowflake(args.channel)) {
// Snowflake -> resolve channel directly
const potentialChannel = pluginData.guild.channels.cache.get(args.channel);
const potentialChannel = pluginData.guild.channels.cache.get(args.channel as Snowflake);
if (!potentialChannel || !(potentialChannel instanceof VoiceChannel)) {
sendErrorMessage(pluginData, msg.channel, "Unknown or non-voice channel");
return;
@ -31,7 +31,7 @@ export const VcmoveCmd = utilityCmd({
} else if (channelMentionRegex.test(args.channel)) {
// Channel mention -> parse channel id and resolve channel from that
const channelId = args.channel.match(channelMentionRegex)![1];
const potentialChannel = pluginData.guild.channels.cache.get(channelId);
const potentialChannel = pluginData.guild.channels.cache.get(channelId as Snowflake);
if (!potentialChannel || !(potentialChannel instanceof VoiceChannel)) {
sendErrorMessage(pluginData, msg.channel, "Unknown or non-voice channel");
return;
@ -104,7 +104,7 @@ export const VcmoveAllCmd = utilityCmd({
if (isSnowflake(args.channel)) {
// Snowflake -> resolve channel directly
const potentialChannel = pluginData.guild.channels.cache.get(args.channel);
const potentialChannel = pluginData.guild.channels.cache.get(args.channel as Snowflake);
if (!potentialChannel || !(potentialChannel instanceof VoiceChannel)) {
sendErrorMessage(pluginData, msg.channel, "Unknown or non-voice channel");
return;
@ -114,7 +114,7 @@ export const VcmoveAllCmd = utilityCmd({
} else if (channelMentionRegex.test(args.channel)) {
// Channel mention -> parse channel id and resolve channel from that
const channelId = args.channel.match(channelMentionRegex)![1];
const potentialChannel = pluginData.guild.channels.cache.get(channelId);
const potentialChannel = pluginData.guild.channels.cache.get(channelId as Snowflake);
if (!potentialChannel || !(potentialChannel instanceof VoiceChannel)) {
sendErrorMessage(pluginData, msg.channel, "Unknown or non-voice channel");
return;