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.rs20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/commands/meme/create.rs b/src/commands/meme/create.rs
index 185e1f6..a4e9656 100644
--- a/src/commands/meme/create.rs
+++ b/src/commands/meme/create.rs
@@ -2,11 +2,7 @@ use std::process::Stdio;
use anyhow::anyhow;
use diesel::result::Error as DieselError;
-use log::{
- debug,
- error,
- warn,
-};
+use grate::tracing;
use serenity::all::ReactionType;
use tap::Pipe;
use tokio::{
@@ -40,7 +36,7 @@ pub async fn addmeme(
let image = util::msg(ctx).and_then(|msg| msg.attachments.first());
if image.is_none() && text.is_none() {
- warn!("tried to create non-audio meme with no image or text");
+ tracing::warn!("tried to create non-audio meme with no image or text");
util::reply(ctx, "hahAA it's empty xdddd").await?;
return Ok(());
@@ -74,7 +70,7 @@ pub async fn addmeme(
if let Some(DieselError::DatabaseError(DatabaseErrorKind::UniqueViolation, _)) =
e.downcast_ref::<DieselError>()
{
- error!("tried to create meme that already exists");
+ tracing::error!("tried to create meme that already exists");
util::react(ctx, '❌').await?;
util::reply(ctx, "that meme already exists").await?;
@@ -97,7 +93,7 @@ pub async fn addaudiomeme(
audio_str: String,
#[rest] text: Option<String>,
) -> anyhow::Result<()> {
- debug!("running addaudiomeme");
+ tracing::debug!("running addaudiomeme");
let elems = audio_str.split_whitespace().collect::<Vec<_>>();
@@ -113,7 +109,7 @@ pub async fn addaudiomeme(
util::react(ctx, '🔃').await?;
let youtube_url = util::ytdl_url(audio_link.as_str()).await?;
- debug!("got download url: {youtube_url}");
+ tracing::debug!("got download url: {youtube_url}");
let duration_opts = if let Some(e) = end {
vec![
@@ -166,10 +162,10 @@ pub async fn addaudiomeme(
let mut audio_data = Vec::new();
let bytes = audio_reader.read_to_end(&mut audio_data).await?;
- debug!("downloaded audio ({} bytes)", audio_data.len());
+ tracing::debug!("downloaded audio ({} bytes)", audio_data.len());
if bytes == 0 {
- debug!("read 0 bytes from audio reader");
+ tracing::debug!("read 0 bytes from audio reader");
util::unreact(ctx, '🔃').await?;
util::reply(ctx, "🔇🔇🔇🔕🔕🔕🔕🔕🔇🔕🔕🔇🔕🔕📣📢📣📢📣").await?;
@@ -200,7 +196,7 @@ pub async fn addaudiomeme(
if let Some(DieselError::DatabaseError(DatabaseErrorKind::UniqueViolation, _)) =
e.downcast_ref::<DieselError>()
{
- error!("tried to create meme that already exists");
+ tracing::error!("tried to create meme that already exists");
util::react(ctx, ReactionType::Unicode("❌".to_owned())).await?;
util::reply(ctx, "that meme already exists").await?;