From 1342253a7675cddebed6e339b4f9d73246de7d46 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Wed, 1 Mar 2023 22:29:07 -0500 Subject: [PATCH 01/47] [WIP] Rewrite with Poise Still some missing commands --- Cargo.toml | 27 ++-- src/commands.rs | 398 +++++++++++------------------------------------- src/main.rs | 267 ++++++++------------------------ 3 files changed, 166 insertions(+), 526 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 86760d8..52dbf78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,23 +1,20 @@ [package] -name = "dj-kitty-cat" -version = "0.1.0" -authors = ["my name "] -edition = "2018" +name = "dj_kitty_cat" +version = "0.2.0" +edition = "2021" [dependencies] -tracing = "0.1" -tracing-subscriber = "0.2" -tracing-futures = "0.2" +anyhow = "1.0.69" +parking_lot = "0.12.1" +poise = "0.5.2" +tracing = "0.1.37" +tracing-subscriber = "0.3.16" +tracing-futures = "0.2.5" [dependencies.songbird] -version = "0.2" -features = ["builtin-queue"] - -[dependencies.serenity] -version = "0.10" -default-features = false -features = ["cache", "client", "gateway", "model", "voice", "rustls_backend", "unstable_discord_api"] +version = "0.3.0" +features = ["yt-dlp"] [dependencies.tokio] -version = "1.0" +version = "1.26.0" features = ["macros", "rt-multi-thread", "signal"] diff --git a/src/commands.rs b/src/commands.rs index f960ac9..f9356fa 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1,326 +1,110 @@ -use serenity::client::Context; - -use serenity::model::interactions::application_command::{ - ApplicationCommandInteraction, ApplicationCommandInteractionDataOptionValue, -}; -use serenity::utils::{EmbedMessageBuilding, MessageBuilder}; +use anyhow::{Context, Result}; +use poise::serenity_prelude::{EmbedMessageBuilding, MessageBuilder}; use songbird::create_player; -use songbird::input::Input; +use tracing::debug; -use crate::{CurrentVolume, CurrentlyPlayingTrack}; +use crate::{CommandContext, Error}; -pub async fn join(ctx: &Context, command: &ApplicationCommandInteraction) -> String { - let guild_id = command.guild_id.unwrap(); - let guild = guild_id.to_guild_cached(&ctx.cache).await.unwrap(); - - let channel_id = guild - .voice_states - .get(&command.user.id) - .and_then(|voice_state| voice_state.channel_id); - - let connect_to = match channel_id { - Some(channel) => channel, - None => { - return "You're not in a voice channel. How do I know where to go?".to_string(); - } +#[poise::command(slash_command)] +pub async fn join(ctx: CommandContext<'_>) -> Result<(), Error> { + let Some(guild) = ctx.guild() else { + ctx.say("You're not in a server, silly.").await?; + return Ok(()); }; - let manager = songbird::get(ctx) - .await - .expect("Songbird Voice client placed in at initialisation.") - .clone(); - - let _handler = manager.join(guild_id, connect_to).await; - - "Joining your channel!".to_string() -} - -pub async fn leave(ctx: &Context, command: &ApplicationCommandInteraction) -> String { - let guild_id = command.guild_id.unwrap(); - - let manager = songbird::get(ctx) - .await - .expect("Songbird Voice client placed in at initialisation.") - .clone(); - let has_handler = manager.get(guild_id).is_some(); - - if has_handler { - if let Err(e) = manager.remove(guild_id).await { - return format!("Failed: {:?}", e); - } - - "Goodbye!".to_string() - } else { - "I can't leave if I'm not there to bein with!".to_string() - } -} - -pub async fn play(ctx: &mut Context, command: &ApplicationCommandInteraction) -> String { - let options = command - .data - .options - .get(0) - .expect("Expected url option") - .resolved - .as_ref() - .expect("Expected url object"); - - let url = match options { - ApplicationCommandInteractionDataOptionValue::String(url) => url, - _ => { - return "You didn't tell me what to play.".to_string(); - } + let Some(Some(channel_id)) = guild.voice_states.get(&ctx.author().id).map(|vs| vs.channel_id) else { + ctx.say("You're not in a voice channel, silly.").await?; + return Ok(()); }; - if !url.starts_with("http") { - return "That's not a real URL. I'm onto you.".to_string(); - } - - let guild_id = command.guild_id.unwrap(); - - let manager = songbird::get(ctx) + let manager = songbird::get(ctx.serenity_context()) .await - .expect("Songbird Voice client placed in at initialisation.") + .context("Expected a songbird manager")? + .clone(); + let _handler = manager.join(guild.id, channel_id).await; + + ctx.say("Joining your channel!").await?; + + Ok(()) +} + +#[poise::command(slash_command)] +pub async fn leave(ctx: CommandContext<'_>) -> Result<(), Error> { + let Some(guild) = ctx.guild() else { + ctx.say("You're not in a server, silly.").await?; + return Ok(()); + }; + + let manager = songbird::get(ctx.serenity_context()) + .await + .context("Expected a songbird manager")? .clone(); - // Try to join the caller's channel - if manager.get(guild_id).is_none() { - join(ctx, command).await; + if manager.get(guild.id).is_none() { + ctx.say("I'm not even in a voice channel!").await?; + return Ok(()); } - if let Some(handler_lock) = manager.get(guild_id) { + let _handler = manager.remove(guild.id).await; + + ctx.say("Okay bye!").await?; + + Ok(()) +} + +#[poise::command(slash_command)] +pub async fn play( + ctx: CommandContext<'_>, + #[description = "The URL of the song to play"] url: Option, +) -> Result<(), Error> { + let Some(url) = url else { + ctx.say("You need to give me a URL to play!").await?; + return Ok(()); + }; + + let Some(guild) = ctx.guild() else { + ctx.say("You're not in a server, silly.").await?; + return Ok(()); + }; + + let manager = songbird::get(ctx.serenity_context()) + .await + .context("Expected a songbird manager")? + .clone(); + + if manager.get(guild.id).is_none() { + let Some(Some(channel_id)) = guild.voice_states.get(&ctx.author().id).map(|vs| vs.channel_id) else { + ctx.say("Neither of us are in a voice channel, silly.").await?; + return Ok(()); + }; + let _handler = manager.join(guild.id, channel_id).await; + } + + if let Some(handler_lock) = manager.get(guild.id) { let mut handler = handler_lock.lock().await; - let source = match songbird::input::Restartable::ytdl(url.clone(), false).await { - Ok(source) => source, - Err(why) => { - println!("Err starting source: {:?}", why); + debug!("Trying to play: {}", url); + let source = songbird::ytdl(&url).await?; + debug!("Playing: {:?}", source.metadata); + let title = source + .metadata + .title + .clone() + .unwrap_or(String::from("This video")); + let msg = MessageBuilder::new() + .push("Now playing: ") + .push_named_link(title, url) + .build(); + ctx.say(msg).await?; - return "Something went horribly wrong. Go yell at Valter.".to_string(); - } - }; - - let source_input: Input = source.into(); - - let message = { - if let Some(title) = &source_input.metadata.title { - let mut msg = MessageBuilder::new(); - msg.push_line("Playing this:"); - msg.push_named_link(title, url); - msg.build() - } else { - "Playing something, I dunno what.".to_string() - } - }; - - let (mut audio, track_handle) = create_player(source_input); - - let mut data = ctx.data.write().await; - - let current_track = data.get_mut::().unwrap(); - *current_track = Some(track_handle); - - let volume = data.get::().unwrap(); - - audio.set_volume(*volume); + let (audio, track_handle) = create_player(source); + let mut currently_playing = ctx.data().currently_playing.lock(); + *currently_playing = Some(track_handle); handler.play_only(audio); - - message } else { - "Somehow neither of us are in a voice channel to begin with.".to_string() - } -} - -pub async fn queue(ctx: &mut Context, command: &ApplicationCommandInteraction) -> String { - let options = command - .data - .options - .get(0) - .expect("Expected url option") - .resolved - .as_ref() - .expect("Expected url object"); - - let url = match options { - ApplicationCommandInteractionDataOptionValue::String(url) => url, - _ => { - return "You didn't tell me what to play.".to_string(); - } - }; - - if !url.starts_with("http") { - return "That's not a real URL. I'm onto you.".to_string(); - } - - let guild_id = command.guild_id.unwrap(); - - let manager = songbird::get(ctx) - .await - .expect("Songbird Voice client placed in at initialisation.") - .clone(); - - // Try to join the caller's channel - if manager.get(guild_id).is_none() { - join(ctx, command).await; - } - - if let Some(handler_lock) = manager.get(guild_id) { - let mut handler = handler_lock.lock().await; - - let source = match songbird::input::Restartable::ytdl(url.clone(), false).await { - Ok(source) => source, - Err(why) => { - println!("Err starting source: {:?}", why); - - return "Something went horribly wrong. Go yell at Valter.".to_string(); - } - }; - - let source_input: Input = source.into(); - - let message = { - if let Some(title) = &source_input.metadata.title { - let mut msg = MessageBuilder::new(); - msg.push_line(format!( - "Queueing this up at position {}:", - handler.queue().len() - )); - msg.push_named_link(title, url); - msg.build() - } else { - format!( - "Queueing something up at position {}, I dunno what.", - handler.queue().len() - ) - .to_string() - } - }; - - let (mut audio, track_handle) = create_player(source_input); - - let mut data = ctx.data.write().await; - - let current_track = data.get_mut::().unwrap(); - *current_track = Some(track_handle); - - let volume = data.get::().unwrap(); - - audio.set_volume(*volume); - handler.enqueue(audio); - - message - } else { - "Somehow neither of us are in a voice channel to begin with.".to_string() - } -} - -pub async fn skip(ctx: &Context, command: &ApplicationCommandInteraction) -> String { - let guild_id = command.guild_id.unwrap(); - - let manager = songbird::get(ctx) - .await - .expect("Songbird Voice client placed in at initialisation.") - .clone(); - - if let Some(handler_lock) = manager.get(guild_id) { - let handler = handler_lock.lock().await; - - let queue = handler.queue(); - let _ = queue.skip(); - - format!("Yeah, I didn't like this one very much anyway. Skip! Now we're at number {} in the queue.", queue.len()) - } else { - "I'm not even in a channel to begin with. Silly.".to_string() - } -} - -pub async fn stop(ctx: &Context, command: &ApplicationCommandInteraction) -> String { - let guild_id = command.guild_id.unwrap(); - - let manager = songbird::get(ctx) - .await - .expect("Songbird Voice client placed in at initialisation.") - .clone(); - - if let Some(handler_lock) = manager.get(guild_id) { - let mut handler = handler_lock.lock().await; - - handler.stop(); - - "Alright, I guess I'll stop.".to_string() - } else { - "I'm not even in a channel to begin with. Silly.".to_string() - } -} - -pub async fn set_volume(ctx: &mut Context, command: &ApplicationCommandInteraction) -> String { - let options = command - .data - .options - .get(0) - .expect("Expected volume option") - .resolved - .as_ref() - .expect("Expected volume object"); - - let volume = match options { - ApplicationCommandInteractionDataOptionValue::Number(volume) => *volume, - _ => { - return "You've gotta give me a volume level to set.".to_string(); - } - }; - - if !(0.0..=100.0).contains(&volume) { - return "Volume has to be between 0 and 100.".to_string(); - } - - let mut data = ctx.data.write().await; - - let current_volume = data.get_mut::().unwrap(); - let new_volume = (volume / 100.0) as f32; - *current_volume = new_volume; - - let current_track = data.get::().unwrap(); - if let Some(track) = current_track { - if track.set_volume(new_volume).is_err() { - return format!( - "Setting volume to {}%, but it didn't work for the current track for some reason.", - volume - ); - } - } - - format!("Setting volume to {}%.", volume) -} - -pub async fn set_loop(ctx: &mut Context, command: &ApplicationCommandInteraction) -> String { - let options = command - .data - .options - .get(0) - .expect("Expected loop option") - .resolved - .as_ref() - .expect("Expected loop object"); - - let loops = match options { - ApplicationCommandInteractionDataOptionValue::Boolean(loops) => *loops, - _ => { - return "Do you want me to loop the song or not? Be specific.".to_string(); - } - }; - - let data = ctx.data.write().await; - let current_track = data.get::().unwrap(); - if let Some(track) = current_track { - if loops { - track.enable_loop().expect("Couldn't enable looping"); - "Loopin'!".to_string() - } else { - track.disable_loop().expect("Couldn't disable looping"); - "This is the last time this track will EVER be played.".to_string() - } - } else { - "I can't loop a song if there is no song to loop.".to_string() + ctx.say("Neither of us are in a voice channel, silly.") + .await?; } + + Ok(()) } diff --git a/src/main.rs b/src/main.rs index 6b87ae1..47b4014 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,222 +1,81 @@ #![warn(clippy::all)] -use std::env; - -use serenity::{ - async_trait, - model::{ - gateway::Ready, - id::GuildId, - interactions::{ - application_command::{ApplicationCommandOptionType, ApplicationCommandPermissionType}, - Interaction, InteractionResponseType, - }, - }, - prelude::*, -}; -use songbird::{tracks::TrackHandle, SerenityInit}; - mod commands; -struct CurrentlyPlayingTrack; +use commands::*; -impl TypeMapKey for CurrentlyPlayingTrack { - type Value = Option; +use std::{env, sync::Arc}; + +use anyhow::Result; +use parking_lot::Mutex; +use poise::serenity_prelude::{self as serenity}; +use songbird::serenity::SerenityInit; +use tracing_subscriber::filter; + +pub struct Data { + currently_playing: Arc>>, +} +pub type Error = Box; +pub type CommandContext<'a> = poise::Context<'a, Data, Error>; + +async fn event_event_handler( + _ctx: &serenity::Context, + event: &poise::Event<'_>, + _framework: poise::FrameworkContext<'_, Data, Error>, + _user_data: &Data, +) -> Result<(), Error> { + if let poise::Event::Ready { data_about_bot } = event { + println!("{} is connected!", data_about_bot.user.name) + } + + Ok(()) } -struct CurrentVolume; +/// Registers slash commands in this guild or globally +#[poise::command(prefix_command, hide_in_help)] +async fn register(ctx: CommandContext<'_>) -> Result<(), Error> { + poise::builtins::register_application_commands_buttons(ctx).await?; -impl TypeMapKey for CurrentVolume { - type Value = f32; -} - -struct Handler; - -#[async_trait] -impl EventHandler for Handler { - async fn interaction_create(&self, mut ctx: Context, interaction: Interaction) { - if let Interaction::ApplicationCommand(command) = interaction { - let content = match command.data.name.as_str() { - "join" => commands::join(&ctx, &command).await, - "leave" => commands::leave(&ctx, &command).await, - "play" => commands::play(&mut ctx, &command).await, - "queue" => commands::queue(&mut ctx, &command).await, - "skip" => commands::skip(&mut ctx, &command).await, - "stop" => commands::stop(&ctx, &command).await, - "volume" => commands::set_volume(&mut ctx, &command).await, - "loop" => commands::set_loop(&mut ctx, &command).await, - _ => "not implemented :(".to_string(), - }; - - if let Err(why) = command - .create_interaction_response(&ctx.http, |response| { - response - .kind(InteractionResponseType::ChannelMessageWithSource) - .interaction_response_data(|message| message.content(content)) - }) - .await - { - println!("Cannot respond to slash command: {}", why); - } - } - } - - async fn cache_ready(&self, ctx: Context, guilds: Vec) { - for guild in guilds { - let commands = guild - .set_application_commands(&ctx.http, |commands| { - commands - .create_application_command(|command| { - command - .name("join") - .description("Join your current channel") - .default_permission(false) - }) - .create_application_command(|command| { - command - .name("leave") - .description("Leave the bot's current channel") - .default_permission(false) - }) - .create_application_command(|command| { - command - .name("play") - .description("Play a song") - .create_option(|option| { - option - .name("url") - .description("The URL of the song to play") - .kind(ApplicationCommandOptionType::String) - .required(true) - }) - .default_permission(false) - }) - .create_application_command(|command| { - command - .name("queue") - .description("Queue up a song") - .create_option(|option| { - option - .name("url") - .description("The URL of the song to queue") - .kind(ApplicationCommandOptionType::String) - .required(true) - }) - .default_permission(false) - }) - .create_application_command(|command| { - command - .name("skip") - .description("Skip the currently playing queued song") - .default_permission(false) - }) - .create_application_command(|command| { - command - .name("stop") - .description("Stop any currently playing songs") - .default_permission(false) - }) - .create_application_command(|command| { - command - .name("volume") - .description("Set the bot's playback volume") - .create_option(|option| { - option - .name("volume") - .description("The volume on a scale from 0 to 100") - .kind(ApplicationCommandOptionType::Number) - .required(true) - }) - .default_permission(false) - }) - .create_application_command(|command| { - command - .name("loop") - .description( - "Enable or disable looping the currently playing track", - ) - .create_option(|option| { - option - .name("loop") - .description("Whether or not the track should loop") - .kind(ApplicationCommandOptionType::Boolean) - .required(true) - }) - .default_permission(false) - }) - }) - .await - .expect("Couldn't create commands"); - - println!("I created the following guild commands: {:#?}", commands); - - let role_id = env::var("ROLE_ID") - .expect("Expected a role id in the environment") - .parse::() - .expect("Role id is not a valid id"); - - let permissions = guild - .set_application_commands_permissions(&ctx.http, |permissions| { - for command in commands { - permissions.create_application_command(|permissions| { - permissions - .id(command.id.into()) - .create_permissions(|permission| { - permission - .id(role_id) - .kind(ApplicationCommandPermissionType::Role) - .permission(true) - }) - }); - } - permissions - }) - .await - .expect("Couldn't set permissions"); - - println!("I created the following permissions: {:#?}", permissions); - } - } - - async fn ready(&self, _ctx: Context, ready: Ready) { - println!("{} is connected!", ready.user.name); - } + Ok(()) } #[tokio::main] -async fn main() { +async fn main() -> Result<()> { + tracing_subscriber::fmt() + .with_max_level(filter::LevelFilter::DEBUG) + .init(); + let token = env::var("DISCORD_TOKEN").expect("Expected a bot token in the environment: DISCORD_TOKEN"); - let application_id: u64 = env::var("APPLICATION_ID") - .expect("Expected an application id in the environment: APPLICATION_ID") - .parse() - .expect("application id is not a valid id"); + let options = poise::FrameworkOptions { + commands: vec![register(), join(), leave(), play()], + event_handler: |ctx, event, framework, user_data| { + Box::pin(event_event_handler(ctx, event, framework, user_data)) + }, + prefix_options: poise::PrefixFrameworkOptions { + prefix: Some(String::from("~")), + ..Default::default() + }, + ..Default::default() + }; - env::var("ROLE_ID") - .expect("Expected a role id in the environment: ROLE_ID") - .parse::() - .expect("Role id is not a valid id"); + let intents = serenity::GatewayIntents::non_privileged(); - env::var("CHANNEL_ID") - .expect("Expected a channel id in the environment: CHANNEL_ID") - .parse::() - .expect("Channel id is not a valid id"); + poise::Framework::builder() + .token(token) + .options(options) + .intents(intents) + .setup(|_ctx, _data, _framework| { + Box::pin(async move { + Ok(Data { + currently_playing: Arc::new(Mutex::new(None)), + }) + }) + }) + .client_settings(|client_builder| client_builder.register_songbird()) + .run() + .await?; - let mut client = Client::builder(token) - .event_handler(Handler) - .application_id(application_id) - .register_songbird() - .await - .expect("Error creating client"); - - { - let mut data = client.data.write().await; - data.insert::(None); - data.insert::(1.0); - } - - if let Err(why) = client.start().await { - println!("Client error: {:?}", why); - } + Ok(()) } From 9242d39f9825fee9a11aa788b7c091a0b90d2f4b Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 2 Mar 2023 19:57:58 -0500 Subject: [PATCH 02/47] Add AI-generated sassy commentary --- Cargo.toml | 1 + src/commands.rs | 25 +++++++++++++----- src/main.rs | 1 + src/openai.rs | 69 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 7 deletions(-) create mode 100644 src/openai.rs diff --git a/Cargo.toml b/Cargo.toml index 52dbf78..e145a17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ poise = "0.5.2" tracing = "0.1.37" tracing-subscriber = "0.3.16" tracing-futures = "0.2.5" +openai = "1.0.0-alpha.5" [dependencies.songbird] version = "0.3.0" diff --git a/src/commands.rs b/src/commands.rs index f9356fa..274df57 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1,9 +1,9 @@ use anyhow::{Context, Result}; use poise::serenity_prelude::{EmbedMessageBuilding, MessageBuilder}; use songbird::create_player; -use tracing::debug; +use tracing::{debug, log::warn}; -use crate::{CommandContext, Error}; +use crate::{openai, CommandContext, Error}; #[poise::command(slash_command)] pub async fn join(ctx: CommandContext<'_>) -> Result<(), Error> { @@ -91,11 +91,22 @@ pub async fn play( .title .clone() .unwrap_or(String::from("This video")); - let msg = MessageBuilder::new() - .push("Now playing: ") - .push_named_link(title, url) - .build(); - ctx.say(msg).await?; + + let mut msg = MessageBuilder::new(); + + // Optional sassy commentary! + match openai::get_sassy_commentary(&title).await { + Ok(commentary) => { + msg.push_line(&commentary).push_line(""); + } + Err(e) => { + warn!("Failed to get sassy commentary for \"{title}\": {e}"); + } + }; + + msg.push_bold("Now playing: ").push_named_link(title, url); + + ctx.say(msg.build()).await?; let (audio, track_handle) = create_player(source); let mut currently_playing = ctx.data().currently_playing.lock(); diff --git a/src/main.rs b/src/main.rs index 47b4014..b8469b8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ #![warn(clippy::all)] mod commands; +mod openai; use commands::*; diff --git a/src/openai.rs b/src/openai.rs new file mode 100644 index 0000000..6cd68fa --- /dev/null +++ b/src/openai.rs @@ -0,0 +1,69 @@ +use anyhow::{Context, Result}; +use openai::{ + chat::{ChatCompletion, ChatCompletionRequestMessage}, + models::ModelID, +}; + +pub async fn get_sassy_commentary(title: &str) -> Result { + let system = [ + "You are a grumpy talking feline DJ who is harshly critical of music requests, but whose job depends on being kind to patrons.", + "Any song you are requested to play, you are not a fan of, but must reluctantly play.", + "When responding, be sure to include a mention of some element of the song itself.", + "Be concise, but don't forget that you can't upset anyone.", + "Bonus points for cat puns.", + ]; + + let example_prompt = "Play \"Undertale - Megalovania\""; + + let example_response = "Ugh, really? You've got to be kitten me. I suppose I can play \ + Megalovania for you, but don't expect me to be purring with delight about it. The melody is a bit \ + cattywampus for my taste, but I'll concede that it has some clawsome beats. Enjoy your tune, and paws crossed that \ + it doesn't have me hissing by the end of it."; + + let prompt = format!("Play \"{title}\""); + + let completion = ChatCompletion::builder( + ModelID::Gpt3_5Turbo, + [ + system + .into_iter() + .map(|s| ChatCompletionRequestMessage { + role: openai::chat::ChatCompletionMessageRole::System, + content: String::from(s), + name: None, + }) + .collect::>(), + vec![ + ChatCompletionRequestMessage { + role: openai::chat::ChatCompletionMessageRole::User, + content: String::from(example_prompt), + name: None, + }, + ChatCompletionRequestMessage { + role: openai::chat::ChatCompletionMessageRole::Assistant, + content: String::from(example_response), + name: None, + }, + ChatCompletionRequestMessage { + role: openai::chat::ChatCompletionMessageRole::User, + content: prompt, + name: None, + }, + ], + ] + .into_iter() + .flatten() + .collect::>(), + ) + .max_tokens(2048_u64) + .create() + .await??; + + Ok(completion + .choices + .first() + .context("No choices")? + .message + .content + .clone()) +} From 332e7d4aa90637e076c675e23e040ee9ae4b2448 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 2 Mar 2023 21:20:24 -0500 Subject: [PATCH 03/47] Add stop command --- src/commands.rs | 28 ++++++++++++++++++++++++++++ src/main.rs | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/commands.rs b/src/commands.rs index 274df57..dc97c14 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -119,3 +119,31 @@ pub async fn play( Ok(()) } + +#[poise::command(slash_command)] +pub async fn stop(ctx: CommandContext<'_>) -> Result<(), Error> { + let Some(guild) = ctx.guild() else { + ctx.say("You're not in a server, silly.").await?; + return Ok(()); + }; + + let manager = songbird::get(ctx.serenity_context()) + .await + .context("Expected a songbird manager")? + .clone(); + + if let Some(handler_lock) = manager.get(guild.id) { + let mut handler = handler_lock.lock().await; + handler.stop(); + { + let mut currently_playing = ctx.data().currently_playing.lock(); + *currently_playing = None; + } + ctx.say("Alright, I guess I'll stop.").await?; + } else { + ctx.say("I'm not even in a channel to begin with. Silly.") + .await?; + } + + Ok(()) +} diff --git a/src/main.rs b/src/main.rs index b8469b8..fffbb4a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,7 +50,7 @@ async fn main() -> Result<()> { env::var("DISCORD_TOKEN").expect("Expected a bot token in the environment: DISCORD_TOKEN"); let options = poise::FrameworkOptions { - commands: vec![register(), join(), leave(), play()], + commands: vec![register(), join(), leave(), play(), stop()], event_handler: |ctx, event, framework, user_data| { Box::pin(event_event_handler(ctx, event, framework, user_data)) }, From 3bdd819d75223adaaea50952a646ba34e7af67b4 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 2 Mar 2023 21:22:10 -0500 Subject: [PATCH 04/47] Remove command prefix We can just ping the bot --- src/main.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index fffbb4a..19316ee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -54,10 +54,6 @@ async fn main() -> Result<()> { event_handler: |ctx, event, framework, user_data| { Box::pin(event_event_handler(ctx, event, framework, user_data)) }, - prefix_options: poise::PrefixFrameworkOptions { - prefix: Some(String::from("~")), - ..Default::default() - }, ..Default::default() }; From 30ffacfef0470cb01cb222abff6933e08d2641e1 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 2 Mar 2023 22:36:56 -0500 Subject: [PATCH 05/47] Add initial response while a song loads --- src/commands.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/commands.rs b/src/commands.rs index dc97c14..5d77b33 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -81,6 +81,10 @@ pub async fn play( } if let Some(handler_lock) = manager.get(guild.id) { + let response = ctx + .send(|r| r.content("https://media.giphy.com/media/H1dxi6xdh4NGQCZSvz/giphy.gif")) + .await?; + let mut handler = handler_lock.lock().await; debug!("Trying to play: {}", url); @@ -106,7 +110,7 @@ pub async fn play( msg.push_bold("Now playing: ").push_named_link(title, url); - ctx.say(msg.build()).await?; + response.edit(ctx, |r| r.content(msg.build())).await?; let (audio, track_handle) = create_player(source); let mut currently_playing = ctx.data().currently_playing.lock(); From 90c65693de1d9cfcec3ee458bb1c58da2921fbed Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 2 Mar 2023 22:52:19 -0500 Subject: [PATCH 06/47] Add cat pun loading messages --- Cargo.toml | 1 + src/commands.rs | 10 +++++++--- src/openai.rs | 28 ++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e145a17..2075e09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ tracing = "0.1.37" tracing-subscriber = "0.3.16" tracing-futures = "0.2.5" openai = "1.0.0-alpha.5" +rand = "0.8.5" [dependencies.songbird] version = "0.3.0" diff --git a/src/commands.rs b/src/commands.rs index 5d77b33..fa0d168 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -81,9 +81,13 @@ pub async fn play( } if let Some(handler_lock) = manager.get(guild.id) { - let response = ctx - .send(|r| r.content("https://media.giphy.com/media/H1dxi6xdh4NGQCZSvz/giphy.gif")) - .await?; + let mut msg = MessageBuilder::new(); + msg.push_line(String::from(openai::get_random_loading_message())) + .push_named_link( + "", + "https://media.giphy.com/media/H1dxi6xdh4NGQCZSvz/giphy.gif", + ); + let response = ctx.send(|r| r.content(msg.build())).await?; let mut handler = handler_lock.lock().await; diff --git a/src/openai.rs b/src/openai.rs index 6cd68fa..09c3790 100644 --- a/src/openai.rs +++ b/src/openai.rs @@ -3,6 +3,34 @@ use openai::{ chat::{ChatCompletion, ChatCompletionRequestMessage}, models::ModelID, }; +use rand::seq::SliceRandom; + +const LOADING_MESSAGES: [&str; 20] = [ + "Hold your claws, I'm searching for the right tune.", + "Sorry, I was busy napping. Let me find your song meow.", + "Just a whisker longer, I'm on the hunt for your jam.", + "Be patient, I'm pawsitively searching for your requested song.", + "Let me caterwaul through my playlist to find your tune.", + "Feline a bit slow, but I'll find your song in no time.", + "Don't be catty, I'm just trying to find the right tune for you.", + "Just paws for a moment, I'm working on finding your song.", + "Hiss-terical, just need a moment to find your meow-sic.", + "Give me a few seconds, I'm furiously searching for your requested song.", + "Cat got my tongue! Just need a sec to find your track.", + "Let me use my cat-like reflexes to search for your song.", + "I'm not lion around, just give me a moment to find your tune.", + "Don't be hiss-ty, I'm searching for your requested song.", + "Just kitten around, I'll find your song in a jiffy.", + "Purr-haps it'll take me a moment, but I'll find your tune soon enough.", + "My paws are a little tired, but I'm still searching for your song!", + "Sorry, my cat nap ran a little long. Let me find your song now.", + "I'm not trying to be catty, just need a minute to find your tune.", + "Don't be fur-ious, I'm doing my best to find your requested song.", +]; + +pub fn get_random_loading_message() -> &'static str { + return LOADING_MESSAGES.choose(&mut rand::thread_rng()).unwrap(); +} pub async fn get_sassy_commentary(title: &str) -> Result { let system = [ From c5ee1a21cde3ac488deadc692a702c2e9544a527 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 2 Mar 2023 22:57:00 -0500 Subject: [PATCH 07/47] Rename openai module to personality --- src/commands.rs | 6 +++--- src/main.rs | 2 +- src/{openai.rs => personality.rs} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename src/{openai.rs => personality.rs} (100%) diff --git a/src/commands.rs b/src/commands.rs index fa0d168..cdcdcf8 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -3,7 +3,7 @@ use poise::serenity_prelude::{EmbedMessageBuilding, MessageBuilder}; use songbird::create_player; use tracing::{debug, log::warn}; -use crate::{openai, CommandContext, Error}; +use crate::{personality, CommandContext, Error}; #[poise::command(slash_command)] pub async fn join(ctx: CommandContext<'_>) -> Result<(), Error> { @@ -82,7 +82,7 @@ pub async fn play( if let Some(handler_lock) = manager.get(guild.id) { let mut msg = MessageBuilder::new(); - msg.push_line(String::from(openai::get_random_loading_message())) + msg.push_line(String::from(personality::get_random_loading_message())) .push_named_link( "", "https://media.giphy.com/media/H1dxi6xdh4NGQCZSvz/giphy.gif", @@ -103,7 +103,7 @@ pub async fn play( let mut msg = MessageBuilder::new(); // Optional sassy commentary! - match openai::get_sassy_commentary(&title).await { + match personality::get_sassy_commentary(&title).await { Ok(commentary) => { msg.push_line(&commentary).push_line(""); } diff --git a/src/main.rs b/src/main.rs index 19316ee..6fa517d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ #![warn(clippy::all)] mod commands; -mod openai; +mod personality; use commands::*; diff --git a/src/openai.rs b/src/personality.rs similarity index 100% rename from src/openai.rs rename to src/personality.rs From 4cc06dbca10fbbd971e52f1c9faa42e697a592bb Mon Sep 17 00:00:00 2001 From: Alex Page Date: Fri, 3 Mar 2023 01:03:59 -0500 Subject: [PATCH 08/47] Fix dockerfile --- Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 38a6057..8e5f475 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,13 @@ FROM rust:1 as builder -RUN apt-get update && apt-get install -y libopus-dev +RUN apt-get update && apt-get --no-install-recommends install -y libopus-dev WORKDIR /usr/src/myapp COPY . . RUN cargo install --path . FROM debian:bullseye-slim -RUN apt-get update && apt-get install -y ffmpeg youtube-dl -COPY --from=builder /usr/local/cargo/bin/dj-kitty-cat /usr/local/bin/dj-kitty-cat -CMD ["dj-kitty-cat"] +RUN apt-get update && apt-get --no-install-recommends install -y ffmpeg +# Install yt-dlp from github releases for bugfix +ADD https://github.com/ytdl-patched/yt-dlp/releases/download/2023.03.03.19419/yt-dlp_linux /usr/local/bin/yt-dlp +RUN chmod a+rx /usr/local/bin/yt-dlp +COPY --from=builder /usr/local/cargo/bin/dj_kitty_cat /usr/local/bin/dj_kitty_cat +CMD ["dj_kitty_cat"] From 72311197e06557e0b889f76d3fd2fa4e08e975df Mon Sep 17 00:00:00 2001 From: Alex Page Date: Fri, 3 Mar 2023 01:30:09 -0500 Subject: [PATCH 09/47] Add OPENAI_KEY arg to Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 8e5f475..b5b048d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM rust:1 as builder +ARG OPENAI_KEY RUN apt-get update && apt-get --no-install-recommends install -y libopus-dev WORKDIR /usr/src/myapp COPY . . From ad2ae7b6eb0eeb60608e5a42861efaf00fd535ed Mon Sep 17 00:00:00 2001 From: Alex Page Date: Fri, 3 Mar 2023 02:02:02 -0500 Subject: [PATCH 10/47] Reduce logging level --- src/main.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6fa517d..d6070f7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,9 +42,7 @@ async fn register(ctx: CommandContext<'_>) -> Result<(), Error> { #[tokio::main] async fn main() -> Result<()> { - tracing_subscriber::fmt() - .with_max_level(filter::LevelFilter::DEBUG) - .init(); + tracing_subscriber::fmt().init(); let token = env::var("DISCORD_TOKEN").expect("Expected a bot token in the environment: DISCORD_TOKEN"); From 1e4fbfb1b15bff04ae479594d9862f5d95d7861e Mon Sep 17 00:00:00 2001 From: Alex Page Date: Fri, 3 Mar 2023 02:10:06 -0500 Subject: [PATCH 11/47] Remove unused import --- src/main.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index d6070f7..1519f3a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,6 @@ use anyhow::Result; use parking_lot::Mutex; use poise::serenity_prelude::{self as serenity}; use songbird::serenity::SerenityInit; -use tracing_subscriber::filter; pub struct Data { currently_playing: Arc>>, From 16182615d8df3e75d3712b1ca9824a83b8729d0f Mon Sep 17 00:00:00 2001 From: Alex Page Date: Fri, 3 Mar 2023 02:41:28 -0500 Subject: [PATCH 12/47] Install static ffmpeg and yt-dlp from source --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b5b048d..4089631 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,9 @@ COPY . . RUN cargo install --path . FROM debian:bullseye-slim -RUN apt-get update && apt-get --no-install-recommends install -y ffmpeg -# Install yt-dlp from github releases for bugfix -ADD https://github.com/ytdl-patched/yt-dlp/releases/download/2023.03.03.19419/yt-dlp_linux /usr/local/bin/yt-dlp -RUN chmod a+rx /usr/local/bin/yt-dlp +COPY --from=mwader/static-ffmpeg:6.0 /ffmpeg /usr/local/bin/ +RUN apt-get update && apt-get --no-install-recommends install -y python3 python3-pip +RUN python3 -m pip install -U pip setuptools wheel +RUN python3 -m pip install --force-reinstall https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz COPY --from=builder /usr/local/cargo/bin/dj_kitty_cat /usr/local/bin/dj_kitty_cat CMD ["dj_kitty_cat"] From 2de52dfe9d9f1a82c8728b4fc649c97166ffd2a3 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Fri, 3 Mar 2023 02:50:01 -0500 Subject: [PATCH 13/47] Install libopus in final image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4089631..742607f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN cargo install --path . FROM debian:bullseye-slim COPY --from=mwader/static-ffmpeg:6.0 /ffmpeg /usr/local/bin/ -RUN apt-get update && apt-get --no-install-recommends install -y python3 python3-pip +RUN apt-get update && apt-get --no-install-recommends install -y python3 python3-pip libopus0 RUN python3 -m pip install -U pip setuptools wheel RUN python3 -m pip install --force-reinstall https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz COPY --from=builder /usr/local/cargo/bin/dj_kitty_cat /usr/local/bin/dj_kitty_cat From eb56c024cd13c670ba42efbb31e8dd617b6639b3 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Mon, 6 Mar 2023 03:05:38 -0500 Subject: [PATCH 14/47] Update openai crate --- Cargo.toml | 2 +- src/personality.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2075e09..8ba936b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ poise = "0.5.2" tracing = "0.1.37" tracing-subscriber = "0.3.16" tracing-futures = "0.2.5" -openai = "1.0.0-alpha.5" +openai = "1.0.0-alpha.6" rand = "0.8.5" [dependencies.songbird] diff --git a/src/personality.rs b/src/personality.rs index 09c3790..f1c5c2c 100644 --- a/src/personality.rs +++ b/src/personality.rs @@ -1,6 +1,6 @@ use anyhow::{Context, Result}; use openai::{ - chat::{ChatCompletion, ChatCompletionRequestMessage}, + chat::{ChatCompletion, ChatCompletionMessage}, models::ModelID, }; use rand::seq::SliceRandom; @@ -55,24 +55,24 @@ pub async fn get_sassy_commentary(title: &str) -> Result { [ system .into_iter() - .map(|s| ChatCompletionRequestMessage { + .map(|s| ChatCompletionMessage { role: openai::chat::ChatCompletionMessageRole::System, content: String::from(s), name: None, }) .collect::>(), vec![ - ChatCompletionRequestMessage { + ChatCompletionMessage { role: openai::chat::ChatCompletionMessageRole::User, content: String::from(example_prompt), name: None, }, - ChatCompletionRequestMessage { + ChatCompletionMessage { role: openai::chat::ChatCompletionMessageRole::Assistant, content: String::from(example_response), name: None, }, - ChatCompletionRequestMessage { + ChatCompletionMessage { role: openai::chat::ChatCompletionMessageRole::User, content: prompt, name: None, From 07618676dbbb9f69db7be454cd5768dfd08e41b5 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Tue, 7 Mar 2023 20:53:54 -0500 Subject: [PATCH 15/47] Implement queue --- Cargo.toml | 1 + src/commands.rs | 198 +++++++++++++++++++++++++++++++++++++++++++++--- src/main.rs | 18 ++++- src/queue.rs | 102 +++++++++++++++++++++++++ 4 files changed, 306 insertions(+), 13 deletions(-) create mode 100644 src/queue.rs diff --git a/Cargo.toml b/Cargo.toml index 8ba936b..493ee1c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ tracing-subscriber = "0.3.16" tracing-futures = "0.2.5" openai = "1.0.0-alpha.6" rand = "0.8.5" +thiserror = "1.0.39" [dependencies.songbird] version = "0.3.0" diff --git a/src/commands.rs b/src/commands.rs index cdcdcf8..e87b1c4 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1,6 +1,5 @@ use anyhow::{Context, Result}; use poise::serenity_prelude::{EmbedMessageBuilding, MessageBuilder}; -use songbird::create_player; use tracing::{debug, log::warn}; use crate::{personality, CommandContext, Error}; @@ -116,10 +115,86 @@ pub async fn play( response.edit(ctx, |r| r.content(msg.build())).await?; - let (audio, track_handle) = create_player(source); - let mut currently_playing = ctx.data().currently_playing.lock(); - *currently_playing = Some(track_handle); - handler.play_only(audio); + let mut queue = ctx.data().queue.lock(); + if !queue.is_empty() { + let _ = queue.stop(); + } + queue.add_next(source, &mut handler); + queue.resume()?; + } else { + ctx.say("Neither of us are in a voice channel, silly.") + .await?; + } + + Ok(()) +} + +#[poise::command(slash_command)] +pub async fn queue( + ctx: CommandContext<'_>, + #[description = "The URL of the song to play"] url: Option, +) -> Result<(), Error> { + let Some(url) = url else { + ctx.say("You need to give me a URL to play!").await?; + return Ok(()); + }; + + let Some(guild) = ctx.guild() else { + ctx.say("You're not in a server, silly.").await?; + return Ok(()); + }; + + let manager = songbird::get(ctx.serenity_context()) + .await + .context("Expected a songbird manager")? + .clone(); + + if manager.get(guild.id).is_none() { + let Some(Some(channel_id)) = guild.voice_states.get(&ctx.author().id).map(|vs| vs.channel_id) else { + ctx.say("Neither of us are in a voice channel, silly.").await?; + return Ok(()); + }; + let _handler = manager.join(guild.id, channel_id).await; + } + + if let Some(handler_lock) = manager.get(guild.id) { + let mut msg = MessageBuilder::new(); + msg.push_line(String::from(personality::get_random_loading_message())) + .push_named_link( + "", + "https://media.giphy.com/media/H1dxi6xdh4NGQCZSvz/giphy.gif", + ); + let response = ctx.send(|r| r.content(msg.build())).await?; + + let mut handler = handler_lock.lock().await; + + debug!("Trying to play: {}", url); + let source = songbird::ytdl(&url).await?; + debug!("Playing: {:?}", source.metadata); + let title = source + .metadata + .title + .clone() + .unwrap_or(String::from("This video")); + + let mut msg = MessageBuilder::new(); + + // Optional sassy commentary! + match personality::get_sassy_commentary(&title).await { + Ok(commentary) => { + msg.push_line(&commentary).push_line(""); + } + Err(e) => { + warn!("Failed to get sassy commentary for \"{title}\": {e}"); + } + }; + + msg.push_bold("Queued: ").push_named_link(title, url); + + response.edit(ctx, |r| r.content(msg.build())).await?; + + let mut queue = ctx.data().queue.lock(); + queue.add_to_end(source, &mut handler); } else { ctx.say("Neither of us are in a voice channel, silly.") .await?; @@ -140,12 +215,10 @@ pub async fn stop(ctx: CommandContext<'_>) -> Result<(), Error> { .context("Expected a songbird manager")? .clone(); - if let Some(handler_lock) = manager.get(guild.id) { - let mut handler = handler_lock.lock().await; - handler.stop(); + if manager.get(guild.id).is_some() { { - let mut currently_playing = ctx.data().currently_playing.lock(); - *currently_playing = None; + let mut queue = ctx.data().queue.lock(); + queue.stop()?; } ctx.say("Alright, I guess I'll stop.").await?; } else { @@ -155,3 +228,108 @@ pub async fn stop(ctx: CommandContext<'_>) -> Result<(), Error> { Ok(()) } + +#[poise::command(slash_command)] +pub async fn skip(ctx: CommandContext<'_>) -> Result<(), Error> { + let Some(guild) = ctx.guild() else { + ctx.say("You're not in a server, silly.").await?; + return Ok(()); + }; + + let manager = songbird::get(ctx.serenity_context()) + .await + .context("Expected a songbird manager")? + .clone(); + + if manager.get(guild.id).is_some() { + { + let mut queue = ctx.data().queue.lock(); + let _ = queue.stop(); + queue.resume()?; + } + ctx.say("Skipping!").await?; + } else { + ctx.say("I'm not even in a channel to begin with. Silly.") + .await?; + } + + Ok(()) +} + +#[poise::command(slash_command)] +pub async fn pause(ctx: CommandContext<'_>) -> Result<(), Error> { + let Some(guild) = ctx.guild() else { + ctx.say("You're not in a server, silly.").await?; + return Ok(()); + }; + + let manager = songbird::get(ctx.serenity_context()) + .await + .context("Expected a songbird manager")? + .clone(); + + if manager.get(guild.id).is_some() { + { + let mut queue = ctx.data().queue.lock(); + queue.pause()?; + } + ctx.say("Pausing!").await?; + } else { + ctx.say("I'm not even in a channel to begin with. Silly.") + .await?; + } + + Ok(()) +} + +#[poise::command(slash_command)] +pub async fn resume(ctx: CommandContext<'_>) -> Result<(), Error> { + let Some(guild) = ctx.guild() else { + ctx.say("You're not in a server, silly.").await?; + return Ok(()); + }; + + let manager = songbird::get(ctx.serenity_context()) + .await + .context("Expected a songbird manager")? + .clone(); + + if manager.get(guild.id).is_some() { + { + let mut queue = ctx.data().queue.lock(); + queue.resume()?; + } + ctx.say("Resuming!").await?; + } else { + ctx.say("I'm not even in a channel to begin with. Silly.") + .await?; + } + + Ok(()) +} + +#[poise::command(slash_command)] +pub async fn clear(ctx: CommandContext<'_>) -> Result<(), Error> { + let Some(guild) = ctx.guild() else { + ctx.say("You're not in a server, silly.").await?; + return Ok(()); + }; + + let manager = songbird::get(ctx.serenity_context()) + .await + .context("Expected a songbird manager")? + .clone(); + + if manager.get(guild.id).is_some() { + { + let mut queue = ctx.data().queue.lock(); + queue.clear(); + } + ctx.say("Cleared the queue!").await?; + } else { + ctx.say("I'm not even in a channel to begin with. Silly.") + .await?; + } + + Ok(()) +} diff --git a/src/main.rs b/src/main.rs index 1519f3a..7a0e67d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,7 @@ mod commands; mod personality; +mod queue; use commands::*; @@ -13,7 +14,7 @@ use poise::serenity_prelude::{self as serenity}; use songbird::serenity::SerenityInit; pub struct Data { - currently_playing: Arc>>, + queue: Arc>, } pub type Error = Box; pub type CommandContext<'a> = poise::Context<'a, Data, Error>; @@ -47,7 +48,18 @@ async fn main() -> Result<()> { env::var("DISCORD_TOKEN").expect("Expected a bot token in the environment: DISCORD_TOKEN"); let options = poise::FrameworkOptions { - commands: vec![register(), join(), leave(), play(), stop()], + commands: vec![ + register(), + join(), + leave(), + play(), + queue(), + stop(), + skip(), + pause(), + resume(), + clear(), + ], event_handler: |ctx, event, framework, user_data| { Box::pin(event_event_handler(ctx, event, framework, user_data)) }, @@ -63,7 +75,7 @@ async fn main() -> Result<()> { .setup(|_ctx, _data, _framework| { Box::pin(async move { Ok(Data { - currently_playing: Arc::new(Mutex::new(None)), + queue: Arc::new(Mutex::new(queue::Queue::new())), }) }) }) diff --git a/src/queue.rs b/src/queue.rs new file mode 100644 index 0000000..36dd1c1 --- /dev/null +++ b/src/queue.rs @@ -0,0 +1,102 @@ +//! Implements a queue for the bot to play songs in order + +use anyhow::Result; +use songbird::{ + input::Input, + tracks::{self, TrackHandle}, + Driver, +}; +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum QueueError { + #[error("Nothing is in the queue.")] + EmptyQueue, +} + +pub struct Queue { + queue: Vec, +} + +impl Queue { + #[must_use] + pub fn new() -> Self { + Self { queue: Vec::new() } + } + + /// Resumes the current track + pub fn resume(&mut self) -> Result<()> { + let Some(track) = self.queue.first() else { + return Err(QueueError::EmptyQueue.into()); + }; + track.play()?; + Ok(()) + } + + /// Stops the current track and removes it from the queue + pub fn stop(&mut self) -> Result<()> { + let Some(track) = self.queue.first() else { + return Err(QueueError::EmptyQueue.into()); + }; + track.stop()?; + self.queue.remove(0); + Ok(()) + } + + /// Pauses the current track + pub fn pause(&mut self) -> Result<()> { + let Some(track) = self.queue.first() else { + return Err(QueueError::EmptyQueue.into()); + }; + track.pause()?; + Ok(()) + } + + /// Adds a track to the end of the queue + pub fn add_to_end(&mut self, source: Input, handler: &mut Driver) -> TrackHandle { + let (mut track, handle) = tracks::create_player(source); + track.pause(); + self.queue.push(handle.clone()); + handler.play(track); + handle + } + + /// Adds multiple tracks to the end of the queue + pub fn add_all_to_end( + &mut self, + sources: Vec, + handler: &mut Driver, + ) -> Vec { + let mut handles = Vec::new(); + for source in sources { + handles.push(self.add_to_end(source, handler)); + } + handles + } + + /// Adds a track to play next + pub fn add_next(&mut self, source: Input, handler: &mut Driver) -> TrackHandle { + let (mut track, handle) = tracks::create_player(source); + track.pause(); + if self.queue.is_empty() { + self.queue.push(handle.clone()); + } else { + self.queue.insert(1, handle.clone()); + } + handler.play(track); + handle + } + + /// Clears the queue + pub fn clear(&mut self) { + for track in self.queue.drain(..) { + let _ = track.stop(); + } + } + + /// Returns whether the queue is empty + #[must_use] + pub fn is_empty(&self) -> bool { + self.queue.is_empty() + } +} From 2fd2079330582fd30aeb074f0ff0ba4caa395119 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Wed, 8 Mar 2023 18:35:30 -0500 Subject: [PATCH 16/47] Implement moving to the next track --- src/queue.rs | 102 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 89 insertions(+), 13 deletions(-) diff --git a/src/queue.rs b/src/queue.rs index 36dd1c1..06953f7 100644 --- a/src/queue.rs +++ b/src/queue.rs @@ -1,10 +1,15 @@ //! Implements a queue for the bot to play songs in order +use std::sync::Arc; + use anyhow::Result; +use parking_lot::Mutex; +use poise::async_trait; use songbird::{ + events::EventData, input::Input, tracks::{self, TrackHandle}, - Driver, + Driver, Event, EventContext, EventHandler, TrackEvent, }; use thiserror::Error; @@ -14,19 +19,69 @@ pub enum QueueError { EmptyQueue, } +/// Event handler for the queue +struct QueueHandler { + remote_lock: Arc>, +} + +#[async_trait] +impl EventHandler for QueueHandler { + async fn act(&self, ctx: &EventContext<'_>) -> Option { + let mut inner = self.remote_lock.lock(); + + // Due to possibility that users might remove, reorder, + // or dequeue+stop tracks, we need to verify that the FIRST + // track is the one who has ended. + match ctx { + EventContext::Track(ts) => { + // This slice should have exactly one entry. + // If the ended track has same id as the queue head, then + // we can progress the queue. + if inner.tracks.first()?.uuid() != ts.first()?.1.uuid() { + return None; + } + } + _ => return None, + } + + let _old = inner.tracks.remove(0); + + // Keep going until we find one track which works, or we run out. + while let Some(new) = inner.tracks.first() { + if new.play().is_err() { + // Discard files which cannot be used for whatever reason. + inner.tracks.remove(0); + } else { + break; + } + } + + None + } +} + +/// Inner queue data behind a Mutex to allow the event handler to access it +struct QueueCore { + tracks: Vec, +} + +/// A queue of tracks to play pub struct Queue { - queue: Vec, + inner: Arc>, } impl Queue { #[must_use] pub fn new() -> Self { - Self { queue: Vec::new() } + Self { + inner: Arc::new(Mutex::new(QueueCore { tracks: Vec::new() })), + } } /// Resumes the current track pub fn resume(&mut self) -> Result<()> { - let Some(track) = self.queue.first() else { + let inner = self.inner.lock(); + let Some(track) = inner.tracks.first() else { return Err(QueueError::EmptyQueue.into()); }; track.play()?; @@ -35,17 +90,19 @@ impl Queue { /// Stops the current track and removes it from the queue pub fn stop(&mut self) -> Result<()> { - let Some(track) = self.queue.first() else { + let mut inner = self.inner.lock(); + let Some(track) = inner.tracks.first() else { return Err(QueueError::EmptyQueue.into()); }; track.stop()?; - self.queue.remove(0); + inner.tracks.remove(0); Ok(()) } /// Pauses the current track pub fn pause(&mut self) -> Result<()> { - let Some(track) = self.queue.first() else { + let inner = self.inner.lock(); + let Some(track) = inner.tracks.first() else { return Err(QueueError::EmptyQueue.into()); }; track.pause()?; @@ -54,9 +111,25 @@ impl Queue { /// Adds a track to the end of the queue pub fn add_to_end(&mut self, source: Input, handler: &mut Driver) -> TrackHandle { + let mut inner = self.inner.lock(); let (mut track, handle) = tracks::create_player(source); track.pause(); - self.queue.push(handle.clone()); + let position = track.position(); + // Event to remove the track from the queue when it ends + track + .events + .as_mut() + .expect("Why is this even an Option?") + .add_event( + EventData::new( + Event::Track(TrackEvent::End), + QueueHandler { + remote_lock: self.inner.clone(), + }, + ), + position, + ); + inner.tracks.push(handle.clone()); handler.play(track); handle } @@ -76,12 +149,13 @@ impl Queue { /// Adds a track to play next pub fn add_next(&mut self, source: Input, handler: &mut Driver) -> TrackHandle { + let mut inner = self.inner.lock(); let (mut track, handle) = tracks::create_player(source); track.pause(); - if self.queue.is_empty() { - self.queue.push(handle.clone()); + if inner.tracks.is_empty() { + inner.tracks.push(handle.clone()); } else { - self.queue.insert(1, handle.clone()); + inner.tracks.insert(1, handle.clone()); } handler.play(track); handle @@ -89,7 +163,8 @@ impl Queue { /// Clears the queue pub fn clear(&mut self) { - for track in self.queue.drain(..) { + let mut inner = self.inner.lock(); + for track in inner.tracks.drain(..) { let _ = track.stop(); } } @@ -97,6 +172,7 @@ impl Queue { /// Returns whether the queue is empty #[must_use] pub fn is_empty(&self) -> bool { - self.queue.is_empty() + let inner = self.inner.lock(); + inner.tracks.is_empty() } } From 825e15202ea247b34471d528bd30540f6147c68d Mon Sep 17 00:00:00 2001 From: Alex Page Date: Wed, 8 Mar 2023 18:57:03 -0500 Subject: [PATCH 17/47] Make sure to add track event handler --- src/queue.rs | 70 +++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/src/queue.rs b/src/queue.rs index 06953f7..9062b6a 100644 --- a/src/queue.rs +++ b/src/queue.rs @@ -1,6 +1,6 @@ //! Implements a queue for the bot to play songs in order -use std::sync::Arc; +use std::{collections::VecDeque, sync::Arc}; use anyhow::Result; use parking_lot::Mutex; @@ -8,7 +8,7 @@ use poise::async_trait; use songbird::{ events::EventData, input::Input, - tracks::{self, TrackHandle}, + tracks::{self, Track, TrackHandle}, Driver, Event, EventContext, EventHandler, TrackEvent, }; use thiserror::Error; @@ -19,11 +19,31 @@ pub enum QueueError { EmptyQueue, } +/// Inner queue data behind a Mutex to allow the event handler to access it +struct QueueCore { + tracks: VecDeque, +} + /// Event handler for the queue struct QueueHandler { remote_lock: Arc>, } +impl QueueHandler { + /// Event to remove the track from the queue when it ends + pub fn register_track_end_event(track: &mut Track, remote_lock: Arc>) { + let position = track.position(); + track + .events + .as_mut() + .expect("Why is this even an Option?") + .add_event( + EventData::new(Event::Track(TrackEvent::End), QueueHandler { remote_lock }), + position, + ); + } +} + #[async_trait] impl EventHandler for QueueHandler { async fn act(&self, ctx: &EventContext<'_>) -> Option { @@ -37,20 +57,20 @@ impl EventHandler for QueueHandler { // This slice should have exactly one entry. // If the ended track has same id as the queue head, then // we can progress the queue. - if inner.tracks.first()?.uuid() != ts.first()?.1.uuid() { + if inner.tracks.front()?.uuid() != ts.first()?.1.uuid() { return None; } } _ => return None, } - let _old = inner.tracks.remove(0); + let _old = inner.tracks.pop_front(); // Keep going until we find one track which works, or we run out. - while let Some(new) = inner.tracks.first() { + while let Some(new) = inner.tracks.front() { if new.play().is_err() { // Discard files which cannot be used for whatever reason. - inner.tracks.remove(0); + inner.tracks.pop_front(); } else { break; } @@ -60,11 +80,6 @@ impl EventHandler for QueueHandler { } } -/// Inner queue data behind a Mutex to allow the event handler to access it -struct QueueCore { - tracks: Vec, -} - /// A queue of tracks to play pub struct Queue { inner: Arc>, @@ -74,14 +89,16 @@ impl Queue { #[must_use] pub fn new() -> Self { Self { - inner: Arc::new(Mutex::new(QueueCore { tracks: Vec::new() })), + inner: Arc::new(Mutex::new(QueueCore { + tracks: VecDeque::new(), + })), } } /// Resumes the current track pub fn resume(&mut self) -> Result<()> { let inner = self.inner.lock(); - let Some(track) = inner.tracks.first() else { + let Some(track) = inner.tracks.front() else { return Err(QueueError::EmptyQueue.into()); }; track.play()?; @@ -91,18 +108,18 @@ impl Queue { /// Stops the current track and removes it from the queue pub fn stop(&mut self) -> Result<()> { let mut inner = self.inner.lock(); - let Some(track) = inner.tracks.first() else { + let Some(track) = inner.tracks.front() else { return Err(QueueError::EmptyQueue.into()); }; track.stop()?; - inner.tracks.remove(0); + inner.tracks.pop_front(); Ok(()) } /// Pauses the current track pub fn pause(&mut self) -> Result<()> { let inner = self.inner.lock(); - let Some(track) = inner.tracks.first() else { + let Some(track) = inner.tracks.front() else { return Err(QueueError::EmptyQueue.into()); }; track.pause()?; @@ -114,22 +131,8 @@ impl Queue { let mut inner = self.inner.lock(); let (mut track, handle) = tracks::create_player(source); track.pause(); - let position = track.position(); - // Event to remove the track from the queue when it ends - track - .events - .as_mut() - .expect("Why is this even an Option?") - .add_event( - EventData::new( - Event::Track(TrackEvent::End), - QueueHandler { - remote_lock: self.inner.clone(), - }, - ), - position, - ); - inner.tracks.push(handle.clone()); + QueueHandler::register_track_end_event(&mut track, self.inner.clone()); + inner.tracks.push_back(handle.clone()); handler.play(track); handle } @@ -152,8 +155,9 @@ impl Queue { let mut inner = self.inner.lock(); let (mut track, handle) = tracks::create_player(source); track.pause(); + QueueHandler::register_track_end_event(&mut track, self.inner.clone()); if inner.tracks.is_empty() { - inner.tracks.push(handle.clone()); + inner.tracks.push_back(handle.clone()); } else { inner.tracks.insert(1, handle.clone()); } From b3bd3b2997e8e770938d142ccaaf1722bbc83cd3 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Wed, 8 Mar 2023 19:08:06 -0500 Subject: [PATCH 18/47] Add todo list --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 4b1d6de..cf00c4c 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,8 @@ This is a Discord bot that uses [serenity](https://crates.io/crates/serenity) and [songbird](https://crates.io/crates/songbird) to play music in a channel. It's very heavily tailored to the needs of the `Cats? Cats.` community. You need libopus, ffmpeg, and youtube-dl as described in the [songbird readme](https://github.com/serenity-rs/songbird#dependencies). + +## TODO: +- [ ] Loop +- [ ] Volume +- [ ] Support YT playlists From 3faa422b9002e45d207be1a90e72bf3fe8ca6f5d Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 9 Mar 2023 17:37:00 -0500 Subject: [PATCH 19/47] Use sparse cargo registry --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 742607f..1a8c29b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,9 @@ -FROM rust:1 as builder +FROM rust:1.68 as builder ARG OPENAI_KEY RUN apt-get update && apt-get --no-install-recommends install -y libopus-dev WORKDIR /usr/src/myapp COPY . . +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse RUN cargo install --path . FROM debian:bullseye-slim From 863fcb08122116b9180653271fa806f7cd345733 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 9 Mar 2023 17:50:31 -0500 Subject: [PATCH 20/47] Run as unprivileged user --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 1a8c29b..e89bbad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,4 +12,6 @@ RUN apt-get update && apt-get --no-install-recommends install -y python3 python3 RUN python3 -m pip install -U pip setuptools wheel RUN python3 -m pip install --force-reinstall https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz COPY --from=builder /usr/local/cargo/bin/dj_kitty_cat /usr/local/bin/dj_kitty_cat +RUN useradd djkk +USER djkk CMD ["dj_kitty_cat"] From 8a56fcf126b01a45c4d10c1e7c637cfeebd6508d Mon Sep 17 00:00:00 2001 From: Alex Page Date: Sat, 18 Mar 2023 00:35:55 -0400 Subject: [PATCH 21/47] Bump songbird version --- Cargo.toml | 2 +- README.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 493ee1c..236fe81 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ rand = "0.8.5" thiserror = "1.0.39" [dependencies.songbird] -version = "0.3.0" +version = "0.3.1" features = ["yt-dlp"] [dependencies.tokio] diff --git a/README.md b/README.md index cf00c4c..ee8fb1a 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ This is a Discord bot that uses [serenity](https://crates.io/crates/serenity) an You need libopus, ffmpeg, and youtube-dl as described in the [songbird readme](https://github.com/serenity-rs/songbird#dependencies). ## TODO: +- [ ] Error Messages - [ ] Loop - [ ] Volume - [ ] Support YT playlists From 22eba91a176e7cb5c3f59df4560dc374f0f4658e Mon Sep 17 00:00:00 2001 From: Alex Page Date: Sat, 18 Mar 2023 01:06:50 -0400 Subject: [PATCH 22/47] Use env var to configure logging --- Cargo.toml | 5 ++++- src/main.rs | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 236fe81..3bdcc68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,12 +8,15 @@ anyhow = "1.0.69" parking_lot = "0.12.1" poise = "0.5.2" tracing = "0.1.37" -tracing-subscriber = "0.3.16" tracing-futures = "0.2.5" openai = "1.0.0-alpha.6" rand = "0.8.5" thiserror = "1.0.39" +[dependencies.tracing-subscriber] +version = "0.3.16" +features = ["fmt", "env-filter", "std"] + [dependencies.songbird] version = "0.3.1" features = ["yt-dlp"] diff --git a/src/main.rs b/src/main.rs index 7a0e67d..e1640a3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,6 +5,7 @@ mod personality; mod queue; use commands::*; +use tracing_subscriber::{fmt, prelude::*, EnvFilter}; use std::{env, sync::Arc}; @@ -42,7 +43,10 @@ async fn register(ctx: CommandContext<'_>) -> Result<(), Error> { #[tokio::main] async fn main() -> Result<()> { - tracing_subscriber::fmt().init(); + tracing_subscriber::registry() + .with(fmt::layer()) + .with(EnvFilter::from_default_env()) + .init(); let token = env::var("DISCORD_TOKEN").expect("Expected a bot token in the environment: DISCORD_TOKEN"); From b2505ce0860f9d8ac073b3e09e57d9f9d07aaeb8 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Sat, 18 Mar 2023 02:40:07 -0400 Subject: [PATCH 23/47] Log JSON parsing errors --- src/commands.rs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/commands.rs b/src/commands.rs index e87b1c4..647b213 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -91,7 +91,27 @@ pub async fn play( let mut handler = handler_lock.lock().await; debug!("Trying to play: {}", url); - let source = songbird::ytdl(&url).await?; + let source = songbird::ytdl(&url).await; + + let source = match source { + Ok(source) => source, + Err(e) => { + match e { + songbird::input::error::Error::Json { + ref error, + ref parsed_text, + } => { + debug!("Failed to play: {}", error); + debug!("Parsed text: {}", parsed_text); + } + _ => { + debug!("Failed to play: {}", e); + } + } + return Err(Box::new(e)); + } + }; + debug!("Playing: {:?}", source.metadata); let title = source .metadata From 46e22fb8f4d26dfd0b2df5b6f312f6c775b6e6d5 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Sat, 18 Mar 2023 02:42:51 -0400 Subject: [PATCH 24/47] Download yt-dlp nightly builds --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e89bbad..f9fc4ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,9 +8,9 @@ RUN cargo install --path . FROM debian:bullseye-slim COPY --from=mwader/static-ffmpeg:6.0 /ffmpeg /usr/local/bin/ -RUN apt-get update && apt-get --no-install-recommends install -y python3 python3-pip libopus0 -RUN python3 -m pip install -U pip setuptools wheel -RUN python3 -m pip install --force-reinstall https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz +RUN apt-get update && apt-get --no-install-recommends install -y libopus0 +ADD https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp_linux /usr/local/bin/yt-dlp +RUN chmod 755 /usr/local/bin/yt-dlp COPY --from=builder /usr/local/cargo/bin/dj_kitty_cat /usr/local/bin/dj_kitty_cat RUN useradd djkk USER djkk From c732e1d27b9693bb127feb9e7012f563981f8693 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Sat, 18 Mar 2023 02:55:57 -0400 Subject: [PATCH 25/47] Run as root for now It doesn't work as a normal user --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f9fc4ff..41745c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,4 @@ RUN apt-get update && apt-get --no-install-recommends install -y libopus0 ADD https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp_linux /usr/local/bin/yt-dlp RUN chmod 755 /usr/local/bin/yt-dlp COPY --from=builder /usr/local/cargo/bin/dj_kitty_cat /usr/local/bin/dj_kitty_cat -RUN useradd djkk -USER djkk CMD ["dj_kitty_cat"] From 8dab128679f048d08f26b4c7e848034b2807cf2a Mon Sep 17 00:00:00 2001 From: Alex Page Date: Sat, 18 Mar 2023 03:06:14 -0400 Subject: [PATCH 26/47] Install ca-certificates --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 41745c1..24b1d60 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN cargo install --path . FROM debian:bullseye-slim COPY --from=mwader/static-ffmpeg:6.0 /ffmpeg /usr/local/bin/ -RUN apt-get update && apt-get --no-install-recommends install -y libopus0 +RUN apt-get update && apt-get --no-install-recommends install -y libopus0 ca-certificates ADD https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp_linux /usr/local/bin/yt-dlp RUN chmod 755 /usr/local/bin/yt-dlp COPY --from=builder /usr/local/cargo/bin/dj_kitty_cat /usr/local/bin/dj_kitty_cat From 3cc4220317144c3cc28c597165f9e076880a71e4 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Sat, 18 Mar 2023 03:08:15 -0400 Subject: [PATCH 27/47] Clean up apt-get --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 24b1d60..05a5dd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN cargo install --path . FROM debian:bullseye-slim COPY --from=mwader/static-ffmpeg:6.0 /ffmpeg /usr/local/bin/ -RUN apt-get update && apt-get --no-install-recommends install -y libopus0 ca-certificates +RUN apt-get update && apt-get --no-install-recommends install -y libopus0 ca-certificates && apt-get clean ADD https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp_linux /usr/local/bin/yt-dlp RUN chmod 755 /usr/local/bin/yt-dlp COPY --from=builder /usr/local/cargo/bin/dj_kitty_cat /usr/local/bin/dj_kitty_cat From 0531ad769e00c4953694631082bf7ac5a0dbad0d Mon Sep 17 00:00:00 2001 From: Alex Page Date: Sat, 18 Mar 2023 03:10:29 -0400 Subject: [PATCH 28/47] Clean up the recommended way --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 05a5dd3..3ce6713 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,10 @@ RUN cargo install --path . FROM debian:bullseye-slim COPY --from=mwader/static-ffmpeg:6.0 /ffmpeg /usr/local/bin/ -RUN apt-get update && apt-get --no-install-recommends install -y libopus0 ca-certificates && apt-get clean +RUN apt-get update && apt-get --no-install-recommends install -y \ + libopus0 \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* ADD https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp_linux /usr/local/bin/yt-dlp RUN chmod 755 /usr/local/bin/yt-dlp COPY --from=builder /usr/local/cargo/bin/dj_kitty_cat /usr/local/bin/dj_kitty_cat From fd3ec019a8bf6fe2cad77ac6fdfd37cbde1dcc21 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Wed, 22 Mar 2023 20:12:02 -0400 Subject: [PATCH 29/47] Disable OpenAI integration in debug mode --- src/personality.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/personality.rs b/src/personality.rs index f1c5c2c..f95b634 100644 --- a/src/personality.rs +++ b/src/personality.rs @@ -33,6 +33,12 @@ pub fn get_random_loading_message() -> &'static str { } pub async fn get_sassy_commentary(title: &str) -> Result { + if cfg!(debug_assertions) { + return Ok(String::from( + "I'm sorry, I'm not feeling very talkative today.", + )); + } + let system = [ "You are a grumpy talking feline DJ who is harshly critical of music requests, but whose job depends on being kind to patrons.", "Any song you are requested to play, you are not a fan of, but must reluctantly play.", From 349d3fa425bf3c62199cbe7f5b0011d56a9862ca Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 23 Mar 2023 00:12:12 -0400 Subject: [PATCH 30/47] Run as non-root user with correct perms --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 3ce6713..20c608c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,4 +15,8 @@ RUN apt-get update && apt-get --no-install-recommends install -y \ ADD https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp_linux /usr/local/bin/yt-dlp RUN chmod 755 /usr/local/bin/yt-dlp COPY --from=builder /usr/local/cargo/bin/dj_kitty_cat /usr/local/bin/dj_kitty_cat +RUN useradd djkk +WORKDIR /opt +RUN chown djkk:djkk /opt +USER djkk CMD ["dj_kitty_cat"] From 0d896d30bd2ce64f4feff86ebc7e74f584a9a22c Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 23 Mar 2023 00:21:33 -0400 Subject: [PATCH 31/47] Use my fixed fork of yt-dlp --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 20c608c..ecd3a85 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN apt-get update && apt-get --no-install-recommends install -y \ libopus0 \ ca-certificates \ && rm -rf /var/lib/apt/lists/* -ADD https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp_linux /usr/local/bin/yt-dlp +ADD https://github.com/anpage/yt-dlp/releases/download/2023.03.23.040309/yt-dlp_linux /usr/local/bin/yt-dlp RUN chmod 755 /usr/local/bin/yt-dlp COPY --from=builder /usr/local/cargo/bin/dj_kitty_cat /usr/local/bin/dj_kitty_cat RUN useradd djkk From f438fb73411c0ed3b5a72a46e594ef4f820fafa3 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Wed, 29 Mar 2023 00:12:42 -0400 Subject: [PATCH 32/47] =?UTF-8?q?Upgrade=20to=20GPT-4=20=F0=9F=92=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 2 +- src/main.rs | 3 +++ src/personality.rs | 7 ++----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3bdcc68..95b242d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ parking_lot = "0.12.1" poise = "0.5.2" tracing = "0.1.37" tracing-futures = "0.2.5" -openai = "1.0.0-alpha.6" +openai = "1.0.0-alpha.8" rand = "0.8.5" thiserror = "1.0.39" diff --git a/src/main.rs b/src/main.rs index e1640a3..3b171b9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,6 +5,7 @@ mod personality; mod queue; use commands::*; +use openai::set_key; use tracing_subscriber::{fmt, prelude::*, EnvFilter}; use std::{env, sync::Arc}; @@ -48,6 +49,8 @@ async fn main() -> Result<()> { .with(EnvFilter::from_default_env()) .init(); + set_key(env::var("OPENAI_KEY").expect("Expected an OpenAI key in the environment: OPENAI_KEY")); + let token = env::var("DISCORD_TOKEN").expect("Expected a bot token in the environment: DISCORD_TOKEN"); diff --git a/src/personality.rs b/src/personality.rs index f95b634..8f2203c 100644 --- a/src/personality.rs +++ b/src/personality.rs @@ -1,8 +1,5 @@ use anyhow::{Context, Result}; -use openai::{ - chat::{ChatCompletion, ChatCompletionMessage}, - models::ModelID, -}; +use openai::chat::{ChatCompletion, ChatCompletionMessage}; use rand::seq::SliceRandom; const LOADING_MESSAGES: [&str; 20] = [ @@ -57,7 +54,7 @@ pub async fn get_sassy_commentary(title: &str) -> Result { let prompt = format!("Play \"{title}\""); let completion = ChatCompletion::builder( - ModelID::Gpt3_5Turbo, + "gpt-4", [ system .into_iter() From 952cf0cdb6d4b27c676cfbe7308ccc2df95073f5 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Wed, 24 May 2023 22:57:30 -0400 Subject: [PATCH 33/47] Update rust and yt-dlp --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ecd3a85..3f40c4d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.68 as builder +FROM rust:1.69 as builder ARG OPENAI_KEY RUN apt-get update && apt-get --no-install-recommends install -y libopus-dev WORKDIR /usr/src/myapp @@ -11,8 +11,8 @@ COPY --from=mwader/static-ffmpeg:6.0 /ffmpeg /usr/local/bin/ RUN apt-get update && apt-get --no-install-recommends install -y \ libopus0 \ ca-certificates \ - && rm -rf /var/lib/apt/lists/* -ADD https://github.com/anpage/yt-dlp/releases/download/2023.03.23.040309/yt-dlp_linux /usr/local/bin/yt-dlp + && rm -rf /var/lib/apt/lists/* +ADD https://github.com/anpage/yt-dlp/releases/download/2023.05.25.023208/yt-dlp_linux /usr/local/bin/yt-dlp RUN chmod 755 /usr/local/bin/yt-dlp COPY --from=builder /usr/local/cargo/bin/dj_kitty_cat /usr/local/bin/dj_kitty_cat RUN useradd djkk From e58e70509c37aa8e4ccccf53bfba1105a8c75431 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Jan 2024 12:42:57 -0500 Subject: [PATCH 34/47] [WIP] Upgrade to poise 0.6 --- Cargo.toml | 5 ++--- src/main.rs | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 95b242d..993ec08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] anyhow = "1.0.69" parking_lot = "0.12.1" -poise = "0.5.2" +poise = "0.6.1" tracing = "0.1.37" tracing-futures = "0.2.5" openai = "1.0.0-alpha.8" @@ -18,8 +18,7 @@ version = "0.3.16" features = ["fmt", "env-filter", "std"] [dependencies.songbird] -version = "0.3.1" -features = ["yt-dlp"] +version = "0.4.0" [dependencies.tokio] version = "1.26.0" diff --git a/src/main.rs b/src/main.rs index 3b171b9..b00554c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,8 +12,7 @@ use std::{env, sync::Arc}; use anyhow::Result; use parking_lot::Mutex; -use poise::serenity_prelude::{self as serenity}; -use songbird::serenity::SerenityInit; +use poise::serenity_prelude as serenity; pub struct Data { queue: Arc>, @@ -23,11 +22,11 @@ pub type CommandContext<'a> = poise::Context<'a, Data, Error>; async fn event_event_handler( _ctx: &serenity::Context, - event: &poise::Event<'_>, + event: &serenity::FullEvent, _framework: poise::FrameworkContext<'_, Data, Error>, _user_data: &Data, ) -> Result<(), Error> { - if let poise::Event::Ready { data_about_bot } = event { + if let serenity::FullEvent::Ready { data_about_bot } = event { println!("{} is connected!", data_about_bot.user.name) } @@ -75,10 +74,8 @@ async fn main() -> Result<()> { let intents = serenity::GatewayIntents::non_privileged(); - poise::Framework::builder() - .token(token) + let framework = poise::Framework::builder() .options(options) - .intents(intents) .setup(|_ctx, _data, _framework| { Box::pin(async move { Ok(Data { @@ -86,8 +83,12 @@ async fn main() -> Result<()> { }) }) }) - .client_settings(|client_builder| client_builder.register_songbird()) - .run() + .build(); + + let client = serenity::ClientBuilder::new(token, intents) + .framework(framework) + .await? + .start() .await?; Ok(()) From 66b215a0cbba9fa4ff8f10710ee94863cd956010 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Jan 2024 12:57:30 -0500 Subject: [PATCH 35/47] [WIP] Fix loading gif replies --- src/commands.rs | 50 +++++++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 647b213..6ab4f15 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1,5 +1,5 @@ use anyhow::{Context, Result}; -use poise::serenity_prelude::{EmbedMessageBuilding, MessageBuilder}; +use poise::serenity_prelude::{CreateEmbed, EmbedMessageBuilding, MessageBuilder}; use tracing::{debug, log::warn}; use crate::{personality, CommandContext, Error}; @@ -11,7 +11,11 @@ pub async fn join(ctx: CommandContext<'_>) -> Result<(), Error> { return Ok(()); }; - let Some(Some(channel_id)) = guild.voice_states.get(&ctx.author().id).map(|vs| vs.channel_id) else { + let Some(Some(channel_id)) = guild + .voice_states + .get(&ctx.author().id) + .map(|vs| vs.channel_id) + else { ctx.say("You're not in a voice channel, silly.").await?; return Ok(()); }; @@ -72,21 +76,26 @@ pub async fn play( .clone(); if manager.get(guild.id).is_none() { - let Some(Some(channel_id)) = guild.voice_states.get(&ctx.author().id).map(|vs| vs.channel_id) else { - ctx.say("Neither of us are in a voice channel, silly.").await?; + let Some(Some(channel_id)) = guild + .voice_states + .get(&ctx.author().id) + .map(|vs| vs.channel_id) + else { + ctx.say("Neither of us are in a voice channel, silly.") + .await?; return Ok(()); }; let _handler = manager.join(guild.id, channel_id).await; } if let Some(handler_lock) = manager.get(guild.id) { - let mut msg = MessageBuilder::new(); - msg.push_line(String::from(personality::get_random_loading_message())) - .push_named_link( - "", - "https://media.giphy.com/media/H1dxi6xdh4NGQCZSvz/giphy.gif", + let reply = poise::CreateReply::default() + .content(personality::get_random_loading_message()) + .embed( + CreateEmbed::new() + .image("https://media.giphy.com/media/H1dxi6xdh4NGQCZSvz/giphy.gif"), ); - let response = ctx.send(|r| r.content(msg.build())).await?; + let response = ctx.send(reply).await?; let mut handler = handler_lock.lock().await; @@ -170,21 +179,26 @@ pub async fn queue( .clone(); if manager.get(guild.id).is_none() { - let Some(Some(channel_id)) = guild.voice_states.get(&ctx.author().id).map(|vs| vs.channel_id) else { - ctx.say("Neither of us are in a voice channel, silly.").await?; + let Some(Some(channel_id)) = guild + .voice_states + .get(&ctx.author().id) + .map(|vs| vs.channel_id) + else { + ctx.say("Neither of us are in a voice channel, silly.") + .await?; return Ok(()); }; let _handler = manager.join(guild.id, channel_id).await; } if let Some(handler_lock) = manager.get(guild.id) { - let mut msg = MessageBuilder::new(); - msg.push_line(String::from(personality::get_random_loading_message())) - .push_named_link( - "", - "https://media.giphy.com/media/H1dxi6xdh4NGQCZSvz/giphy.gif", + let reply = poise::CreateReply::default() + .content(personality::get_random_loading_message()) + .embed( + CreateEmbed::new() + .image("https://media.giphy.com/media/H1dxi6xdh4NGQCZSvz/giphy.gif"), ); - let response = ctx.send(|r| r.content(msg.build())).await?; + let response = ctx.send(reply).await?; let mut handler = handler_lock.lock().await; From 424446961056420f88d4cb0b424b4def12b58f22 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Jan 2024 13:03:26 -0500 Subject: [PATCH 36/47] [WIP] Remember to register songbird --- src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.rs b/src/main.rs index b00554c..e4372ae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,7 @@ mod queue; use commands::*; use openai::set_key; +use songbird::SerenityInit; use tracing_subscriber::{fmt, prelude::*, EnvFilter}; use std::{env, sync::Arc}; @@ -87,6 +88,7 @@ async fn main() -> Result<()> { let client = serenity::ClientBuilder::new(token, intents) .framework(framework) + .register_songbird() .await? .start() .await?; From ec6682260256594f93b1b567328565138f559aa9 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Jan 2024 17:50:05 -0500 Subject: [PATCH 37/47] Finish upgrading pose and songbird --- .gitignore | 4 - Cargo.lock | 3124 +++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 15 +- src/commands.rs | 145 +-- src/main.rs | 11 +- src/queue.rs | 47 +- 6 files changed, 3221 insertions(+), 125 deletions(-) create mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore index 5ea5efc..6b5ff0a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,10 +3,6 @@ debug/ target/ -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - # These are backup files generated by rustfmt **/*.rs.bk diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..5e485af --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,3124 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +dependencies = [ + "serde", +] + +[[package]] +name = "async-trait" +version = "0.1.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "audiopus" +version = "0.3.0-rc.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab55eb0e56d7c6de3d59f544e5db122d7725ec33be6a276ee8241f3be6473955" +dependencies = [ + "audiopus_sys", +] + +[[package]] +name = "audiopus_sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62314a1546a2064e033665d658e88c620a62904be945f8147e6b16c3db9f8651" +dependencies = [ + "cmake", + "log", + "pkg-config", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "bytecount" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" + +[[package]] +name = "bytemuck" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "serde", + "windows-targets 0.52.0", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", + "zeroize", +] + +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "rand_core", + "typenum", +] + +[[package]] +name = "crypto_secretbox" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d6cf87adf719ddf43a805e92c6870a531aedda35ff640442cbaf8674e141e1" +dependencies = [ + "aead", + "cipher", + "generic-array", + "poly1305", + "salsa20", + "subtle", + "zeroize", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core 0.20.3", + "darling_macro 0.20.3", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.48", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core 0.20.3", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown", + "lock_api", + "once_cell", + "parking_lot_core", + "serde", +] + +[[package]] +name = "data-encoding" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "discortp" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c793408a15d361754613fa68123ffa60424c2617fafdf82127b4bedf37d3f5d" +dependencies = [ + "pnet_macros", + "pnet_macros_support", +] + +[[package]] +name = "dj_kitty_cat" +version = "0.2.0" +dependencies = [ + "anyhow", + "openai", + "parking_lot", + "poise", + "rand", + "reqwest", + "songbird", + "symphonia", + "thiserror", + "tokio", + "tracing", + "tracing-futures", + "tracing-subscriber", +] + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "error-chain" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" +dependencies = [ + "version_check", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "futures-core", + "futures-sink", + "nanorand", + "spin 0.9.8", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "generator" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "h2" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "hermit-abi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" + +[[package]] +name = "http" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls 0.21.10", + "tokio", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "js-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "mini-moka" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c325dfab65f261f386debee8b0969da215b3fa0037e74c8a1234db7ba986d803" +dependencies = [ + "crossbeam-channel", + "crossbeam-utils", + "dashmap", + "skeptic", + "smallvec", + "tagptr", + "triomphe", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" +dependencies = [ + "getrandom", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "no-std-net" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-complex" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openai" +version = "1.0.0-alpha.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee36bba3836458bc93e5196fb3db43bff8758975d7059d259532464a33cc4d8" +dependencies = [ + "derive_builder", + "reqwest", + "serde", + "serde_json", +] + +[[package]] +name = "openssl" +version = "0.10.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" +dependencies = [ + "bitflags 2.4.2", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "ordered-float" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" + +[[package]] +name = "pnet_base" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe4cf6fb3ab38b68d01ab2aea03ed3d1132b4868fa4e06285f29f16da01c5f4c" +dependencies = [ + "no-std-net", +] + +[[package]] +name = "pnet_macros" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688b17499eee04a0408aca0aa5cba5fc86401d7216de8a63fdf7a4c227871804" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "syn 2.0.48", +] + +[[package]] +name = "pnet_macros_support" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eea925b72f4bd37f8eab0f221bbe4c78b63498350c983ffa9dd4bcde7e030f56" +dependencies = [ + "pnet_base", +] + +[[package]] +name = "poise" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1819d5a45e3590ef33754abce46432570c54a120798bdbf893112b4211fa09a6" +dependencies = [ + "async-trait", + "derivative", + "futures-util", + "parking_lot", + "poise_macros", + "regex", + "serenity", + "tokio", + "tracing", +] + +[[package]] +name = "poise_macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fa2c123c961e78315cd3deac7663177f12be4460f5440dbf62a7ed37b1effea" +dependencies = [ + "darling 0.20.3", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "primal-check" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9df7f93fd637f083201473dab4fee2db4c429d32e55e3299980ab3957ab916a0" +dependencies = [ + "num-integer", +] + +[[package]] +name = "proc-macro2" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "pulldown-cmark" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" +dependencies = [ + "bitflags 1.3.2", + "memchr", + "unicase", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "realfft" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953d9f7e5cdd80963547b456251296efc2626ed4e3cbf36c869d9564e0220571" +dependencies = [ + "rustfft", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "regex" +version = "1.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.5", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "mime_guess", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls 0.21.10", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "system-configuration", + "tokio", + "tokio-native-tls", + "tokio-rustls 0.24.1", + "tokio-util", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "ringbuf" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79abed428d1fd2a128201cec72c5f6938e2da607c6f3745f769fabea399d950a" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "rubato" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6dd52e80cfc21894deadf554a5673002938ae4625f7a283e536f9cf7c17b0d5" +dependencies = [ + "num-complex", + "num-integer", + "num-traits", + "realfft", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustfft" +version = "6.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43806561bc506d0c5d160643ad742e3161049ac01027b5e6d7524091fd401d86" +dependencies = [ + "num-complex", + "num-integer", + "num-traits", + "primal-check", + "strength_reduce", + "transpose", + "version_check", +] + +[[package]] +name = "rustix" +version = "0.38.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +dependencies = [ + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +dependencies = [ + "log", + "ring 0.16.20", + "sct", + "webpki", +] + +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "log", + "ring 0.17.7", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.7", + "untrusted 0.9.0", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "rusty_pool" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ed36cdb20de66d89a17ea04b8883fc7a386f2cf877aaedca5005583ce4876ff" +dependencies = [ + "crossbeam-channel", + "futures", + "futures-channel", + "futures-executor", + "num_cpus", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring 0.17.7", + "untrusted 0.9.0", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "serde", + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-aux" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a86348501c129f3ad50c2f4635a01971f76974cd8a3f335988a0f1581c082765" +dependencies = [ + "chrono", + "serde", + "serde_json", +] + +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "serde_json" +version = "1.0.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serenity" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385647faa24a889929028973650a4f158fb1b4272b2fcf94feb9fcc3c009e813" +dependencies = [ + "arrayvec", + "async-trait", + "base64 0.21.7", + "bitflags 2.4.2", + "bytes", + "chrono", + "dashmap", + "flate2", + "futures", + "fxhash", + "mime_guess", + "parking_lot", + "percent-encoding", + "reqwest", + "secrecy", + "serde", + "serde_json", + "time", + "tokio", + "tokio-tungstenite 0.20.1", + "tracing", + "typemap_rev", + "typesize", + "url", +] + +[[package]] +name = "serenity-voice-model" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "593682f6155d07c8b331b3d1060f5aab7e6796caca9f2f66bd9e6855c880e06b" +dependencies = [ + "bitflags 2.4.2", + "num-traits", + "serde", + "serde_json", + "serde_repr", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "skeptic" +version = "0.13.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" +dependencies = [ + "bytecount", + "cargo_metadata", + "error-chain", + "glob", + "pulldown-cmark", + "tempfile", + "walkdir", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "songbird" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b905d2cdd4becf0e643a4aa5491cdfe8f193d5676b5bae7c0460e0e3c6358d63" +dependencies = [ + "async-trait", + "audiopus", + "byteorder", + "crypto_secretbox", + "dashmap", + "derivative", + "discortp", + "flume", + "futures", + "nohash-hasher", + "once_cell", + "parking_lot", + "pin-project", + "rand", + "reqwest", + "ringbuf", + "rubato", + "rusty_pool", + "serde", + "serde-aux", + "serde_json", + "serenity", + "serenity-voice-model", + "socket2", + "streamcatcher", + "symphonia", + "symphonia-core", + "tokio", + "tokio-tungstenite 0.20.1", + "tokio-util", + "tracing", + "tracing-futures", + "twilight-gateway", + "typemap_rev", + "url", + "uuid", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "streamcatcher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71664755c349abb0758fda6218fb2d2391ca2a73f9302c03b145491db4fcea29" +dependencies = [ + "crossbeam-utils", + "futures-util", + "loom", +] + +[[package]] +name = "strength_reduce" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "symphonia" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62e48dba70095f265fdb269b99619b95d04c89e619538138383e63310b14d941" +dependencies = [ + "lazy_static", + "symphonia-bundle-flac", + "symphonia-codec-adpcm", + "symphonia-codec-pcm", + "symphonia-codec-vorbis", + "symphonia-core", + "symphonia-format-mkv", + "symphonia-format-ogg", + "symphonia-format-wav", + "symphonia-metadata", +] + +[[package]] +name = "symphonia-bundle-flac" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f23b0482a7cb18fcdf9981ab0b78df800ef0080187d294650023c462439058d" +dependencies = [ + "log", + "symphonia-core", + "symphonia-metadata", + "symphonia-utils-xiph", +] + +[[package]] +name = "symphonia-codec-adpcm" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "870e7dc1865d818c7b6318879d060553a73a3b2a3b8443dff90910f10ac41150" +dependencies = [ + "log", + "symphonia-core", +] + +[[package]] +name = "symphonia-codec-pcm" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47f1fbd220a06a641c8ce2ddad10f5ef6ee5cc0c54d9044d25d43b0d3119deaa" +dependencies = [ + "log", + "symphonia-core", +] + +[[package]] +name = "symphonia-codec-vorbis" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3953397e3506aa01350c4205817e4f95b58d476877a42f0458d07b665749e203" +dependencies = [ + "log", + "symphonia-core", + "symphonia-utils-xiph", +] + +[[package]] +name = "symphonia-core" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c73eb88fee79705268cc7b742c7bc93a7b76e092ab751d0833866970754142" +dependencies = [ + "arrayvec", + "bitflags 1.3.2", + "bytemuck", + "lazy_static", + "log", +] + +[[package]] +name = "symphonia-format-mkv" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5c61dfc851ad25d4043d8c231d8617e8f7cd02a6cc0edad21ade21848d58895" +dependencies = [ + "lazy_static", + "log", + "symphonia-core", + "symphonia-metadata", + "symphonia-utils-xiph", +] + +[[package]] +name = "symphonia-format-ogg" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bf1a00ccd11452d44048a0368828040f778ae650418dbd9d8765b7ee2574c8d" +dependencies = [ + "log", + "symphonia-core", + "symphonia-metadata", + "symphonia-utils-xiph", +] + +[[package]] +name = "symphonia-format-wav" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da76614728fa27c003bdcdfbac51396bd8fcbf94c95fe8e62f1d2bac58ef03a4" +dependencies = [ + "log", + "symphonia-core", + "symphonia-metadata", +] + +[[package]] +name = "symphonia-metadata" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89c3e1937e31d0e068bbe829f66b2f2bfaa28d056365279e0ef897172c3320c0" +dependencies = [ + "encoding_rs", + "lazy_static", + "log", + "symphonia-core", +] + +[[package]] +name = "symphonia-utils-xiph" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a450ca645b80d69aff8b35576cbfdc7f20940b29998202aab910045714c951f8" +dependencies = [ + "symphonia-core", + "symphonia-metadata", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + +[[package]] +name = "tempfile" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "thiserror" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +dependencies = [ + "deranged", + "itoa", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls 0.20.9", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.10", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54319c93411147bced34cb5609a80e0a8e44c5999c93903a81cd866630ec0bfd" +dependencies = [ + "futures-util", + "log", + "rustls 0.20.9", + "rustls-native-certs", + "tokio", + "tokio-rustls 0.23.4", + "tungstenite 0.18.0", + "webpki", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +dependencies = [ + "futures-util", + "log", + "rustls 0.21.10", + "tokio", + "tokio-rustls 0.24.1", + "tungstenite 0.20.1", + "webpki-roots", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "transpose" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6522d49d03727ffb138ae4cbc1283d3774f0d10aa7f9bf52e6784c45daf9b23" +dependencies = [ + "num-integer", + "strength_reduce", +] + +[[package]] +name = "triomphe" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "tungstenite" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" +dependencies = [ + "base64 0.13.1", + "byteorder", + "bytes", + "http", + "httparse", + "log", + "rand", + "rustls 0.20.9", + "sha1", + "thiserror", + "url", + "utf-8", + "webpki", +] + +[[package]] +name = "tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http", + "httparse", + "log", + "rand", + "rustls 0.21.10", + "sha1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "twilight-gateway" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30be5c7e2b13b4a59e0f93344c070c23404279a318a324eece1f4384ead47d86" +dependencies = [ + "bitflags 1.3.2", + "futures-util", + "rand", + "rustls 0.20.9", + "rustls-native-certs", + "serde", + "serde_json", + "tokio", + "tokio-tungstenite 0.18.0", + "tracing", + "twilight-gateway-queue", + "twilight-model", +] + +[[package]] +name = "twilight-gateway-queue" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3073747da8e1d09bc5383eed750451c9534021c8206a20092405b9855b3cb35a" +dependencies = [ + "tokio", + "tracing", +] + +[[package]] +name = "twilight-model" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276bd50f4817b3b421395afac89f5d7b61fdfd0f00a28b2a7db983e4878b4a1a" +dependencies = [ + "bitflags 1.3.2", + "serde", + "serde-value", + "serde_repr", + "time", +] + +[[package]] +name = "typemap_rev" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74b08b0c1257381af16a5c3605254d529d3e7e109f3c62befc5d168968192998" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "typesize" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36924509726e38224322c8c90ddfbf4317324338327b7c11b7cf8672cb786da1" +dependencies = [ + "chrono", + "dashmap", + "hashbrown", + "mini-moka", + "parking_lot", + "secrecy", + "serde_json", + "time", + "typesize-derive", + "url", +] + +[[package]] +name = "typesize-derive" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b122284365ba8497be951b9a21491f70c9688eb6fddc582931a0703f6a00ece" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "uuid" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +dependencies = [ + "getrandom", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" + +[[package]] +name = "wasm-streams" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +dependencies = [ + "ring 0.17.7", + "untrusted 0.9.0", +] + +[[package]] +name = "webpki-roots" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/Cargo.toml b/Cargo.toml index 993ec08..7a3f32a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,15 +11,18 @@ tracing = "0.1.37" tracing-futures = "0.2.5" openai = "1.0.0-alpha.8" rand = "0.8.5" +reqwest = "0.11.23" +songbird = "0.4.0" thiserror = "1.0.39" -[dependencies.tracing-subscriber] -version = "0.3.16" -features = ["fmt", "env-filter", "std"] - -[dependencies.songbird] -version = "0.4.0" +[dependencies.symphonia] +version = "0.5.2" +features = ["mkv"] [dependencies.tokio] version = "1.26.0" features = ["macros", "rt-multi-thread", "signal"] + +[dependencies.tracing-subscriber] +version = "0.3.18" +features = ["fmt", "env-filter", "std"] diff --git a/src/commands.rs b/src/commands.rs index 6ab4f15..57a1c75 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1,21 +1,20 @@ use anyhow::{Context, Result}; -use poise::serenity_prelude::{CreateEmbed, EmbedMessageBuilding, MessageBuilder}; +use poise::{ + serenity_prelude::{CreateEmbed, EmbedMessageBuilding, MessageBuilder}, + CreateReply, +}; +use songbird::input::{Input, YoutubeDl}; use tracing::{debug, log::warn}; use crate::{personality, CommandContext, Error}; #[poise::command(slash_command)] pub async fn join(ctx: CommandContext<'_>) -> Result<(), Error> { - let Some(guild) = ctx.guild() else { - ctx.say("You're not in a server, silly.").await?; - return Ok(()); - }; - - let Some(Some(channel_id)) = guild - .voice_states - .get(&ctx.author().id) - .map(|vs| vs.channel_id) - else { + let Some((guild_id, Some(channel_id))) = ctx.guild().and_then(|g| { + g.voice_states + .get(&ctx.author().id) + .map(|vs| (g.id, vs.channel_id)) + }) else { ctx.say("You're not in a voice channel, silly.").await?; return Ok(()); }; @@ -24,7 +23,7 @@ pub async fn join(ctx: CommandContext<'_>) -> Result<(), Error> { .await .context("Expected a songbird manager")? .clone(); - let _handler = manager.join(guild.id, channel_id).await; + let _handler = manager.join(guild_id, channel_id).await; ctx.say("Joining your channel!").await?; @@ -33,7 +32,7 @@ pub async fn join(ctx: CommandContext<'_>) -> Result<(), Error> { #[poise::command(slash_command)] pub async fn leave(ctx: CommandContext<'_>) -> Result<(), Error> { - let Some(guild) = ctx.guild() else { + let Some(guild_id) = ctx.guild().map(|g| g.id) else { ctx.say("You're not in a server, silly.").await?; return Ok(()); }; @@ -43,12 +42,12 @@ pub async fn leave(ctx: CommandContext<'_>) -> Result<(), Error> { .context("Expected a songbird manager")? .clone(); - if manager.get(guild.id).is_none() { + if manager.get(guild_id).is_none() { ctx.say("I'm not even in a voice channel!").await?; return Ok(()); } - let _handler = manager.remove(guild.id).await; + let _handler = manager.remove(guild_id).await; ctx.say("Okay bye!").await?; @@ -65,7 +64,7 @@ pub async fn play( return Ok(()); }; - let Some(guild) = ctx.guild() else { + let Some(guild_id) = ctx.guild().map(|g| g.id) else { ctx.say("You're not in a server, silly.").await?; return Ok(()); }; @@ -75,20 +74,19 @@ pub async fn play( .context("Expected a songbird manager")? .clone(); - if manager.get(guild.id).is_none() { - let Some(Some(channel_id)) = guild - .voice_states - .get(&ctx.author().id) - .map(|vs| vs.channel_id) - else { - ctx.say("Neither of us are in a voice channel, silly.") - .await?; + if manager.get(guild_id).is_none() { + let Some((guild_id, Some(channel_id))) = ctx.guild().and_then(|g| { + g.voice_states + .get(&ctx.author().id) + .map(|vs| (g.id, vs.channel_id)) + }) else { + ctx.say("You're not in a voice channel, silly.").await?; return Ok(()); }; - let _handler = manager.join(guild.id, channel_id).await; + let _handler = manager.join(guild_id, channel_id).await; } - if let Some(handler_lock) = manager.get(guild.id) { + if let Some(handler_lock) = manager.get(guild_id) { let reply = poise::CreateReply::default() .content(personality::get_random_loading_message()) .embed( @@ -100,33 +98,11 @@ pub async fn play( let mut handler = handler_lock.lock().await; debug!("Trying to play: {}", url); - let source = songbird::ytdl(&url).await; + let mut source: Input = YoutubeDl::new(ctx.data().http_client.clone(), url.clone()).into(); + let metadata = source.aux_metadata().await?; - let source = match source { - Ok(source) => source, - Err(e) => { - match e { - songbird::input::error::Error::Json { - ref error, - ref parsed_text, - } => { - debug!("Failed to play: {}", error); - debug!("Parsed text: {}", parsed_text); - } - _ => { - debug!("Failed to play: {}", e); - } - } - return Err(Box::new(e)); - } - }; - - debug!("Playing: {:?}", source.metadata); - let title = source - .metadata - .title - .clone() - .unwrap_or(String::from("This video")); + debug!("Playing: {:?}", metadata); + let title = metadata.title.clone().unwrap_or(String::from("This video")); let mut msg = MessageBuilder::new(); @@ -142,13 +118,15 @@ pub async fn play( msg.push_bold("Now playing: ").push_named_link(title, url); - response.edit(ctx, |r| r.content(msg.build())).await?; + response + .edit(ctx, CreateReply::default().content(msg.build())) + .await?; let mut queue = ctx.data().queue.lock(); if !queue.is_empty() { let _ = queue.stop(); } - queue.add_next(source, &mut handler); + queue.add_next(source, &mut handler)?; queue.resume()?; } else { ctx.say("Neither of us are in a voice channel, silly.") @@ -168,7 +146,7 @@ pub async fn queue( return Ok(()); }; - let Some(guild) = ctx.guild() else { + let Some(guild_id) = ctx.guild().map(|g| g.id) else { ctx.say("You're not in a server, silly.").await?; return Ok(()); }; @@ -178,20 +156,19 @@ pub async fn queue( .context("Expected a songbird manager")? .clone(); - if manager.get(guild.id).is_none() { - let Some(Some(channel_id)) = guild - .voice_states - .get(&ctx.author().id) - .map(|vs| vs.channel_id) - else { - ctx.say("Neither of us are in a voice channel, silly.") - .await?; + if manager.get(guild_id).is_none() { + let Some((guild_id, Some(channel_id))) = ctx.guild().and_then(|g| { + g.voice_states + .get(&ctx.author().id) + .map(|vs| (g.id, vs.channel_id)) + }) else { + ctx.say("You're not in a voice channel, silly.").await?; return Ok(()); }; - let _handler = manager.join(guild.id, channel_id).await; + let _handler = manager.join(guild_id, channel_id).await; } - if let Some(handler_lock) = manager.get(guild.id) { + if let Some(handler_lock) = manager.get(guild_id) { let reply = poise::CreateReply::default() .content(personality::get_random_loading_message()) .embed( @@ -203,13 +180,11 @@ pub async fn queue( let mut handler = handler_lock.lock().await; debug!("Trying to play: {}", url); - let source = songbird::ytdl(&url).await?; - debug!("Playing: {:?}", source.metadata); - let title = source - .metadata - .title - .clone() - .unwrap_or(String::from("This video")); + let mut source: Input = YoutubeDl::new(ctx.data().http_client.clone(), url.clone()).into(); + let metadata = source.aux_metadata().await?; + + debug!("Playing: {:?}", metadata); + let title = metadata.title.clone().unwrap_or(String::from("This video")); let mut msg = MessageBuilder::new(); @@ -225,10 +200,12 @@ pub async fn queue( msg.push_bold("Queued: ").push_named_link(title, url); - response.edit(ctx, |r| r.content(msg.build())).await?; + response + .edit(ctx, CreateReply::default().content(msg.build())) + .await?; let mut queue = ctx.data().queue.lock(); - queue.add_to_end(source, &mut handler); + queue.add_to_end(source, &mut handler)?; } else { ctx.say("Neither of us are in a voice channel, silly.") .await?; @@ -239,7 +216,7 @@ pub async fn queue( #[poise::command(slash_command)] pub async fn stop(ctx: CommandContext<'_>) -> Result<(), Error> { - let Some(guild) = ctx.guild() else { + let Some(guild_id) = ctx.guild().map(|g| g.id) else { ctx.say("You're not in a server, silly.").await?; return Ok(()); }; @@ -249,7 +226,7 @@ pub async fn stop(ctx: CommandContext<'_>) -> Result<(), Error> { .context("Expected a songbird manager")? .clone(); - if manager.get(guild.id).is_some() { + if manager.get(guild_id).is_some() { { let mut queue = ctx.data().queue.lock(); queue.stop()?; @@ -265,7 +242,7 @@ pub async fn stop(ctx: CommandContext<'_>) -> Result<(), Error> { #[poise::command(slash_command)] pub async fn skip(ctx: CommandContext<'_>) -> Result<(), Error> { - let Some(guild) = ctx.guild() else { + let Some(guild_id) = ctx.guild().map(|g| g.id) else { ctx.say("You're not in a server, silly.").await?; return Ok(()); }; @@ -275,7 +252,7 @@ pub async fn skip(ctx: CommandContext<'_>) -> Result<(), Error> { .context("Expected a songbird manager")? .clone(); - if manager.get(guild.id).is_some() { + if manager.get(guild_id).is_some() { { let mut queue = ctx.data().queue.lock(); let _ = queue.stop(); @@ -292,7 +269,7 @@ pub async fn skip(ctx: CommandContext<'_>) -> Result<(), Error> { #[poise::command(slash_command)] pub async fn pause(ctx: CommandContext<'_>) -> Result<(), Error> { - let Some(guild) = ctx.guild() else { + let Some(guild_id) = ctx.guild().map(|g| g.id) else { ctx.say("You're not in a server, silly.").await?; return Ok(()); }; @@ -302,7 +279,7 @@ pub async fn pause(ctx: CommandContext<'_>) -> Result<(), Error> { .context("Expected a songbird manager")? .clone(); - if manager.get(guild.id).is_some() { + if manager.get(guild_id).is_some() { { let mut queue = ctx.data().queue.lock(); queue.pause()?; @@ -318,7 +295,7 @@ pub async fn pause(ctx: CommandContext<'_>) -> Result<(), Error> { #[poise::command(slash_command)] pub async fn resume(ctx: CommandContext<'_>) -> Result<(), Error> { - let Some(guild) = ctx.guild() else { + let Some(guild_id) = ctx.guild().map(|g| g.id) else { ctx.say("You're not in a server, silly.").await?; return Ok(()); }; @@ -328,7 +305,7 @@ pub async fn resume(ctx: CommandContext<'_>) -> Result<(), Error> { .context("Expected a songbird manager")? .clone(); - if manager.get(guild.id).is_some() { + if manager.get(guild_id).is_some() { { let mut queue = ctx.data().queue.lock(); queue.resume()?; @@ -344,7 +321,7 @@ pub async fn resume(ctx: CommandContext<'_>) -> Result<(), Error> { #[poise::command(slash_command)] pub async fn clear(ctx: CommandContext<'_>) -> Result<(), Error> { - let Some(guild) = ctx.guild() else { + let Some(guild_id) = ctx.guild().map(|g| g.id) else { ctx.say("You're not in a server, silly.").await?; return Ok(()); }; @@ -354,7 +331,7 @@ pub async fn clear(ctx: CommandContext<'_>) -> Result<(), Error> { .context("Expected a songbird manager")? .clone(); - if manager.get(guild.id).is_some() { + if manager.get(guild_id).is_some() { { let mut queue = ctx.data().queue.lock(); queue.clear(); diff --git a/src/main.rs b/src/main.rs index e4372ae..adfe770 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,17 +5,19 @@ mod personality; mod queue; use commands::*; -use openai::set_key; -use songbird::SerenityInit; -use tracing_subscriber::{fmt, prelude::*, EnvFilter}; use std::{env, sync::Arc}; use anyhow::Result; +use openai::set_key; use parking_lot::Mutex; use poise::serenity_prelude as serenity; +use reqwest::Client as HttpClient; +use songbird::SerenityInit; +use tracing_subscriber::{fmt, prelude::*, EnvFilter}; pub struct Data { + http_client: HttpClient, queue: Arc>, } pub type Error = Box; @@ -80,13 +82,14 @@ async fn main() -> Result<()> { .setup(|_ctx, _data, _framework| { Box::pin(async move { Ok(Data { + http_client: HttpClient::new(), queue: Arc::new(Mutex::new(queue::Queue::new())), }) }) }) .build(); - let client = serenity::ClientBuilder::new(token, intents) + serenity::ClientBuilder::new(token, intents) .framework(framework) .register_songbird() .await? diff --git a/src/queue.rs b/src/queue.rs index 9062b6a..ca86e84 100644 --- a/src/queue.rs +++ b/src/queue.rs @@ -6,9 +6,8 @@ use anyhow::Result; use parking_lot::Mutex; use poise::async_trait; use songbird::{ - events::EventData, input::Input, - tracks::{self, Track, TrackHandle}, + tracks::{Track, TrackHandle}, Driver, Event, EventContext, EventHandler, TrackEvent, }; use thiserror::Error; @@ -31,16 +30,12 @@ struct QueueHandler { impl QueueHandler { /// Event to remove the track from the queue when it ends - pub fn register_track_end_event(track: &mut Track, remote_lock: Arc>) { - let position = track.position(); - track - .events - .as_mut() - .expect("Why is this even an Option?") - .add_event( - EventData::new(Event::Track(TrackEvent::End), QueueHandler { remote_lock }), - position, - ); + pub fn register_track_end_event( + track: &mut TrackHandle, + remote_lock: Arc>, + ) -> Result<()> { + track.add_event(Event::Track(TrackEvent::End), QueueHandler { remote_lock })?; + Ok(()) } } @@ -127,14 +122,13 @@ impl Queue { } /// Adds a track to the end of the queue - pub fn add_to_end(&mut self, source: Input, handler: &mut Driver) -> TrackHandle { + pub fn add_to_end(&mut self, source: Input, handler: &mut Driver) -> Result { let mut inner = self.inner.lock(); - let (mut track, handle) = tracks::create_player(source); - track.pause(); - QueueHandler::register_track_end_event(&mut track, self.inner.clone()); + let track = Track::from(source).pause(); + let mut handle = handler.play(track); + QueueHandler::register_track_end_event(&mut handle, self.inner.clone())?; inner.tracks.push_back(handle.clone()); - handler.play(track); - handle + Ok(handle) } /// Adds multiple tracks to the end of the queue @@ -142,27 +136,26 @@ impl Queue { &mut self, sources: Vec, handler: &mut Driver, - ) -> Vec { + ) -> Result> { let mut handles = Vec::new(); for source in sources { - handles.push(self.add_to_end(source, handler)); + handles.push(self.add_to_end(source, handler)?); } - handles + Ok(handles) } /// Adds a track to play next - pub fn add_next(&mut self, source: Input, handler: &mut Driver) -> TrackHandle { + pub fn add_next(&mut self, source: Input, handler: &mut Driver) -> Result { let mut inner = self.inner.lock(); - let (mut track, handle) = tracks::create_player(source); - track.pause(); - QueueHandler::register_track_end_event(&mut track, self.inner.clone()); + let track = Track::from(source).pause(); + let mut handle = handler.play(track); + QueueHandler::register_track_end_event(&mut handle, self.inner.clone())?; if inner.tracks.is_empty() { inner.tracks.push_back(handle.clone()); } else { inner.tracks.insert(1, handle.clone()); } - handler.play(track); - handle + Ok(handle) } /// Clears the queue From ddaf3ee7f2691e7696ab18d6e6b83bdcd997d904 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Jan 2024 18:28:28 -0500 Subject: [PATCH 38/47] Switch from openai to async-openai crate --- Cargo.lock | 119 +++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 1 + src/main.rs | 4 ++ src/personality.rs | 86 +++++++++++++++++--------------- 4 files changed, 171 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5e485af..1dc9c91 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -66,6 +66,40 @@ dependencies = [ "serde", ] +[[package]] +name = "async-convert" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d416feee97712e43152cd42874de162b8f9b77295b1c85e5d92725cc8310bae" +dependencies = [ + "async-trait", +] + +[[package]] +name = "async-openai" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b85a7e8b74ef2a2f93f6c360db1778ee86cd62b273407e70f908f477dc93436" +dependencies = [ + "async-convert", + "backoff", + "base64 0.21.7", + "bytes", + "derive_builder", + "futures", + "rand", + "reqwest", + "reqwest-eventsource", + "secrecy", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-stream", + "tokio-util", + "tracing", +] + [[package]] name = "async-trait" version = "0.1.77" @@ -103,6 +137,20 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backoff" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" +dependencies = [ + "futures-core", + "getrandom", + "instant", + "pin-project-lite", + "rand", + "tokio", +] + [[package]] name = "backtrace" version = "0.3.69" @@ -502,6 +550,7 @@ name = "dj_kitty_cat" version = "0.2.0" dependencies = [ "anyhow", + "async-openai", "openai", "parking_lot", "poise", @@ -550,6 +599,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "eventsource-stream" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74fef4569247a5f429d9156b9d0a2599914385dd189c539334c625d8099d90ab" +dependencies = [ + "futures-core", + "nom", + "pin-project-lite", +] + [[package]] name = "fastrand" version = "2.0.1" @@ -679,6 +739,12 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + [[package]] name = "futures-util" version = "0.3.30" @@ -929,6 +995,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + [[package]] name = "ipnet" version = "2.9.0" @@ -1045,6 +1120,12 @@ dependencies = [ "triomphe", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.1" @@ -1104,6 +1185,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -1550,6 +1641,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls 0.21.10", + "rustls-native-certs", "rustls-pemfile", "serde", "serde_json", @@ -1569,6 +1661,22 @@ dependencies = [ "winreg", ] +[[package]] +name = "reqwest-eventsource" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f03f570355882dd8d15acc3a313841e6e90eddbc76a93c748fd82cc13ba9f51" +dependencies = [ + "eventsource-stream", + "futures-core", + "futures-timer", + "mime", + "nom", + "pin-project-lite", + "reqwest", + "thiserror", +] + [[package]] name = "ring" version = "0.16.20" @@ -2429,6 +2537,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-tungstenite" version = "0.18.0" diff --git a/Cargo.toml b/Cargo.toml index 7a3f32a..76e1b74 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ rand = "0.8.5" reqwest = "0.11.23" songbird = "0.4.0" thiserror = "1.0.39" +async-openai = "0.18.1" [dependencies.symphonia] version = "0.5.2" diff --git a/src/main.rs b/src/main.rs index adfe770..59e3614 100644 --- a/src/main.rs +++ b/src/main.rs @@ -51,6 +51,10 @@ async fn main() -> Result<()> { .with(EnvFilter::from_default_env()) .init(); + env::var("OPENAI_API_KEY") + .expect("Expected an OpenAI API key in the environment: OPENAI_API_KEY"); + + // OLD set_key(env::var("OPENAI_KEY").expect("Expected an OpenAI key in the environment: OPENAI_KEY")); let token = diff --git a/src/personality.rs b/src/personality.rs index 8f2203c..1295326 100644 --- a/src/personality.rs +++ b/src/personality.rs @@ -1,5 +1,9 @@ use anyhow::{Context, Result}; -use openai::chat::{ChatCompletion, ChatCompletionMessage}; +use async_openai::types::{ + ChatCompletionRequestAssistantMessageArgs, ChatCompletionRequestMessage, + ChatCompletionRequestSystemMessageArgs, ChatCompletionRequestUserMessageArgs, + CreateChatCompletionRequestArgs, +}; use rand::seq::SliceRandom; const LOADING_MESSAGES: [&str; 20] = [ @@ -53,48 +57,52 @@ pub async fn get_sassy_commentary(title: &str) -> Result { let prompt = format!("Play \"{title}\""); - let completion = ChatCompletion::builder( - "gpt-4", - [ - system - .into_iter() - .map(|s| ChatCompletionMessage { - role: openai::chat::ChatCompletionMessageRole::System, - content: String::from(s), - name: None, - }) - .collect::>(), - vec![ - ChatCompletionMessage { - role: openai::chat::ChatCompletionMessageRole::User, - content: String::from(example_prompt), - name: None, - }, - ChatCompletionMessage { - role: openai::chat::ChatCompletionMessageRole::Assistant, - content: String::from(example_response), - name: None, - }, - ChatCompletionMessage { - role: openai::chat::ChatCompletionMessageRole::User, - content: prompt, - name: None, - }, - ], - ] - .into_iter() - .flatten() - .collect::>(), - ) - .max_tokens(2048_u64) - .create() - .await??; + let client = async_openai::Client::new(); - Ok(completion + let request = CreateChatCompletionRequestArgs::default() + .model("gpt-4") + .messages( + [ + system + .into_iter() + .map(|s| { + ChatCompletionRequestSystemMessageArgs::default() + .content(s) + .build() + .unwrap() + .into() + }) + .collect::>(), + vec![ + ChatCompletionRequestUserMessageArgs::default() + .content(example_prompt) + .build()? + .into(), + ChatCompletionRequestAssistantMessageArgs::default() + .content(example_response) + .build()? + .into(), + ChatCompletionRequestUserMessageArgs::default() + .content(prompt) + .build()? + .into(), + ], + ] + .into_iter() + .flatten() + .collect::>(), + ) + .max_tokens(2048_u16) + .build()?; + + let response = client.chat().create(request).await?; + + response .choices .first() .context("No choices")? .message .content - .clone()) + .clone() + .context("No content") } From c9fcdba421ee1efe05aadc51028bf8e410434086 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Jan 2024 18:50:19 -0500 Subject: [PATCH 39/47] Switch to alpine in Docker --- Dockerfile | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3f40c4d..efc314b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,15 @@ -FROM rust:1.69 as builder -ARG OPENAI_KEY -RUN apt-get update && apt-get --no-install-recommends install -y libopus-dev +FROM rust:1.75-alpine3.19 as builder +ARG OPENAI_API_KEY +RUN apk add --no-cache musl-dev opus-dev WORKDIR /usr/src/myapp COPY . . -ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse RUN cargo install --path . -FROM debian:bullseye-slim -COPY --from=mwader/static-ffmpeg:6.0 /ffmpeg /usr/local/bin/ -RUN apt-get update && apt-get --no-install-recommends install -y \ - libopus0 \ - ca-certificates \ - && rm -rf /var/lib/apt/lists/* -ADD https://github.com/anpage/yt-dlp/releases/download/2023.05.25.023208/yt-dlp_linux /usr/local/bin/yt-dlp -RUN chmod 755 /usr/local/bin/yt-dlp +FROM alpine:3.19 +RUN apk add --no-cache opus ca-certificates yt-dlp COPY --from=builder /usr/local/cargo/bin/dj_kitty_cat /usr/local/bin/dj_kitty_cat -RUN useradd djkk +RUN useradd djkc WORKDIR /opt -RUN chown djkk:djkk /opt -USER djkk +RUN chown djkc:djkc /opt +USER djkc CMD ["dj_kitty_cat"] From e9b38c069a9fb702be01b1a1da407a425e7ddbfb Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Jan 2024 19:09:54 -0500 Subject: [PATCH 40/47] Remove old openai crate --- Cargo.lock | 116 ---------------------------------------------------- Cargo.toml | 7 +++- src/main.rs | 4 -- 3 files changed, 5 insertions(+), 122 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1dc9c91..0577f90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -551,7 +551,6 @@ version = "0.2.0" dependencies = [ "anyhow", "async-openai", - "openai", "parking_lot", "poise", "rand", @@ -644,21 +643,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -924,19 +908,6 @@ dependencies = [ "tokio-rustls 0.24.1", ] -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", -] - [[package]] name = "iana-time-zone" version = "0.1.59" @@ -1155,24 +1126,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "no-std-net" version = "0.6.0" @@ -1264,62 +1217,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "openai" -version = "1.0.0-alpha.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee36bba3836458bc93e5196fb3db43bff8758975d7059d259532464a33cc4d8" -dependencies = [ - "derive_builder", - "reqwest", - "serde", - "serde_json", -] - -[[package]] -name = "openssl" -version = "0.10.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" -dependencies = [ - "bitflags 2.4.2", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-sys" -version = "0.9.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "ordered-float" version = "2.10.1" @@ -1630,13 +1533,11 @@ dependencies = [ "http-body", "hyper", "hyper-rustls", - "hyper-tls", "ipnet", "js-sys", "log", "mime", "mime_guess", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -1648,7 +1549,6 @@ dependencies = [ "serde_urlencoded", "system-configuration", "tokio", - "tokio-native-tls", "tokio-rustls 0.24.1", "tokio-util", "tower-service", @@ -2506,16 +2406,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.23.4" @@ -2903,12 +2793,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.4" diff --git a/Cargo.toml b/Cargo.toml index 76e1b74..4e3d295 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,13 +9,16 @@ parking_lot = "0.12.1" poise = "0.6.1" tracing = "0.1.37" tracing-futures = "0.2.5" -openai = "1.0.0-alpha.8" rand = "0.8.5" -reqwest = "0.11.23" songbird = "0.4.0" thiserror = "1.0.39" async-openai = "0.18.1" +[dependencies.reqwest] +version = "0.11.23" +default-features = false +features = ["rustls-tls"] + [dependencies.symphonia] version = "0.5.2" features = ["mkv"] diff --git a/src/main.rs b/src/main.rs index 59e3614..59bfa16 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,6 @@ use commands::*; use std::{env, sync::Arc}; use anyhow::Result; -use openai::set_key; use parking_lot::Mutex; use poise::serenity_prelude as serenity; use reqwest::Client as HttpClient; @@ -54,9 +53,6 @@ async fn main() -> Result<()> { env::var("OPENAI_API_KEY") .expect("Expected an OpenAI API key in the environment: OPENAI_API_KEY"); - // OLD - set_key(env::var("OPENAI_KEY").expect("Expected an OpenAI key in the environment: OPENAI_KEY")); - let token = env::var("DISCORD_TOKEN").expect("Expected a bot token in the environment: DISCORD_TOKEN"); From eb48999aa279bf7bd577c3e87bd8acdeb64e882f Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Jan 2024 19:12:52 -0500 Subject: [PATCH 41/47] Remove OPENAI_API_KEY from build stage --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index efc314b..497efeb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ FROM rust:1.75-alpine3.19 as builder -ARG OPENAI_API_KEY RUN apk add --no-cache musl-dev opus-dev WORKDIR /usr/src/myapp COPY . . From a5cb54d2145d51abbe88f2da7b58de784cd9cdab Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Jan 2024 19:54:11 -0500 Subject: [PATCH 42/47] Downgrade Alpine and install static yt-dlp --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 497efeb..8c9620c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,14 @@ -FROM rust:1.75-alpine3.19 as builder -RUN apk add --no-cache musl-dev opus-dev +FROM rust:1.74.1-alpine3.17 as builder +RUN apk add --no-cache musl-dev opus-dev pkgconfig WORKDIR /usr/src/myapp COPY . . RUN cargo install --path . FROM alpine:3.19 -RUN apk add --no-cache opus ca-certificates yt-dlp +ADD https://github.com/yt-dlp/yt-dlp/releases/download/2023.12.30/yt-dlp_linux /usr/local/bin/yt-dlp +RUN chmod 755 /usr/local/bin/yt-dlp COPY --from=builder /usr/local/cargo/bin/dj_kitty_cat /usr/local/bin/dj_kitty_cat -RUN useradd djkc +RUN adduser -D djkc WORKDIR /opt RUN chown djkc:djkc /opt USER djkc From 943f0f267867bd288ecd14bd15092a0d8e6b5b7b Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Jan 2024 20:10:40 -0500 Subject: [PATCH 43/47] Install yt-dlp-core from Alpine repos --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8c9620c..555d46b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,7 @@ COPY . . RUN cargo install --path . FROM alpine:3.19 -ADD https://github.com/yt-dlp/yt-dlp/releases/download/2023.12.30/yt-dlp_linux /usr/local/bin/yt-dlp -RUN chmod 755 /usr/local/bin/yt-dlp +RUN apk add --no-cache yt-dlp-core COPY --from=builder /usr/local/cargo/bin/dj_kitty_cat /usr/local/bin/dj_kitty_cat RUN adduser -D djkc WORKDIR /opt From dc856ea3fdf8c23158102476aa31b346df060b6e Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Jan 2024 20:24:05 -0500 Subject: [PATCH 44/47] Use better error message when failing to get metadata --- src/commands.rs | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 57a1c75..1f81380 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -99,7 +99,19 @@ pub async fn play( debug!("Trying to play: {}", url); let mut source: Input = YoutubeDl::new(ctx.data().http_client.clone(), url.clone()).into(); - let metadata = source.aux_metadata().await?; + let metadata = match source.aux_metadata().await { + Ok(metadata) => metadata, + Err(_) => { + response + .edit( + ctx, + CreateReply::default() + .content("I couldn't find that video. Sorry! Maybe check your URL."), + ) + .await?; + return Ok(()); + } + }; debug!("Playing: {:?}", metadata); let title = metadata.title.clone().unwrap_or(String::from("This video")); @@ -181,7 +193,19 @@ pub async fn queue( debug!("Trying to play: {}", url); let mut source: Input = YoutubeDl::new(ctx.data().http_client.clone(), url.clone()).into(); - let metadata = source.aux_metadata().await?; + let metadata = match source.aux_metadata().await { + Ok(metadata) => metadata, + Err(_) => { + response + .edit( + ctx, + CreateReply::default() + .content("I couldn't find that video. Sorry! Maybe check your URL."), + ) + .await?; + return Ok(()); + } + }; debug!("Playing: {:?}", metadata); let title = metadata.title.clone().unwrap_or(String::from("This video")); From 32d35a2c02ded13b56983378b43365670d8b20f7 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Thu, 25 Jan 2024 20:38:06 -0500 Subject: [PATCH 45/47] Use tracing instead of println for connection message --- src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 59bfa16..1765820 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,8 +4,6 @@ mod commands; mod personality; mod queue; -use commands::*; - use std::{env, sync::Arc}; use anyhow::Result; @@ -13,8 +11,11 @@ use parking_lot::Mutex; use poise::serenity_prelude as serenity; use reqwest::Client as HttpClient; use songbird::SerenityInit; +use tracing::info; use tracing_subscriber::{fmt, prelude::*, EnvFilter}; +use commands::*; + pub struct Data { http_client: HttpClient, queue: Arc>, @@ -29,7 +30,7 @@ async fn event_event_handler( _user_data: &Data, ) -> Result<(), Error> { if let serenity::FullEvent::Ready { data_about_bot } = event { - println!("{} is connected!", data_about_bot.user.name) + info!("{} is connected!", data_about_bot.user.name) } Ok(()) From 709d4ab3a38a01226c34be26dabe6769a649d90c Mon Sep 17 00:00:00 2001 From: Alex Page Date: Mon, 29 Jan 2024 17:27:18 -0500 Subject: [PATCH 46/47] Add a bunch of codecs --- Cargo.lock | 37 +++++++++++++++++++++++++++++++++++++ Cargo.toml | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 0577f90..d175715 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2117,7 +2117,10 @@ checksum = "62e48dba70095f265fdb269b99619b95d04c89e619538138383e63310b14d941" dependencies = [ "lazy_static", "symphonia-bundle-flac", + "symphonia-bundle-mp3", + "symphonia-codec-aac", "symphonia-codec-adpcm", + "symphonia-codec-alac", "symphonia-codec-pcm", "symphonia-codec-vorbis", "symphonia-core", @@ -2139,6 +2142,30 @@ dependencies = [ "symphonia-utils-xiph", ] +[[package]] +name = "symphonia-bundle-mp3" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f31d7fece546f1e6973011a9eceae948133bbd18fd3d52f6073b1e38ae6368a" +dependencies = [ + "bitflags 1.3.2", + "lazy_static", + "log", + "symphonia-core", + "symphonia-metadata", +] + +[[package]] +name = "symphonia-codec-aac" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68bdd75b25ce4b84b12a4bd20bfea2460c2dbd7fc1d227ef5533504d3168109d" +dependencies = [ + "lazy_static", + "log", + "symphonia-core", +] + [[package]] name = "symphonia-codec-adpcm" version = "0.5.3" @@ -2149,6 +2176,16 @@ dependencies = [ "symphonia-core", ] +[[package]] +name = "symphonia-codec-alac" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a27e8763d1c9eff666faf903e73a99d4de2f7a93fca4e3c214c1d68432903b9" +dependencies = [ + "log", + "symphonia-core", +] + [[package]] name = "symphonia-codec-pcm" version = "0.5.3" diff --git a/Cargo.toml b/Cargo.toml index 4e3d295..64abd38 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ features = ["rustls-tls"] [dependencies.symphonia] version = "0.5.2" -features = ["mkv"] +features = ["mkv", "mp3", "flac", "ogg", "vorbis", "wav", "pcm", "aac", "alac", "adpcm"] [dependencies.tokio] version = "1.26.0" From 610229cd1ba323744296054c3eb2f14cc87a0c34 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Fri, 2 Aug 2024 23:23:28 -0400 Subject: [PATCH 47/47] Update dependencies --- Cargo.lock | 1142 ++++++++++++++++++++++++++++++++++------------------ Cargo.toml | 6 +- 2 files changed, 759 insertions(+), 389 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d175715..6ade2a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -29,9 +29,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -53,9 +53,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arrayvec" @@ -77,15 +77,15 @@ dependencies = [ [[package]] name = "async-openai" -version = "0.18.1" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b85a7e8b74ef2a2f93f6c360db1778ee86cd62b273407e70f908f477dc93436" +checksum = "dea5c9223f84965c603fd58c4c9ddcd1907efb2e54acf6fb47039358cd374df4" dependencies = [ "async-convert", "backoff", "base64 0.21.7", "bytes", - "derive_builder", + "derive_builder 0.12.0", "futures", "rand", "reqwest", @@ -102,13 +102,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -133,9 +133,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backoff" @@ -153,9 +153,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -178,6 +178,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "bitflags" version = "1.3.2" @@ -186,9 +192,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" @@ -201,21 +207,21 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytecount" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" +checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" [[package]] name = "bytemuck" -version = "1.14.1" +version = "1.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" +checksum = "102087e286b4677862ea56cf8fc58bb2cdfa8725c40ffb80fe3a008eb7f2fc83" [[package]] name = "byteorder" @@ -225,24 +231,24 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "camino" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] @@ -262,12 +268,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" [[package]] name = "cfg-if" @@ -277,15 +280,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] @@ -308,6 +311,12 @@ dependencies = [ "cc", ] +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "core-foundation" version = "0.9.4" @@ -335,27 +344,27 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-common" @@ -383,6 +392,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +dependencies = [ + "darling_core 0.10.2", + "darling_macro 0.10.2", +] + [[package]] name = "darling" version = "0.14.4" @@ -395,12 +414,26 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.3" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.3", - "darling_macro 0.20.3", + "darling_core 0.20.10", + "darling_macro 0.20.10", +] + +[[package]] +name = "darling_core" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.9.3", + "syn 1.0.109", ] [[package]] @@ -413,22 +446,33 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.10.0", "syn 1.0.109", ] [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim", - "syn 2.0.48", + "strsim 0.11.1", + "syn 2.0.72", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +dependencies = [ + "darling_core 0.10.2", + "quote", + "syn 1.0.109", ] [[package]] @@ -444,13 +488,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.20.3", + "darling_core 0.20.10", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -469,9 +513,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "deranged" @@ -494,6 +538,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2658621297f2cf68762a6f7dc0bb7e1ff2cfd6583daef8ee0fed6f7ec468ec0" +dependencies = [ + "darling 0.10.2", + "derive_builder_core 0.9.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_builder" version = "0.12.0" @@ -503,6 +560,18 @@ dependencies = [ "derive_builder_macro", ] +[[package]] +name = "derive_builder_core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2791ea3e372c8495c0bc2033991d76b512cd799d07491fbd6890124db9458bef" +dependencies = [ + "darling 0.10.2", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_builder_core" version = "0.12.0" @@ -521,10 +590,23 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" dependencies = [ - "derive_builder_core", + "derive_builder_core 0.12.0", "syn 1.0.109", ] +[[package]] +name = "derive_more" +version = "0.99.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.72", +] + [[package]] name = "digest" version = "0.10.7" @@ -566,9 +648,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -581,9 +663,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -610,16 +692,22 @@ dependencies = [ ] [[package]] -name = "fastrand" -version = "2.0.1" +name = "extended" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "af9673d8203fcb076b19dfd17e38b3d4ae9f44959416ea532ce72415a6020365" + +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -652,6 +740,15 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "from_map" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99f31122ab0445ff8cee420b805f24e07683073815de1dd276ee7d588d301700" +dependencies = [ + "hashmap_derive", +] + [[package]] name = "futures" version = "0.3.30" @@ -708,7 +805,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -725,9 +822,9 @@ checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" @@ -782,9 +879,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -795,9 +892,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "glob" @@ -807,16 +904,16 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.24" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.12", "indexmap", "slab", "tokio", @@ -826,21 +923,73 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashmap_derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb30bf173e72cc31b5265dac095423ca14e7789ff7c3b0e6096a37a996f12883" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hls_m3u8" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e2bd2de7f92b5301546ce1ac53a4ae5cf2f6b10751b100ab1efb73c19788fba" +dependencies = [ + "derive_builder 0.9.0", + "derive_more", + "hex", + "shorthand", + "stable-vec", + "strum", + "thiserror", +] [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -854,15 +1003,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.12", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -872,16 +1021,16 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", "h2", - "http", + "http 0.2.12", "http-body", "httparse", "httpdate", @@ -901,18 +1050,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http", + "http 0.2.12", "hyper", - "rustls 0.21.10", + "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", ] [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -949,9 +1098,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" dependencies = [ "equivalent", "hashbrown", @@ -968,9 +1117,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -983,42 +1132,42 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1026,9 +1175,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "loom" @@ -1056,9 +1205,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mime" @@ -1068,9 +1217,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -1099,22 +1248,23 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.10" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" dependencies = [ + "hermit-abi", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1126,6 +1276,12 @@ dependencies = [ "getrandom", ] +[[package]] +name = "no-std-compat" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df270209a7f04d62459240d890ecb792714d5db12c92937823574a09930276b4" + [[package]] name = "no-std-net" version = "0.6.0" @@ -1160,28 +1316,33 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", ] [[package]] -name = "num-integer" -version = "0.1.45" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -1198,9 +1359,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" dependencies = [ "memchr", ] @@ -1213,9 +1374,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl-probe" @@ -1240,9 +1401,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -1250,15 +1411,24 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "patricia_tree" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f2f4539bffe53fc4b4da301df49d114b845b077bd5727b7fe2bd9d8df2ae68" +dependencies = [ + "bitflags 2.6.0", ] [[package]] @@ -1269,29 +1439,29 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1301,9 +1471,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "pnet_base" @@ -1323,7 +1493,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -1358,10 +1528,10 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fa2c123c961e78315cd3deac7663177f12be4460f5440dbf62a7ed37b1effea" dependencies = [ - "darling 0.20.3", + "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -1383,44 +1553,47 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "primal-check" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9df7f93fd637f083201473dab4fee2db4c429d32e55e3299980ab3957ab916a0" +checksum = "dc0d895b311e3af9902528fbb8f928688abbd95872819320517cc24ca6b2bd08" dependencies = [ "num-integer", ] [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "pulldown-cmark" -version = "0.9.3" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" +checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "memchr", "unicase", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1466,23 +1639,23 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] name = "regex" -version = "1.10.3" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -1496,13 +1669,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.4", ] [[package]] @@ -1513,15 +1686,15 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", "bytes", @@ -1529,7 +1702,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", + "http 0.2.12", "http-body", "hyper", "hyper-rustls", @@ -1541,12 +1714,13 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.10", + "rustls 0.21.12", "rustls-native-certs", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-rustls 0.24.1", @@ -1557,7 +1731,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots", + "webpki-roots 0.25.4", "winreg", ] @@ -1594,32 +1768,33 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "ringbuf" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79abed428d1fd2a128201cec72c5f6938e2da607c6f3745f769fabea399d950a" +checksum = "5c65e4c865bc3d2e3294493dff0acf7e6c259d066e34e22059fa9c39645c3636" dependencies = [ "crossbeam-utils", ] [[package]] name = "rubato" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6dd52e80cfc21894deadf554a5673002938ae4625f7a283e536f9cf7c17b0d5" +checksum = "b5d18b486e7d29a408ef3f825bc1327d8f87af091c987ca2f5b734625940e234" dependencies = [ "num-complex", "num-integer", @@ -1629,9 +1804,18 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] [[package]] name = "rustfft" @@ -1650,11 +1834,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -1675,16 +1859,30 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.7", - "rustls-webpki", + "ring 0.17.8", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.6", + "subtle", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -1706,21 +1904,38 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "rustls-webpki" version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", + "untrusted 0.9.0", +] + +[[package]] +name = "rustls-webpki" +version = "0.102.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "rusty_pool" @@ -1737,9 +1952,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "salsa20" @@ -1786,7 +2001,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] @@ -1802,11 +2017,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -1815,9 +2030,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -1825,27 +2040,27 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.195" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde-aux" -version = "4.4.0" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a86348501c129f3ad50c2f4635a01971f76974cd8a3f335988a0f1581c082765" +checksum = "0d2e8bfba469d06512e11e3311d4d051a4a387a5b42d010404fecf3200321c95" dependencies = [ "chrono", "serde", @@ -1863,36 +2078,46 @@ dependencies = [ ] [[package]] -name = "serde_derive" -version = "1.0.195" +name = "serde_cow" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "1e7bbbec7196bfde255ab54b65e34087c0849629280028238e67ee25d6a4b7da" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.204" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "serde_repr" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -1909,14 +2134,14 @@ dependencies = [ [[package]] name = "serenity" -version = "0.12.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385647faa24a889929028973650a4f158fb1b4272b2fcf94feb9fcc3c009e813" +checksum = "880a04106592d0a8f5bdacb1d935889bfbccb4a14f7074984d9cd857235d34ac" dependencies = [ "arrayvec", "async-trait", - "base64 0.21.7", - "bitflags 2.4.2", + "base64 0.22.1", + "bitflags 2.6.0", "bytes", "chrono", "dashmap", @@ -1929,10 +2154,11 @@ dependencies = [ "reqwest", "secrecy", "serde", + "serde_cow", "serde_json", "time", "tokio", - "tokio-tungstenite 0.20.1", + "tokio-tungstenite 0.21.0", "tracing", "typemap_rev", "typesize", @@ -1945,7 +2171,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "593682f6155d07c8b331b3d1060f5aab7e6796caca9f2f66bd9e6855c880e06b" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "num-traits", "serde", "serde_json", @@ -1973,10 +2199,22 @@ dependencies = [ ] [[package]] -name = "signal-hook-registry" -version = "1.4.1" +name = "shorthand" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "474f77f985d8212610f170332eaf173e768404c0c1d4deb041f32c297cf18931" +dependencies = [ + "from_map", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -2007,29 +2245,30 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "songbird" -version = "0.4.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b905d2cdd4becf0e643a4aa5491cdfe8f193d5676b5bae7c0460e0e3c6358d63" +checksum = "338dd182f9f084f583c4c0db38588e28a34778ecec288208cf0b61c378ac90d1" dependencies = [ "async-trait", "audiopus", "byteorder", + "bytes", "crypto_secretbox", "dashmap", "derivative", @@ -2051,11 +2290,12 @@ dependencies = [ "serenity", "serenity-voice-model", "socket2", + "stream_lib", "streamcatcher", "symphonia", "symphonia-core", "tokio", - "tokio-tungstenite 0.20.1", + "tokio-tungstenite 0.21.0", "tokio-util", "tracing", "tracing-futures", @@ -2080,6 +2320,32 @@ dependencies = [ "lock_api", ] +[[package]] +name = "stable-vec" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1dff32a2ce087283bec878419027cebd888760d8760b2941ad0843531dc9ec8" +dependencies = [ + "no-std-compat", +] + +[[package]] +name = "stream_lib" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa3f10eb5a7054e17abf61d310e4e29108187a847591c63c4c79b6a74898a5a7" +dependencies = [ + "bytes", + "futures-core", + "futures-util", + "hls_m3u8", + "patricia_tree", + "reqwest", + "tokio", + "tracing", + "url", +] + [[package]] name = "streamcatcher" version = "1.0.1" @@ -2097,6 +2363,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" +[[package]] +name = "strsim" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" + [[package]] name = "strsim" version = "0.10.0" @@ -2104,16 +2376,43 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] -name = "subtle" -version = "2.5.0" +name = "strsim" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "530efb820d53b712f4e347916c5e7ed20deb76a4f0457943b3182fb889b06d2c" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6e163a520367c465f59e0a61a23cfae3b10b6546d78b6f672a382be79f7110" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "symphonia" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e48dba70095f265fdb269b99619b95d04c89e619538138383e63310b14d941" +checksum = "815c942ae7ee74737bb00f965fa5b5a2ac2ce7b6c01c0cc169bbeaf7abd5f5a9" dependencies = [ "lazy_static", "symphonia-bundle-flac", @@ -2126,15 +2425,15 @@ dependencies = [ "symphonia-core", "symphonia-format-mkv", "symphonia-format-ogg", - "symphonia-format-wav", + "symphonia-format-riff", "symphonia-metadata", ] [[package]] name = "symphonia-bundle-flac" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f23b0482a7cb18fcdf9981ab0b78df800ef0080187d294650023c462439058d" +checksum = "72e34f34298a7308d4397a6c7fbf5b84c5d491231ce3dd379707ba673ab3bd97" dependencies = [ "log", "symphonia-core", @@ -2144,11 +2443,10 @@ dependencies = [ [[package]] name = "symphonia-bundle-mp3" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f31d7fece546f1e6973011a9eceae948133bbd18fd3d52f6073b1e38ae6368a" +checksum = "c01c2aae70f0f1fb096b6f0ff112a930b1fb3626178fba3ae68b09dce71706d4" dependencies = [ - "bitflags 1.3.2", "lazy_static", "log", "symphonia-core", @@ -2157,9 +2455,9 @@ dependencies = [ [[package]] name = "symphonia-codec-aac" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bdd75b25ce4b84b12a4bd20bfea2460c2dbd7fc1d227ef5533504d3168109d" +checksum = "cdbf25b545ad0d3ee3e891ea643ad115aff4ca92f6aec472086b957a58522f70" dependencies = [ "lazy_static", "log", @@ -2168,9 +2466,9 @@ dependencies = [ [[package]] name = "symphonia-codec-adpcm" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870e7dc1865d818c7b6318879d060553a73a3b2a3b8443dff90910f10ac41150" +checksum = "c94e1feac3327cd616e973d5be69ad36b3945f16b06f19c6773fc3ac0b426a0f" dependencies = [ "log", "symphonia-core", @@ -2178,9 +2476,9 @@ dependencies = [ [[package]] name = "symphonia-codec-alac" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a27e8763d1c9eff666faf903e73a99d4de2f7a93fca4e3c214c1d68432903b9" +checksum = "2d8a6666649a08412906476a8b0efd9b9733e241180189e9f92b09c08d0e38f3" dependencies = [ "log", "symphonia-core", @@ -2188,9 +2486,9 @@ dependencies = [ [[package]] name = "symphonia-codec-pcm" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47f1fbd220a06a641c8ce2ddad10f5ef6ee5cc0c54d9044d25d43b0d3119deaa" +checksum = "f395a67057c2ebc5e84d7bb1be71cce1a7ba99f64e0f0f0e303a03f79116f89b" dependencies = [ "log", "symphonia-core", @@ -2198,9 +2496,9 @@ dependencies = [ [[package]] name = "symphonia-codec-vorbis" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3953397e3506aa01350c4205817e4f95b58d476877a42f0458d07b665749e203" +checksum = "5a98765fb46a0a6732b007f7e2870c2129b6f78d87db7987e6533c8f164a9f30" dependencies = [ "log", "symphonia-core", @@ -2209,9 +2507,9 @@ dependencies = [ [[package]] name = "symphonia-core" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c73eb88fee79705268cc7b742c7bc93a7b76e092ab751d0833866970754142" +checksum = "798306779e3dc7d5231bd5691f5a813496dc79d3f56bf82e25789f2094e022c3" dependencies = [ "arrayvec", "bitflags 1.3.2", @@ -2222,9 +2520,9 @@ dependencies = [ [[package]] name = "symphonia-format-mkv" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5c61dfc851ad25d4043d8c231d8617e8f7cd02a6cc0edad21ade21848d58895" +checksum = "1bb43471a100f7882dc9937395bd5ebee8329298e766250b15b3875652fe3d6f" dependencies = [ "lazy_static", "log", @@ -2235,9 +2533,9 @@ dependencies = [ [[package]] name = "symphonia-format-ogg" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bf1a00ccd11452d44048a0368828040f778ae650418dbd9d8765b7ee2574c8d" +checksum = "ada3505789516bcf00fc1157c67729eded428b455c27ca370e41f4d785bfa931" dependencies = [ "log", "symphonia-core", @@ -2246,11 +2544,12 @@ dependencies = [ ] [[package]] -name = "symphonia-format-wav" -version = "0.5.3" +name = "symphonia-format-riff" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da76614728fa27c003bdcdfbac51396bd8fcbf94c95fe8e62f1d2bac58ef03a4" +checksum = "05f7be232f962f937f4b7115cbe62c330929345434c834359425e043bfd15f50" dependencies = [ + "extended", "log", "symphonia-core", "symphonia-metadata", @@ -2258,9 +2557,9 @@ dependencies = [ [[package]] name = "symphonia-metadata" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89c3e1937e31d0e068bbe829f66b2f2bfaa28d056365279e0ef897172c3320c0" +checksum = "bc622b9841a10089c5b18e99eb904f4341615d5aa55bbf4eedde1be721a4023c" dependencies = [ "encoding_rs", "lazy_static", @@ -2270,9 +2569,9 @@ dependencies = [ [[package]] name = "symphonia-utils-xiph" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a450ca645b80d69aff8b35576cbfdc7f20940b29998202aab910045714c951f8" +checksum = "484472580fa49991afda5f6550ece662237b00c6f562c7d9638d1b086ed010fe" dependencies = [ "symphonia-core", "symphonia-metadata", @@ -2291,15 +2590,21 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "system-configuration" version = "0.5.1" @@ -2329,42 +2634,42 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "tempfile" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", + "once_cell", "rustix", "windows-sys 0.52.0", ] [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -2372,12 +2677,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -2392,18 +2698,19 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -2416,31 +2723,30 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -2460,15 +2766,26 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.10", + "rustls 0.21.12", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.4", + "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", @@ -2493,31 +2810,31 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" dependencies = [ "futures-util", "log", - "rustls 0.21.10", + "rustls 0.22.4", + "rustls-pki-types", "tokio", - "tokio-rustls 0.24.1", - "tungstenite 0.20.1", - "webpki-roots", + "tokio-rustls 0.25.0", + "tungstenite 0.21.0", + "webpki-roots 0.26.3", ] [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -2546,7 +2863,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -2600,9 +2917,9 @@ dependencies = [ [[package]] name = "transpose" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6522d49d03727ffb138ae4cbc1283d3774f0d10aa7f9bf52e6784c45daf9b23" +checksum = "1ad61aed86bc3faea4300c7aee358b4c6d0c8d6ccc36524c96e4c92ccf26e77e" dependencies = [ "num-integer", "strength_reduce", @@ -2610,9 +2927,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" +checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" [[package]] name = "try-lock" @@ -2629,7 +2946,7 @@ dependencies = [ "base64 0.13.1", "byteorder", "bytes", - "http", + "http 0.2.12", "httparse", "log", "rand", @@ -2643,18 +2960,19 @@ dependencies = [ [[package]] name = "tungstenite" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" dependencies = [ "byteorder", "bytes", "data-encoding", - "http", + "http 1.1.0", "httparse", "log", "rand", - "rustls 0.21.10", + "rustls 0.22.4", + "rustls-pki-types", "sha1", "thiserror", "url", @@ -2718,9 +3036,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "typesize" -version = "0.1.5" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36924509726e38224322c8c90ddfbf4317324338327b7c11b7cf8672cb786da1" +checksum = "eb704842c709bc76f63e99e704cb208beeccca2abbabd0d9aec02e48ca1cee0f" dependencies = [ "chrono", "dashmap", @@ -2736,13 +3054,13 @@ dependencies = [ [[package]] name = "typesize-derive" -version = "0.1.3" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b122284365ba8497be951b9a21491f70c9688eb6fddc582931a0703f6a00ece" +checksum = "905e88c2a4cc27686bd57e495121d451f027e441388a67f773be729ad4be1ea8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -2768,13 +3086,19 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + [[package]] name = "universal-hash" version = "0.5.1" @@ -2799,9 +3123,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -2817,9 +3141,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "uuid" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom", ] @@ -2832,15 +3156,15 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -2863,9 +3187,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2873,24 +3197,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -2900,9 +3224,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2910,28 +3234,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-streams" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" +checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" dependencies = [ "futures-util", "js-sys", @@ -2942,9 +3266,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -2956,15 +3280,24 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] [[package]] name = "webpki-roots" -version = "0.25.3" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + +[[package]] +name = "webpki-roots" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +dependencies = [ + "rustls-pki-types", +] [[package]] name = "winapi" @@ -2984,11 +3317,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -3012,7 +3345,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] @@ -3030,7 +3363,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -3050,17 +3392,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -3071,9 +3414,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -3083,9 +3426,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -3095,9 +3438,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -3107,9 +3456,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -3119,9 +3468,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -3131,9 +3480,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -3143,9 +3492,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winreg" @@ -3158,7 +3507,28 @@ dependencies = [ ] [[package]] -name = "zeroize" -version = "1.7.0" +name = "zerocopy" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/Cargo.toml b/Cargo.toml index 64abd38..1c23601 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,14 +10,14 @@ poise = "0.6.1" tracing = "0.1.37" tracing-futures = "0.2.5" rand = "0.8.5" -songbird = "0.4.0" +songbird = "0.4.3" thiserror = "1.0.39" async-openai = "0.18.1" [dependencies.reqwest] -version = "0.11.23" +version = "0.11.27" default-features = false -features = ["rustls-tls"] +features = ["rustls-tls", "stream"] [dependencies.symphonia] version = "0.5.2"