style: use tabs over spaces
This commit is contained in:
parent
f2979d4cde
commit
f0550dd429
41 changed files with 1112 additions and 1109 deletions
|
@ -3,41 +3,41 @@ use log::*;
|
|||
use poise::serenity_prelude::{ChannelType, Context, GuildChannel};
|
||||
|
||||
pub async fn handle(ctx: &Context, thread: &GuildChannel) -> Result<()> {
|
||||
if thread.kind != ChannelType::PublicThread {
|
||||
return Ok(());
|
||||
}
|
||||
if thread.kind != ChannelType::PublicThread {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let parent_id = thread
|
||||
.parent_id
|
||||
.ok_or_else(|| eyre!("Couldn't get parent ID from thread {}!", thread.name))?;
|
||||
let parent_id = thread
|
||||
.parent_id
|
||||
.ok_or_else(|| eyre!("Couldn't get parent ID from thread {}!", thread.name))?;
|
||||
|
||||
let parent_channel = ctx
|
||||
.cache
|
||||
.guild_channel(parent_id)
|
||||
.ok_or_else(|| eyre!("Couldn't get GuildChannel {}!", parent_id))?;
|
||||
let parent_channel = ctx
|
||||
.cache
|
||||
.guild_channel(parent_id)
|
||||
.ok_or_else(|| eyre!("Couldn't get GuildChannel {}!", parent_id))?;
|
||||
|
||||
if parent_channel.name != "support" {
|
||||
debug!("Not posting onboarding message to threads outside of support");
|
||||
return Ok(());
|
||||
}
|
||||
if parent_channel.name != "support" {
|
||||
debug!("Not posting onboarding message to threads outside of support");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let owner = thread
|
||||
.owner_id
|
||||
.ok_or_else(|| eyre!("Couldn't get owner of thread!"))?;
|
||||
let owner = thread
|
||||
.owner_id
|
||||
.ok_or_else(|| eyre!("Couldn't get owner of thread!"))?;
|
||||
|
||||
let msg = format!(
|
||||
let msg = format!(
|
||||
"<@{}> We've received your support ticket! {} {}",
|
||||
owner,
|
||||
"Please upload your logs and post the link here if possible (run `tag log` to find out how).",
|
||||
"Please don't ping people for support questions, unless you have their permission."
|
||||
);
|
||||
|
||||
thread
|
||||
.send_message(ctx, |m| {
|
||||
m.content(msg)
|
||||
.allowed_mentions(|am| am.replied_user(true).users(Vec::from([owner])))
|
||||
})
|
||||
.await?;
|
||||
thread
|
||||
.send_message(ctx, |m| {
|
||||
m.content(msg)
|
||||
.allowed_mentions(|am| am.replied_user(true).users(Vec::from([owner])))
|
||||
})
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue