Small fix
This commit is contained in:
parent
8055cbb78f
commit
f53b4efee0
|
@ -98,9 +98,10 @@ async fn leave(ctx: &Context, msg: &Message) -> CommandResult {
|
|||
.cloned()
|
||||
.expect("Expected VoiceManager in TypeMap.");
|
||||
let mut manager = manager_lock.lock().await;
|
||||
let has_handler = manager.get(guild_id).is_some();
|
||||
|
||||
if has_handler {
|
||||
|
||||
if let Some(handler) = manager.get_mut(guild_id) {
|
||||
handler.stop();
|
||||
manager.remove(guild_id);
|
||||
|
||||
check_msg(msg.channel_id.say(&ctx.http, "Left voice channel").await);
|
||||
|
|
|
@ -3,11 +3,13 @@ use crate::commands::{
|
|||
roulette::{BulletsContainer, ROULETTE_GROUP},
|
||||
};
|
||||
use async_trait::async_trait;
|
||||
use serde_json::Value;
|
||||
use serenity::{
|
||||
framework::standard::{
|
||||
help_commands,
|
||||
macros::{help, hook},
|
||||
Args, CommandGroup, CommandResult, DispatchError, HelpOptions, StandardFramework, CommandError,
|
||||
Args, CommandError, CommandGroup, CommandResult, DispatchError, HelpOptions,
|
||||
StandardFramework,
|
||||
},
|
||||
http::Http,
|
||||
model::prelude::*,
|
||||
|
@ -21,7 +23,6 @@ use std::{
|
|||
time::Duration,
|
||||
};
|
||||
use tokio::{fs::File, io::AsyncWriteExt};
|
||||
use serde_json::Value;
|
||||
|
||||
#[cfg(feature = "music")]
|
||||
use crate::commands::music::{VoiceManager, MUSIC_GROUP};
|
||||
|
|
Loading…
Reference in New Issue