Explorar el Código

Do not count bot user when voting to skip

Frans Bergman hace 1 mes
padre
commit
1d1fa3b97c
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/audio/audio.rs

+ 1 - 1
src/audio/audio.rs

@@ -192,7 +192,7 @@ async fn skip(ctx: &Context, msg: &Message) -> CommandResult {
         let guild = msg.guild(&ctx.cache).ok_or("aaa".to_string())?;
         let state = guild.voice_states.get(&msg.author.id).ok_or("aaa")?;
         let channel = guild.channels.get(&state.channel_id.unwrap());
-        channel.unwrap().members(&ctx.cache).unwrap().len()
+        channel.unwrap().members(&ctx.cache).unwrap().len() - 1 // Do not count bot user
     };
 
     if let Err(why) = AudioState::vote_skip(audio_state, msg.author.clone(), total_users).await {