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