announce new bugs to discord

This commit is contained in:
Michael 2017-05-28 12:48:48 -04:00
parent 54967e89a4
commit 0214626db3

View file

@ -128,7 +128,14 @@ public ActionResult PostBug(PostBugViewModel model)
db.ForumPosts.Add(comment); db.ForumPosts.Add(comment);
db.Bugs.Add(bug); db.Bugs.Add(bug);
db.SaveChanges(); db.SaveChanges();
NotificationDaemon.ScreamToDiscord($"A bug has been opened by {ACL.UserNameRaw(User.Identity.GetUserId())}", $@"**Title:** {bug.Name}
**Version ID:** {bug.ReleaseId}
**Species:** {bug.Species}
**Urgency:** {bug.Urgency}
**Author's description:**
{comment.Body.Substring(Math.Min(comment.Body.Length, 128))}", Url.Action("ViewBug", new { id = bug.Id }));
return RedirectToAction("ViewBug", new { id = bug.Id }); return RedirectToAction("ViewBug", new { id = bug.Id });
} }
} }