From c284d5877bc4571a94519f20911514452060351d Mon Sep 17 00:00:00 2001 From: Darkstack <1835601+darkstack@users.noreply.github.com> Date: Sun, 31 Jul 2022 01:38:08 +0200 Subject: [PATCH] Fix cards against humanity --- LaDOSE.Src/LaDOSE.DiscordBot/Command/Public.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/LaDOSE.Src/LaDOSE.DiscordBot/Command/Public.cs b/LaDOSE.Src/LaDOSE.DiscordBot/Command/Public.cs index 3bdad0b..2bbb2d1 100644 --- a/LaDOSE.Src/LaDOSE.DiscordBot/Command/Public.cs +++ b/LaDOSE.Src/LaDOSE.DiscordBot/Command/Public.cs @@ -59,14 +59,18 @@ namespace LaDOSE.DiscordBot.Command var q = Questions[rnd.Next(Questions.Count - 1)]; var s = q.Split('_', StringSplitOptions.RemoveEmptyEntries); - for (int i = 0; i < s.Length - 1; i++) + if (s.Length == 1) { - response += s[i] + Answers[rnd.Next(Answers.Count - 1)]; + response += q + " " + Answers[rnd.Next(Answers.Count - 1)]; + } + else + { + for (int i = 0; i < s.Length - 1; i++) + { + response += s[i] + Answers[rnd.Next(Answers.Count - 1)]; + } + response += s[s.Length - 1]; } - response += s[s.Length-1]; - - - await ctx.RespondAsync(response); }