You've already forked AstralRinth
forked from didirus/AstralRinth
Fix caching bug, and moderation webhook being sent at the wrong time (#215)
This commit is contained in:
@@ -34,13 +34,33 @@ pub async fn send_discord_webhook(
|
||||
project: Project,
|
||||
webhook_url: String,
|
||||
) -> Result<(), reqwest::Error> {
|
||||
let mut fields = Vec::new();
|
||||
|
||||
fields.push(DiscordEmbedField {
|
||||
name: "id".to_string(),
|
||||
value: project.id.to_string(),
|
||||
inline: true,
|
||||
});
|
||||
let mut fields = vec![
|
||||
DiscordEmbedField {
|
||||
name: "id".to_string(),
|
||||
value: project.id.to_string(),
|
||||
inline: true,
|
||||
},
|
||||
DiscordEmbedField {
|
||||
name: "project_type".to_string(),
|
||||
value: project.project_type.to_string(),
|
||||
inline: true,
|
||||
},
|
||||
DiscordEmbedField {
|
||||
name: "client_side".to_string(),
|
||||
value: project.client_side.to_string(),
|
||||
inline: true,
|
||||
},
|
||||
DiscordEmbedField {
|
||||
name: "server_side".to_string(),
|
||||
value: project.server_side.to_string(),
|
||||
inline: true,
|
||||
},
|
||||
DiscordEmbedField {
|
||||
name: "categories".to_string(),
|
||||
value: project.categories.join(", "),
|
||||
inline: true,
|
||||
},
|
||||
];
|
||||
|
||||
if let Some(slug) = project.slug.clone() {
|
||||
fields.push(DiscordEmbedField {
|
||||
@@ -50,30 +70,6 @@ pub async fn send_discord_webhook(
|
||||
});
|
||||
}
|
||||
|
||||
fields.push(DiscordEmbedField {
|
||||
name: "project_type".to_string(),
|
||||
value: project.project_type.to_string(),
|
||||
inline: true,
|
||||
});
|
||||
|
||||
fields.push(DiscordEmbedField {
|
||||
name: "client_side".to_string(),
|
||||
value: project.client_side.to_string(),
|
||||
inline: true,
|
||||
});
|
||||
|
||||
fields.push(DiscordEmbedField {
|
||||
name: "server_side".to_string(),
|
||||
value: project.server_side.to_string(),
|
||||
inline: true,
|
||||
});
|
||||
|
||||
fields.push(DiscordEmbedField {
|
||||
name: "categories".to_string(),
|
||||
value: project.categories.join(", "),
|
||||
inline: true,
|
||||
});
|
||||
|
||||
let embed = DiscordEmbed {
|
||||
url: format!(
|
||||
"{}/mod/{}",
|
||||
|
||||
Reference in New Issue
Block a user