diff --git a/src/commands/edit.rs b/src/commands/edit.rs index 165b84b..257ec3d 100644 --- a/src/commands/edit.rs +++ b/src/commands/edit.rs @@ -32,7 +32,7 @@ pub async fn mate( bool, >, #[description = "the new avatar to use when proxying"] avatar: Option, - #[description = "a link to an avatar to use when proxying"] avatar_url: Option, + #[description = "a link to an avatar to use when proxying"] avatar_url: Option, #[description = "the mate's bio"] bio: Option, #[description = "the mate's pronouns"] pronouns: Option, #[description = "a signature to add to any proxied messages (ie `💙- text`)"] signature: Option< @@ -53,9 +53,8 @@ pub async fn mate( name.clone(), avatar, ) - .await? - ) - + .await?, + ) } get_mate(&mates_collection, ctx.author().id, name.clone()) diff --git a/src/events/on_message.rs b/src/events/on_message.rs index 59ee416..4cf1e1f 100644 --- a/src/events/on_message.rs +++ b/src/events/on_message.rs @@ -1,5 +1,5 @@ -use anyhow::Result; -use poise::serenity_prelude::{CacheHttp, Context as SerenityContext, Message}; +use anyhow::{Context, Result}; +use poise::serenity_prelude::{CacheHttp, Context as SerenityContext, Message, MessageFlags}; use crate::{ commands::Data, @@ -13,6 +13,16 @@ use crate::{ }; pub async fn run(ctx: &SerenityContext, data: &Data, message: &Message) -> Result<()> { + // FIXME: make this configurable later but immediately drop voice messages because someone asked for it + // and, as mr krabs would say: "we shall never deny a guest even the most ridiculous request" + if message + .flags + .context("how the FUCK does this message not have flags")? + .intersects(MessageFlags::IS_VOICE_MESSAGE) + { + return Ok(()); + } + if message.author.bot { return Ok(()); } diff --git a/src/utils/guilds.rs b/src/utils/guilds.rs index 95ea7bd..08bce34 100644 --- a/src/utils/guilds.rs +++ b/src/utils/guilds.rs @@ -18,7 +18,7 @@ pub async fn send_server_proxy_log( let webhook = get_webhook_or_create( http, &channels_collection, - // SAFETY: due to the chain of database-required type changes, this is fine to unwrap as `proxy_logs_channel_id` can never be zero + // SAFETY: due to the chain of database-required type changes, this is fine to panic as `proxy_logs_channel_id` can never be zero ChannelId::new(proxy_logs_channel_id as u64), ) .await?;