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

Finish preliminary rework, ready to test

This commit is contained in:
Dark 2021-06-02 04:07:50 +02:00
parent 57893e7f76
commit d0a1beb809
No known key found for this signature in database
GPG key ID: 2CD6ACB6B0A87B8A
177 changed files with 854 additions and 707 deletions

View file

@ -10,7 +10,7 @@ import {
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { LogType } from "../../../data/LogType";
import { resolveChannel } from "knub/dist/helpers";
import { VoiceChannel } from "discord.js";
export const VcdisconnectCmd = utilityCmd({
trigger: ["vcdisconnect", "vcdisc", "vcdc", "vckick", "vck"],
@ -28,16 +28,14 @@ export const VcdisconnectCmd = utilityCmd({
return;
}
if (!args.member.voiceState || !args.member.voiceState.channelID) {
if (!args.member.voice || !args.member.voice.channelID) {
sendErrorMessage(pluginData, msg.channel, "Member is not in a voice channel");
return;
}
const channel = (await resolveChannel(pluginData.guild, args.member.voiceState.channelID)) as VoiceChannel;
const channel = pluginData.guild.channels.cache.get(args.member.voice.channelID) as VoiceChannel;
try {
await args.member.edit({
channelID: null,
});
await args.member.voice.kick();
} catch {
sendErrorMessage(pluginData, msg.channel, "Failed to disconnect member");
return;