From 47817c4166937af24041a93e56ad9f841bf1e8f1 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Wed, 8 May 2024 14:15:42 -0400 Subject: fixups: memes working --- src/commands/meme/create.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/commands/meme/create.rs') diff --git a/src/commands/meme/create.rs b/src/commands/meme/create.rs index 1c12f2a..ef6090e 100644 --- a/src/commands/meme/create.rs +++ b/src/commands/meme/create.rs @@ -110,6 +110,8 @@ pub async fn addmeme(ctx: &Context, msg: &Message, args: Args) -> CommandResult #[command] pub async fn addaudiomeme(ctx: &Context, msg: &Message, args: Args) -> CommandResult { + debug!("running addaudiomeme"); + let mut args = Args::new(args.rest(), DELIMS.as_ref()); let title = args.single_quoted::()?; @@ -117,7 +119,7 @@ pub async fn addaudiomeme(ctx: &Context, msg: &Message, args: Args) -> CommandRe let elems = audio_str.split_whitespace().collect::>(); - if elems.len() == 0 { + if elems.is_empty() { util::send(ctx, msg.channel_id, "are you stupid", msg.tts).await?; return Err(anyhow!("no audio link was provided").into()); } @@ -127,6 +129,7 @@ pub async fn addaudiomeme(ctx: &Context, msg: &Message, args: Args) -> CommandRe let (start, end) = parse_times(opts); let youtube_url = util::ytdl_url(audio_link.as_str()).await?; + debug!("got download url: {youtube_url}"); let duration_opts = if let Some(e) = end { vec![ @@ -184,6 +187,7 @@ pub async fn addaudiomeme(ctx: &Context, msg: &Message, args: Args) -> CommandRe let mut audio_data = Vec::new(); let bytes = audio_reader.read_to_end(&mut audio_data).await?; + debug!("downloaded audio ({} bytes)", audio_data.len()); if bytes == 0 { debug!("read 0 bytes from audio reader"); -- cgit v1.3.1