How to check if user is talking
I know I should use the SpeakingMap from @discordjs/voice, but idk how to set it up to work.
23 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
[email protected], node v18.7.0
Well,
connection.receiver.speaking.users
returns the currently speaking users, mapped to the milliseconds since UNIX epoch at which they started speaking.and connection is getVoiceConnection(guildId) from @discordjs/voice, right?
yes
why is it returning undefined?
by it i mean connection
theres people inside vc talking on that guild
im in the vc talking now, why is it undefined... ):
i have GuildVoiceStates intent
because thats not how you make a voice connection?
how to make a voice connection then
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});
so i can only check if bot is in voice channel?
well yes
obviously
is there a way to check for without the bot being in a voice channel? i want the bot to check for the voice activity in multiple channels and this way i think it wont be possible
no
some guy told me to use the SpeakingMap, would that work?
that is SpeakingMap
vaid, connection.receiver.speaking is a SpeakingMap...
the bot needs to be in the channel to receive voice data
heck it, then i guess i cant make anty vc afk
"anti vc afk" whats that supposed to be
basically i have a economy bot, and want to make it so you get money for talking in vc's, but i want to prevent people from just joining vc, muted and just there to farm money
why are you trying to implement a feature that discord already has?
once someone joins that channel -> disconnect them?
so this feature will disconnect users when they are not talking for a certain period of time?
nvm, i read the desc
so i could you setup a inactive channel and ignore it
thx @thehairy , you really helped me a lot