catch channel delete error

This commit is contained in:
Baipyrus 2024-02-24 18:46:46 +01:00
parent ab6ca9edeb
commit e74bd83ee6

View File

@ -102,6 +102,8 @@ export const name = Events.VoiceStateUpdate;
*/ */
export async function execute(oldState, newState) { export async function execute(oldState, newState) {
const { channel } = newState; const { channel } = newState;
let step = 'delete';
try {
await leftVoiceChat(oldState); await leftVoiceChat(oldState);
if (!channel) return; if (!channel) return;
@ -117,10 +119,9 @@ export async function execute(oldState, newState) {
// Extract user data // Extract user data
const member = newState.member; const member = newState.member;
step = 'create';
// Extract channel data // Extract channel data
const channels = newState.guild.channels; const channels = newState.guild.channels;
let step = 'create';
try {
const privCh = await getChannel(member, channels, channel); const privCh = await getChannel(member, channels, channel);
step = 'move to'; step = 'move to';