fix: connect error lines

This commit is contained in:
Ladislav Hano 2025-01-31 23:26:04 +01:00
parent 723bd32335
commit 172fb8b8a5

View file

@ -3,11 +3,10 @@ use std::sync::Arc;
use serenity::all::{ChannelId, GuildId};
use serenity::async_trait;
use serenity::model::voice;
use songbird::events::{Event, EventContext, EventHandler as VoiceEventHandler};
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";
@ -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> {
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 {
return Err("dadsa".to_string())
return Err("Guild id not found".to_string())
};
let voice_channel = get_voice_channel(&ctx, channel).await?;