send webhook when a contest opens

This commit is contained in:
Michael 2017-05-25 15:26:24 -04:00
parent 3f1236f22e
commit de6d1d15ab

View file

@ -276,6 +276,13 @@ public ActionResult CreateContest(CreateContestViewModel model)
db.Contests.Add(c); db.Contests.Add(c);
db.SaveChanges(); db.SaveChanges();
NotificationDaemon.ScreamToDiscord(
"A new contest has started.",
$@"Contest name: {c.Name}
Ends at: {c.EndsAt}",
Url.Action("ViewContest", new { id = c.Id })
);
NotificationDaemon.NotifyEveryone(User.Identity.GetUserId(), "A contest has just started.", "A new contest has been open! Contest: " + c.Name, Url.Action("ViewContest", new { id = c.Id })); NotificationDaemon.NotifyEveryone(User.Identity.GetUserId(), "A contest has just started.", "A new contest has been open! Contest: " + c.Name, Url.Action("ViewContest", new { id = c.Id }));
return RedirectToAction("ViewContest", new { id = c.Id }); return RedirectToAction("ViewContest", new { id = c.Id });