This commit is contained in:
Benjamin Sherriff
2023-12-10 11:28:43 -05:00
parent c825c73eb4
commit b474866e7e
11 changed files with 186 additions and 129 deletions

View File

@@ -94,7 +94,7 @@ pub async fn play_track(manager: Arc<Songbird>, guild_id: GuildId, track_url: St
call_handler.queue().is_empty()
};
let guild = QueryGuild::get(guild_id.0 as i64)?;
match add_song(handler_lock.clone(), &track_url, is_queue_empty, Some(guild.volume as f32)).await {
match add_song(handler_lock.clone(), &track_url, is_queue_empty, Some(guild.volume as f32 / 100.0)).await {
Ok(added_song) => {
let track_title = added_song.title.unwrap();
debug!("Added track: {}", track_title);

View File

View File

View File

@@ -98,16 +98,16 @@ async fn main() -> std::io::Result<()> {
let shard_manager = Arc::clone(&client.shard_manager);
// tokio::spawn(async move {
// tokio::signal::ctrl_c().await.expect("Could not register ctrl+c handler");
// shard_manager.lock().await.shutdown_all().await;
// });
tokio::spawn(async move {
tokio::signal::ctrl_c().await.expect("Could not register ctrl+c handler");
shard_manager.lock().await.shutdown_all().await;
});
// tokio::spawn(async move {
// if let Err(why) = client.start_autosharded().await {
// error!("An error occurred while running the client: {:?}", why);
// }
// });
tokio::spawn(async move {
if let Err(why) = client.start_autosharded().await {
error!("An error occurred while running the client: {:?}", why);
}
});
let host = env::var("SERVICE_HOST").unwrap_or("localhost".to_string());
let port = env::var("SERVICE_PORT").unwrap_or("5000".to_string());