added choosen answer to poll feedback

This commit is contained in:
Sarah Faey 2023-02-14 18:53:26 +01:00
parent 9e3eaebb3d
commit eaa0b4c4ef
3 changed files with 6 additions and 3 deletions

View file

@ -74,7 +74,8 @@ namespace DiscordBot.CommandHandlers
UserId = component.User.Id
};
await _httpService.AnswerPoll(answer);
await component.RespondAsync("Answer sent.", ephemeral: true);
ButtonComponent usedButton = (ButtonComponent)component.Message.Components.First().Components.First(c => c.CustomId == component.Data.CustomId);
await component.RespondAsync($"Answer \"{usedButton.Label}\" sent.", ephemeral: true);
break;
case Constants.ComponentIds.POLL_CUSTOM_ANSWER_BUTTON:
PollMessage.Parameters pollCustomParameters = PollMessage.ParseId(component.Data.CustomId);