Decrease number of WriteString() calls in sendHelp()
This commit is contained in:
@@ -116,11 +116,7 @@ func (b *Bot) sendHelp(ctx context.Context, roomID id.RoomID) {
|
|||||||
var msg strings.Builder
|
var msg strings.Builder
|
||||||
msg.WriteString("The following commands are supported:\n\n")
|
msg.WriteString("The following commands are supported:\n\n")
|
||||||
for _, command := range commands {
|
for _, command := range commands {
|
||||||
msg.WriteString("* **")
|
msg.WriteString(fmt.Sprintf("* **`%s %s`** - %s\n", b.prefix, command.key, command.description))
|
||||||
msg.WriteString(fmt.Sprintf("`%s %s`", b.prefix, command.key))
|
|
||||||
msg.WriteString("** - ")
|
|
||||||
msg.WriteString(command.description)
|
|
||||||
msg.WriteString("\n")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
b.Notice(ctx, roomID, msg.String())
|
b.Notice(ctx, roomID, msg.String())
|
||||||
|
|||||||
Reference in New Issue
Block a user