From 0e5785e3a1b14b272d82f554c120df91c8b31f27 Mon Sep 17 00:00:00 2001 From: Daan Boerlage Date: Tue, 16 Nov 2021 00:40:19 +0100 Subject: [PATCH] Rework the output of the /choose command to show all the choices that the user has entered; which are somewhat lost with / commands, as others can't see what the user entered without an additional mouseclick --- src/Web/Commands/Choose.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Web/Commands/Choose.cs b/src/Web/Commands/Choose.cs index 7c25940..d3f9412 100644 --- a/src/Web/Commands/Choose.cs +++ b/src/Web/Commands/Choose.cs @@ -1,8 +1,8 @@ +using System.Text; using Geekbot.Interactions; using Geekbot.Interactions.ApplicationCommand; using Geekbot.Interactions.Request; using Geekbot.Interactions.Response; -using Localization = Geekbot.Core.Localization; namespace Geekbot.Web.Commands; @@ -45,6 +45,14 @@ public class Choose : InteractionBase var choicesArray = options.Split(separator); var choice = new Random().Next(choicesArray.Length); - return Task.FromResult(SimpleResponse(string.Format(Localization.Choose.Choice, choicesArray[choice].Trim()))); + + var sb = new StringBuilder(); + for (var i = 0; i < choicesArray.Length; i++) + { + var o = choicesArray[i].Trim(); + sb.AppendLine(i == choice ? $"**__{o}__**" : o); + } + + return Task.FromResult(SimpleResponse(sb.ToString())); } } \ No newline at end of file