diff --git a/src/commands/crosspost.rs b/src/commands/crosspost.rs index 9363f03..6521171 100644 --- a/src/commands/crosspost.rs +++ b/src/commands/crosspost.rs @@ -43,7 +43,7 @@ async fn crosspost(ctx: &Context, msg: &Message, mut args: Args) -> CommandResul args.rest() ); for channel in channels { - debug_channel_say(&channel.into(), *msg.author.id.as_u64(), ctx, &rest).await?; + debug_channel_say(channel, msg.author.id, ctx, &rest).await?; } Ok(()) diff --git a/src/util/mod.rs b/src/util/mod.rs index b13b3a0..217fd32 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -31,12 +31,13 @@ pub async fn debug_say( } pub async fn debug_channel_say( - channel: &ChannelId, - author_id: u64, + channel: impl Into, + author_id: impl Into, ctx: impl AsRef, resp: impl std::fmt::Display, ) -> Result, serenity::Error> { - if cfg!(debug_assertions) && author_id == *BOT_OWNER_ID { + let channel: ChannelId = channel.into(); + if cfg!(debug_assertions) && author_id.into() == *BOT_OWNER_ID { Ok(Some(channel.say(ctx, format!("DEBUG: {}", resp)).await?)) } else if !cfg!(debug_assertions) { Ok(Some(channel.say(ctx, resp).await?))