mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-06 18:52:27 +00:00
Add grief report webhook, add ability to link to individual reports
This commit is contained in:
parent
2dcf8dd390
commit
6ca81e0421
9 changed files with 317 additions and 212 deletions
|
@ -2,6 +2,7 @@
|
|||
using System.Text.Json;
|
||||
using System.Xml.Serialization;
|
||||
using LBPUnion.ProjectLighthouse.Administration.Reports;
|
||||
using LBPUnion.ProjectLighthouse.Configuration;
|
||||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData.Profiles;
|
||||
using LBPUnion.ProjectLighthouse.Types;
|
||||
|
@ -45,6 +46,13 @@ public class ReportController : ControllerBase
|
|||
this.database.Reports.Add(report);
|
||||
await this.database.SaveChangesAsync();
|
||||
|
||||
await WebhookHelper.SendWebhook(
|
||||
title: "New grief report",
|
||||
description: $"Submitted by {user.Username}\n" +
|
||||
$"To view it, click [here]({ServerConfiguration.Instance.ExternalUrl}/admin/report/{report.ReportId}).",
|
||||
dest: WebhookHelper.WebhookDestination.Moderation
|
||||
);
|
||||
|
||||
return this.Ok();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue