style: use tabs over spaces

This commit is contained in:
seth 2024-01-08 14:56:37 -05:00
parent f2979d4cde
commit f0550dd429
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86
41 changed files with 1112 additions and 1109 deletions

View file

@ -13,53 +13,53 @@ pub mod pluralkit;
mod support_onboard;
pub async fn handle(
ctx: &Context,
event: &Event<'_>,
_framework: FrameworkContext<'_, Data, Report>,
data: &Data,
ctx: &Context,
event: &Event<'_>,
_framework: FrameworkContext<'_, Data, Report>,
data: &Data,
) -> Result<()> {
match event {
Event::Ready { data_about_bot } => {
info!("Logged in as {}!", data_about_bot.user.name);
match event {
Event::Ready { data_about_bot } => {
info!("Logged in as {}!", data_about_bot.user.name);
let latest_minecraft_version = api::prism_meta::get_latest_minecraft_version().await?;
let activity = Activity::playing(format!("Minecraft {}", latest_minecraft_version));
let latest_minecraft_version = api::prism_meta::get_latest_minecraft_version().await?;
let activity = Activity::playing(format!("Minecraft {}", latest_minecraft_version));
info!("Setting presence to activity {activity:#?}");
ctx.set_presence(Some(activity), OnlineStatus::Online).await;
}
info!("Setting presence to activity {activity:#?}");
ctx.set_presence(Some(activity), OnlineStatus::Online).await;
}
Event::Message { new_message } => {
// ignore new messages from bots
// NOTE: the webhook_id check allows us to still respond to PK users
if new_message.author.bot && new_message.webhook_id.is_none() {
debug!("Ignoring message {} from bot", new_message.id);
return Ok(());
}
Event::Message { new_message } => {
// ignore new messages from bots
// NOTE: the webhook_id check allows us to still respond to PK users
if new_message.author.bot && new_message.webhook_id.is_none() {
debug!("Ignoring message {} from bot", new_message.id);
return Ok(());
}
// detect PK users first to make sure we don't respond to unproxied messages
pluralkit::handle(ctx, new_message, data).await?;
// detect PK users first to make sure we don't respond to unproxied messages
pluralkit::handle(ctx, new_message, data).await?;
if data.storage.is_user_plural(new_message.author.id).await?
&& pluralkit::is_message_proxied(new_message).await?
{
debug!("Not replying to unproxied PluralKit message");
return Ok(());
}
if data.storage.is_user_plural(new_message.author.id).await?
&& pluralkit::is_message_proxied(new_message).await?
{
debug!("Not replying to unproxied PluralKit message");
return Ok(());
}
eta::handle(ctx, new_message).await?;
expand_link::handle(ctx, new_message).await?;
analyze_logs::handle(ctx, new_message, data).await?;
}
eta::handle(ctx, new_message).await?;
expand_link::handle(ctx, new_message).await?;
analyze_logs::handle(ctx, new_message, data).await?;
}
Event::ReactionAdd { add_reaction } => {
delete_on_reaction::handle(ctx, add_reaction).await?
}
Event::ReactionAdd { add_reaction } => {
delete_on_reaction::handle(ctx, add_reaction).await?
}
Event::ThreadCreate { thread } => support_onboard::handle(ctx, thread).await?,
Event::ThreadCreate { thread } => support_onboard::handle(ctx, thread).await?,
_ => {}
}
_ => {}
}
Ok(())
Ok(())
}