Keymax
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
I don't know, but the first option didn't work for me
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
<a:sweetpiano_happy:1051864341835698276>
I finally understood the incorrectly described import of events,
old
that's how it should be
new
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
Use arrays in both cases.
You can pass single arguments as an array with one element. This ensures consistency but might require additional handling inside the function.
Inside eventFunction, you would handle the arguments as an array:
Check the type of arg before calling.
If arg is an array, you can use the spread syntax; otherwise, pass it as is.
Modify the structure of eventFunction to always accept an array.
This way, you won't have to worry about the number of arguments you're passing.
Depending on your specific scenario, one of these options might be more preferable. Choose the one that best fits your requirements and coding style.
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
I didn't really understand, do I need to declare in this way?
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
Okay, I figured it out, because I tried to import this event as a separate file. However, if I prescribe directly from index.js works everything out fine
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
I just thought if I join a voice chat, then:
But for some reason these values are always the same
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
I specified the variables correctly:
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
Yes, I understand, but even if I output these values in the console, they are still always the same:
Mute and unmute:
Deaf and undeaf
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
I have the same value displayed in the console,
do I not understand something?
I want to check the current state of the user and compare it, but it gives the same thing. How do I understand what is happening to a person right now
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
💗
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
Thanks for the help, I really added to EventHandler.js 1 more argument for events and everything started to work stably. Thanks a lot ❤️
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
I'm not sure, but at least the first WORK output, which is declared at the very beginning of the code, works.
But the rest are gone
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
Just "giveUserXp.js" is working fine
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
Full project
https://replit.com/@keymax32/Shiza
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
46 replies
DIAdiscord.js - Imagine an app
•Created by Keymax on 10/16/2023 in #djs-questions
How to correctly make a VoiceState event using eventHandler
Here is my other MessageCreate event, it works fine
46 replies