Fixed docker containers

This commit is contained in:
2024-10-13 20:22:34 -04:00
parent 1c6ed2cba4
commit 0bfc320379
12 changed files with 63 additions and 86 deletions

View File

@@ -3,7 +3,7 @@ use serenity::{
prelude::*,
};
use super::{create_response, edit_response, get_songbird, process_message};
use super::{edit_response, get_songbird, process_message};
pub async fn run(ctx: &Context, command: &CommandInteraction) {
// Create the initial response

View File

@@ -56,7 +56,7 @@ pub async fn run(ctx: &Context, command: &CommandInteraction) {
Ok(channel_id) => {
log::debug!("<{guild_id}> Play command executed on {channel_id} with track: {track_url:?}");
// Handle the track url
match enqueue_track(ctx, manager, guild_id.to_owned(), track_url, true).await {
match enqueue_track(ctx, manager, guild_id.to_owned(), track_url).await {
Ok(count) => {
let mut message = format!("Playing {} tracks", count);
if count == 0 {
@@ -84,7 +84,6 @@ pub async fn enqueue_track(
manager: Arc<Songbird>,
guild_id: GuildId,
track_url: &str,
play_now: bool,
) -> SirenResult<i32> {
let mut track_count = 0;
if let Some(handler_lock) = manager.get(guild_id) {
@@ -140,7 +139,6 @@ pub async fn enqueue_track(
}
};
let track_handle: TrackHandle;
let is_queue_empty = handler.queue().is_empty();
track_handle = handler.enqueue_input(input).await;
// Set the volume
let _ = track_handle.set_volume(volume);
@@ -156,8 +154,8 @@ pub async fn enqueue_track(
);
track_count += 1;
}
if play_now && !handler.queue().is_empty() {
handler.queue().resume();
if handler.queue().is_empty() {
let _ = handler.queue().resume();
}
}
Ok(track_count)

View File

@@ -3,7 +3,7 @@ use serenity::{
prelude::*,
};
use super::{create_response, edit_response, get_songbird, process_message};
use super::{edit_response, get_songbird, process_message};
pub async fn run(ctx: &Context, command: &CommandInteraction) {
// Create the initial response

View File

@@ -3,7 +3,7 @@ use serenity::{
prelude::*,
};
use super::{get_songbird, create_response, edit_response};
use super::{edit_response, get_songbird, process_message};
pub async fn run(ctx: &Context, command: &CommandInteraction) {
// Create the initial response

View File

@@ -3,7 +3,7 @@ use serenity::{
prelude::*,
};
use super::{get_songbird, create_response, edit_response};
use super::{edit_response, get_songbird, process_message};
pub async fn run(ctx: &Context, command: &CommandInteraction) {
// Create the initial response

View File

@@ -48,12 +48,7 @@ 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!("Setting the volume to {}", volume),
)
.await;
edit_response(&ctx, &command, format!("Setting the volume to {}", volume)).await;
}
pub async fn set_volume(manager: &Arc<Songbird>, guild_id: &GuildId, volume: i32) {

View File

@@ -1,4 +1,3 @@
use log::{warn, info, error};
use serenity::all::Interaction;
use serenity::async_trait;
use serenity::model::gateway::Ready;
@@ -36,7 +35,7 @@ impl EventHandler for Handler {
commands::chat::generate_response(&ctx, &msg, oai).await;
}
}
Err(why) => warn!("Could not check mentions: {:?}", why),
Err(why) => log::warn!("Could not check mentions: {:?}", why),
};
}
None => {}
@@ -71,8 +70,9 @@ impl EventHandler for Handler {
async fn ready(&self, ctx: Context, ready: Ready) {
if ready.guilds.is_empty() {
warn!("No ready guilds found");
log::warn!("No ready guilds found");
}
log::trace!("Handling {} guilds", ready.guilds.len());
for guild in ready.guilds {
// Check if guild exists in database
let guild_id = guild.id.get() as i64;
@@ -103,12 +103,12 @@ impl EventHandler for Handler {
)
.await;
match commands {
Ok(c) => info!(
Ok(c) => log::info!(
"Registered {} commands for guild {}",
c.len(),
guild.id.get()
),
Err(why) => error!(
Err(why) => log::error!(
"Could not register commands for guild {}: {:?}",
guild.id.get(),
why