Skip to content

Commit

Permalink
Merge branch 'release/3.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
j4rv committed Apr 5, 2024
2 parents ee66b67 + 2e50886 commit 45ce5e1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cmd/jarvbot/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"log"
"math/rand"
"regexp"
"sort"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -256,9 +257,17 @@ func answerRemoveGlobalCommand(ds *discordgo.Session, mc *discordgo.MessageCreat

func answerListCommands(ds *discordgo.Session, mc *discordgo.MessageCreate, ctx context.Context) bool {
keys, err := commandDS.allSimpleCommandKeys(mc.GuildID)
notifyIfErr("removeSimpleCommand", err, ds)
notifyIfErr("answerListCommands::allSimpleCommandKeys", err, ds)
if len(keys) != 0 {
ds.ChannelMessageSend(mc.ChannelID, fmt.Sprintf("Current commands: %v", keys))
sort.Strings(keys)
msg := ""
for _, k := range keys {
msg += k + "\n"
}
ds.ChannelMessageSendEmbed(mc.ChannelID, &discordgo.MessageEmbed{
Title: "Simple commands",
Description: msg,
})
}
return err == nil
}
Expand Down

0 comments on commit 45ce5e1

Please sign in to comment.