lupus
lupus
DIAdiscord.js - Imagine an app
Created by lupus on 2/4/2023 in #djs-questions
Best practices with awaitInteraction
I have a menu that opens upon running a command where the user can choose different actions. Would the best practice be to make the bot listen for interactions on the message or just register the buttons as their own interaction(s)? Or is there a thumb rule with "if you need the context of the command, use awaitInteraction?
4 replies
DIAdiscord.js - Imagine an app
Created by lupus on 1/27/2023 in #djs-questions
Modal Listeners "stealing" Interactions from each other
I have the following problem: When a user executes an interaction, the bot shows a modal and then uses awaitModalSubmit() to await a response. However, if the user closes the modal (which won't give the bot anything) and then executes a different command which also shows a modal (and then listens for a response), the first listener will snatch the response of the user and continue execution while the second one throws the error InteractionAlreadyReplied (which is understandable, because the first listener stole it). I've tried making a check with the interaction's ID, but the initial interaction ID is different compared to the ModalSubmit interaction ID. Is there a way to prevent the listeners stealing each other's interactions?
8 replies
DIAdiscord.js - Imagine an app
Created by lupus on 9/11/2022 in #djs-voice
Play audio from URL (mp3 stream)
Hey, I'm currently using djs v14 and djs voice to create an Audio Player playing audio from a mp3 stream. Works fine in general. However, after several minutes of playing the audio the Audio Player switches to Idle/disconnects without any error. When I try reconnecting to the stream when it switches to the Idle state it works for another few minutes. Any ideas?
6 replies