New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
voice_state_update issue #902
Comments
This is not an issue, it's intentional. Based on whether you have the If your code compiles and works with the four parameters, then don't mind this warning. It's likely your IDE is unable to recognize the feature flag and apply it.
Would you mind clarifying? Do you mean how many users are in a voice channel? |
Yep. I just need to check how many users connected to voice channel when one of them left. I can get channel object, but it has not .users or .user_count() or something like that. |
There isn't a dedicated function for this task, but you can implement one yourself. The library keeps track of all voice states in a guild. You can filter these based on the channel of your interest to get the amount of users in the channel. fn user_count(guild: &Guild, channel_id: ChannelId) -> usize {
guild
.voice_states
.values()
.filter(|state| {
match state.channel_id {
Some(c) => c == channel_id,
None => false,
}
})
.count()
} |
Ok, thanks! |
Good day!
I found an issue with "voice_state_update". It needs 4 arguments (and it works ok with them), but I can see those warnings:
Also i cant find where i can get voice chat user counter.
plz help me.
And sorry my english, im just stupid.
The text was updated successfully, but these errors were encountered: