From e7610a34a3810449cae4cf74c5de4ab732f74b37 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 25 Aug 2022 09:03:22 +0300 Subject: [PATCH] Decrease number of WriteString() calls in sendHelp() --- bot/command.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bot/command.go b/bot/command.go index 4833f25..e3b4be5 100644 --- a/bot/command.go +++ b/bot/command.go @@ -116,11 +116,7 @@ func (b *Bot) sendHelp(ctx context.Context, roomID id.RoomID) { var msg strings.Builder msg.WriteString("The following commands are supported:\n\n") for _, command := range commands { - msg.WriteString("* **") - msg.WriteString(fmt.Sprintf("`%s %s`", b.prefix, command.key)) - msg.WriteString("** - ") - msg.WriteString(command.description) - msg.WriteString("\n") + msg.WriteString(fmt.Sprintf("* **`%s %s`** - %s\n", b.prefix, command.key, command.description)) } b.Notice(ctx, roomID, msg.String())