Skip to content

Commit

Permalink
Merge branch 'main' of github.com:LetUsFlow/Rusty-BruhBot into main
Browse files Browse the repository at this point in the history
  • Loading branch information
LetUsFlow committed Feb 14, 2023
2 parents 6231931 + c4a5b6b commit 114c395
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ edition = "2021"
[dependencies]
dotenvy = "0.15"
serde = "1.0"
songbird = "0.3"
async-recursion = "1.0"
once_cell = "1.17"
tracing = "0.1"
tracing-subscriber = "0.3"

serenity = { version = "0.11", features = ["client", "standard_framework", "voice", "rustls_backend"] }
songbird = { version = "0.3", features = ["yt-dlp"]}
tokio = { version = "1.25", features = ["macros", "rt-multi-thread", "signal"] }
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "json"] }
16 changes: 8 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use serenity::model::prelude::{GuildId, Member, Message};
use serenity::prelude::*;
use songbird::tracks::TrackHandle;
use songbird::{create_player, Call, Event, EventContext, SerenityInit, TrackEvent};
use tracing::{error, warn};
use tracing::{error, warn, info};

mod command_manager;

Expand All @@ -41,19 +41,19 @@ impl EventHandler for Handler {
}),
Some(author),
) => {
play_sound(&ctx, &author, sound.as_str().unwrap_or("").to_string())
play_sound(&ctx, &author, sound.as_str().unwrap_or("").into())
.await;

":sunglasses:".to_string()
":sunglasses:".into()
}
(_, None) => {
"You shouldn't be here, I shouldn't be here, we both know it..."
.to_string()
.into()
}
_ => command_manager::list_commands().await,
}
},
_ => "i donbt know dis command uwu :(".to_string(),
_ => "i donbt know dis command uwu :(".into(),
};

if let Err(why) = command
Expand Down Expand Up @@ -87,7 +87,7 @@ impl EventHandler for Handler {
}

async fn ready(&self, ctx: Context, ready: Ready) {
println!("{} is connected!", ready.user.name);
info!("{} is connected!", ready.user.name);

Command::set_global_application_commands(&ctx.http, |commands| {
commands
Expand Down Expand Up @@ -148,7 +148,7 @@ async fn play_sound(ctx: &Context, author: &Member, sound: String) -> bool {
}

// Cretae audio source
let source = match songbird::ytdl(sound_uri).await {
let source = match songbird::ffmpeg(sound_uri).await {
Ok(source) => source,
Err(err) => {
warn!("Err starting source: {err:?}");
Expand Down Expand Up @@ -250,7 +250,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
}

tokio::signal::ctrl_c().await.ok();
println!("Received Ctrl-C, shutting down.");
info!("Received Ctrl-C, shutting down.");

Ok(())
}

0 comments on commit 114c395

Please sign in to comment.