implemented polls in the discord bot

This commit is contained in:
Sarah Faey 2023-01-14 16:44:18 +01:00
parent 1d999e89bf
commit 715b14ecc5
13 changed files with 277 additions and 6 deletions

View file

@ -54,6 +54,18 @@ namespace DiscordBot.CommandHandlers
});
}
break;
case Constants.ComponentIds.POLL_DROP_DOWN:
PollMessage.Parameters pollParameters = PollMessage.ParseId(component.Data.CustomId);
ApiPollAnswer answer = new ApiPollAnswer()
{
Answer = string.Empty,
OptionId = int.Parse(component.Data.Values.First()),
PollId = pollParameters.PollId,
UserId = component.User.Id
};
await _httpService.AnswerPoll(answer);
await component.RespondAsync("Answer sent.", ephemeral: true);
break;
}
}