You've already forked AstralRinth
forked from xxxOFFxxx/AstralRinth
Slack webhooks (#959)
* Slack webhooks * Fix automod rejecting audio and locale packs * Run prepare
This commit is contained in:
@@ -249,6 +249,7 @@ pub struct OAuthClientEdit {
|
||||
)]
|
||||
pub name: Option<String>,
|
||||
|
||||
#[validate(custom(function = "crate::util::validate::validate_no_restricted_scopes"))]
|
||||
pub max_scopes: Option<Scopes>,
|
||||
|
||||
#[validate(length(min = 1))]
|
||||
|
||||
@@ -398,18 +398,18 @@ pub async fn project_edit(
|
||||
}
|
||||
|
||||
if user.role.is_mod() {
|
||||
if let Ok(webhook_url) = dotenvy::var("MODERATION_DISCORD_WEBHOOK") {
|
||||
crate::util::webhook::send_discord_webhook(
|
||||
if let Ok(webhook_url) = dotenvy::var("MODERATION_SLACK_WEBHOOK") {
|
||||
crate::util::webhook::send_slack_webhook(
|
||||
project_item.inner.id.into(),
|
||||
&pool,
|
||||
&redis,
|
||||
webhook_url,
|
||||
Some(
|
||||
format!(
|
||||
"**[{}]({}/user/{})** changed project status from **{}** to **{}**",
|
||||
user.username,
|
||||
"*<{}/user/{}|{}>* changed project status from *{}* to *{}*",
|
||||
dotenvy::var("SITE_URL")?,
|
||||
user.username,
|
||||
user.username,
|
||||
&project_item.inner.status.as_friendly_str(),
|
||||
status.as_friendly_str(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user