fix: connect error lines
This commit is contained in:
parent
723bd32335
commit
172fb8b8a5
1 changed files with 3 additions and 4 deletions
|
@ -3,11 +3,10 @@ use std::sync::Arc;
|
||||||
use serenity::all::{ChannelId, GuildId};
|
use serenity::all::{ChannelId, GuildId};
|
||||||
use serenity::async_trait;
|
use serenity::async_trait;
|
||||||
|
|
||||||
use serenity::model::voice;
|
|
||||||
use songbird::events::{Event, EventContext, EventHandler as VoiceEventHandler};
|
use songbird::events::{Event, EventContext, EventHandler as VoiceEventHandler};
|
||||||
use songbird::{Songbird, TrackEvent};
|
use songbird::{Songbird, TrackEvent};
|
||||||
|
|
||||||
use crate::{types::{Context, Error}, utils::utilities::get_channel_by_name};
|
use crate::{types::Context, utils::utilities::get_channel_by_name};
|
||||||
|
|
||||||
pub const MAX_ENTRIES: &str = "15";
|
pub const MAX_ENTRIES: &str = "15";
|
||||||
|
|
||||||
|
@ -54,11 +53,11 @@ impl VoiceEventHandler for TrackErrorNotifier {
|
||||||
|
|
||||||
pub async fn connect(ctx: &Context<'_>, channel: Option<String>, events: Vec<TrackEvent>) -> Result<(Arc<Songbird>, GuildId), String> {
|
pub async fn connect(ctx: &Context<'_>, channel: Option<String>, events: Vec<TrackEvent>) -> Result<(Arc<Songbird>, GuildId), String> {
|
||||||
if ctx.guild().is_none() {
|
if ctx.guild().is_none() {
|
||||||
return Err("dadsa".to_string())
|
return Err("This command can be used only in guild".to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
let Some(guild_id) = ctx.guild_id() else {
|
let Some(guild_id) = ctx.guild_id() else {
|
||||||
return Err("dadsa".to_string())
|
return Err("Guild id not found".to_string())
|
||||||
};
|
};
|
||||||
|
|
||||||
let voice_channel = get_voice_channel(&ctx, channel).await?;
|
let voice_channel = get_voice_channel(&ctx, channel).await?;
|
||||||
|
|
Loading…
Reference in a new issue