aboutsummaryrefslogtreecommitdiff
path: root/src/commands/meme/create.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/meme/create.rs')
-rw-r--r--src/commands/meme/create.rs6
1 files changed, 5 insertions, 1 deletions
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::<String>()?;
@@ -117,7 +119,7 @@ pub async fn addaudiomeme(ctx: &Context, msg: &Message, args: Args) -> CommandRe
let elems = audio_str.split_whitespace().collect::<Vec<_>>();
- 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");