cleanup messages
This commit is contained in:
@@ -3,11 +3,11 @@ use serenity::{
|
||||
prelude::*,
|
||||
};
|
||||
|
||||
use super::{get_songbird, create_response, edit_response};
|
||||
use super::{create_response, edit_response, get_songbird, process_message};
|
||||
|
||||
pub async fn run(ctx: &Context, command: &CommandInteraction) {
|
||||
// Create the initial response
|
||||
create_response(&ctx, &command, format!(".....")).await;
|
||||
process_message(&ctx, &command).await;
|
||||
|
||||
// Get the songbird manager
|
||||
let manager = get_songbird(ctx).await;
|
||||
|
||||
@@ -73,7 +73,7 @@ pub async fn run(ctx: &Context, command: &CommandInteraction) {
|
||||
};
|
||||
}
|
||||
Err(err) => {
|
||||
log::warn!("{}", err);
|
||||
log::warn!("<{guild_id}> Failed to join voice channel: {}", err);
|
||||
edit_response(&ctx, &command, format!("{}", err)).await;
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ pub async fn enqueue_track(
|
||||
let valid = is_valid_url(&track_url);
|
||||
// Check if the URL is valid
|
||||
if !valid.0 {
|
||||
log::warn!("Invalid track url: {}", track_url);
|
||||
log::warn!("<{guild_id}> Invalid track url: {}", track_url);
|
||||
return Err(SirenError::new(
|
||||
422,
|
||||
format!("Invalid track url: {}", track_url),
|
||||
@@ -105,7 +105,7 @@ pub async fn enqueue_track(
|
||||
playlist_items = match get_playlist_urls(&track_url) {
|
||||
Ok(items) => items,
|
||||
Err(err) => {
|
||||
log::warn!("Failed to get playlist urls: {}", err);
|
||||
log::warn!("<{guild_id}> Failed to get playlist urls: {}", err);
|
||||
return Err(SirenError::new(422, err.to_string()));
|
||||
}
|
||||
};
|
||||
@@ -134,7 +134,7 @@ pub async fn enqueue_track(
|
||||
let metadata = match input.aux_metadata().await {
|
||||
Ok(metadata) => metadata,
|
||||
Err(err) => {
|
||||
log::warn!("Failed to get metadata for track: {err}");
|
||||
log::warn!("<{guild_id}> Failed to get metadata for track: {err}");
|
||||
let _ = leave_voice_channel(&manager, &guild_id).await;
|
||||
return Err(SirenError::new(422, err.to_string()));
|
||||
}
|
||||
|
||||
@@ -3,11 +3,11 @@ use serenity::{
|
||||
prelude::*,
|
||||
};
|
||||
|
||||
use super::{get_songbird, create_response, edit_response};
|
||||
use super::{create_response, edit_response, get_songbird, process_message};
|
||||
|
||||
pub async fn run(ctx: &Context, command: &CommandInteraction) {
|
||||
// Create the initial response
|
||||
create_response(&ctx, &command, format!(".....")).await;
|
||||
process_message(&ctx, &command).await;
|
||||
|
||||
// Get the songbird manager
|
||||
let manager = get_songbird(ctx).await;
|
||||
|
||||
@@ -7,7 +7,7 @@ use super::{get_songbird, create_response, edit_response};
|
||||
|
||||
pub async fn run(ctx: &Context, command: &CommandInteraction) {
|
||||
// Create the initial response
|
||||
create_response(&ctx, &command, format!(".....")).await;
|
||||
process_message(&ctx, &command).await;
|
||||
|
||||
// Get the songbird manager
|
||||
let manager = get_songbird(ctx).await;
|
||||
|
||||
@@ -7,7 +7,7 @@ use super::{get_songbird, create_response, edit_response};
|
||||
|
||||
pub async fn run(ctx: &Context, command: &CommandInteraction) {
|
||||
// Create the initial response
|
||||
create_response(&ctx, &command, format!(".....")).await;
|
||||
process_message(&ctx, &command).await;
|
||||
|
||||
// Get the songbird manager
|
||||
let manager = get_songbird(ctx).await;
|
||||
|
||||
@@ -9,7 +9,7 @@ use songbird::Songbird;
|
||||
|
||||
use crate::data::guilds::GuildCache;
|
||||
|
||||
use super::{get_songbird, create_response, edit_response};
|
||||
use super::{create_response, edit_response, get_songbird, process_message};
|
||||
|
||||
pub async fn run(ctx: &Context, command: &CommandInteraction) {
|
||||
// Process the command options
|
||||
@@ -26,7 +26,7 @@ pub async fn run(ctx: &Context, command: &CommandInteraction) {
|
||||
};
|
||||
|
||||
// Create the initial response
|
||||
create_response(&ctx, &command, ".....".to_string()).await;
|
||||
process_message(&ctx, &command).await;
|
||||
|
||||
// Get the songbird manager
|
||||
let manager = get_songbird(ctx).await;
|
||||
@@ -47,10 +47,11 @@ pub async fn run(ctx: &Context, command: &CommandInteraction) {
|
||||
|
||||
// Set the volume
|
||||
set_volume(&manager, guild_id, volume).await;
|
||||
log::debug!("<{guild_id}> Setting the volume to {}", volume);
|
||||
edit_response(
|
||||
&ctx,
|
||||
&command,
|
||||
format!("<{guild_id}> Setting the volume to {}", volume),
|
||||
format!("Setting the volume to {}", volume),
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user