log more actions + tidy up things

This commit is contained in:
seth 2024-03-03 18:32:44 -05:00
parent 651f14d724
commit 915ef54dc3
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86
14 changed files with 56 additions and 19 deletions

View file

@ -1,12 +1,12 @@
use eyre::{eyre, OptionExt, Result};
use log::debug;
use log::{debug, trace};
use poise::serenity_prelude::{
ChannelType, Context, CreateAllowedMentions, CreateMessage, GuildChannel,
};
pub async fn handle(ctx: &Context, thread: &GuildChannel) -> Result<()> {
if thread.kind != ChannelType::PublicThread {
debug!("Not doing support onboard in non-thread channel");
trace!("Not doing support onboard in non-public thread channel");
return Ok(());
}
@ -15,7 +15,7 @@ pub async fn handle(ctx: &Context, thread: &GuildChannel) -> Result<()> {
.ok_or_else(|| eyre!("Couldn't get parent ID from thread {}!", thread.name))?
.name(ctx)
.await
.unwrap_or(String::new())
.unwrap_or_default()
!= "support"
{
debug!("Not posting onboarding message to threads outside of support");