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