extract member prop early

This commit is contained in:
Baipyrus 2024-02-28 20:51:59 +01:00
parent 73562b3570
commit fa6a9fa2e3

View File

@ -81,7 +81,7 @@ export const name = Events.VoiceStateUpdate;
* @param {VoiceState} newState * @param {VoiceState} newState
*/ */
export async function execute(oldState, newState) { export async function execute(oldState, newState) {
const { channel } = newState; const { channel, member } = newState;
let step = 'delete'; let step = 'delete';
try { try {
await leftVoiceChat(oldState); await leftVoiceChat(oldState);
@ -96,9 +96,6 @@ export async function execute(oldState, newState) {
}); });
if (createCh === null) return; if (createCh === null) return;
// Extract user data
const member = newState.member;
step = 'create'; step = 'create';
// Extract channel data // Extract channel data
const channels = newState.guild.channels; const channels = newState.guild.channels;