implemented polls in the discord bot
This commit is contained in:
parent
1d999e89bf
commit
715b14ecc5
13 changed files with 277 additions and 6 deletions
|
@ -63,6 +63,19 @@ namespace DiscordBot.CommandHandlers
|
|||
await modal.RespondAsync($"signing up failed", ephemeral: true);
|
||||
}
|
||||
break;
|
||||
case Constants.ComponentIds.POLL_CUSTOM_ANSWER_MODAL:
|
||||
PollCustomModal.Parameters pollParameters = PollCustomModal.ParseId(modal.Data.CustomId);
|
||||
string modalAnswer = components.First(x => x.CustomId == Constants.ComponentIds.POLL_CUSTOM_ANSWER_TEXT_BOX).Value;
|
||||
ApiPollAnswer answer = new ApiPollAnswer()
|
||||
{
|
||||
Answer = modalAnswer,
|
||||
OptionId = 0,
|
||||
PollId = pollParameters.PollId,
|
||||
UserId = modal.User.Id
|
||||
};
|
||||
await _httpService.AnswerPoll(answer);
|
||||
await modal.RespondAsync("Answer sent.", ephemeral: true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue