forked from Sarah/Lieb-Website
implemented polls in the discord bot
This commit is contained in:
parent
1d999e89bf
commit
715b14ecc5
13 changed files with 277 additions and 6 deletions
|
@ -17,15 +17,17 @@ namespace Lieb.Controllers
|
|||
{
|
||||
RaidService _raidService;
|
||||
UserService _userService;
|
||||
PollService _pollService;
|
||||
GuildWars2AccountService _gw2AccountService;
|
||||
DiscordService _discordService;
|
||||
|
||||
public DiscordBotController(RaidService raidService, UserService userService, GuildWars2AccountService gw2AccountService, DiscordService discordService)
|
||||
public DiscordBotController(RaidService raidService, UserService userService, GuildWars2AccountService gw2AccountService, DiscordService discordService, PollService pollService)
|
||||
{
|
||||
_raidService = raidService;
|
||||
_userService = userService;
|
||||
_gw2AccountService = gw2AccountService;
|
||||
_discordService = discordService;
|
||||
_pollService = pollService;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
|
@ -306,5 +308,12 @@ namespace Lieb.Controllers
|
|||
{
|
||||
return Ok(await _userService.ReminderOptOut(userId));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Route("[action]")]
|
||||
public async Task AnswerPoll(ApiPollAnswer answer)
|
||||
{
|
||||
await _pollService.UpdateAnswer(answer.PollId, answer.OptionId, answer.Answer, answer.UserId);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue