diff --git a/command.go b/command.go index 43eaeb4..fb3a1df 100644 --- a/command.go +++ b/command.go @@ -201,3 +201,34 @@ func giveAgeRole(s *discordgo.Session, m *discordgo.MessageCreate) { } } } + +func getHelpEmbed() *discordgo.MessageEmbed { + commandList := "Im Folgenden findest du eine automatisch generierte Liste aller Commands. Um herauszufinden, was sie tun, probiere sie aus oder lies den Source Code (siehe unten).\n```" + for _, command := range commands { + if command.Type != CommandTypeRegex { + commandList += "- " + command.Trigger + "\n" + } + } + commandList += "```" + embed := &discordgo.MessageEmbed{ + Author: &discordgo.MessageEmbedAuthor{}, + Color: 0xffb90f, + Description: "__Hilfe__", + Fields: []*discordgo.MessageEmbedField { + &discordgo.MessageEmbedField { + Name: "__Commands__", + Value: commandList, + Inline: true, + }, + &discordgo.MessageEmbedField { + Name: "__Bugs__", + Value: fmt.Sprintf("Bei Fragen zum Bot, Vorschlägen, Bugs etc. wende dich bitte an <@%s> oder öffne eine Issue auf https://git.kageru.moe/kageru/discord-selphybot.", config.Admins[0]), + Inline: true, + }, + }, + Thumbnail: &discordgo.MessageEmbedThumbnail{ + URL: "https://static-cdn.jtvnw.net/emoticons/v1/1068185/3.0", + }, + } + return embed +} diff --git a/main.go b/main.go index 451cd22..7c1de06 100644 --- a/main.go +++ b/main.go @@ -70,6 +70,7 @@ func addCommands() { // Information registerCommand(Command{Trigger: "!welcome", OutputEmbed: getWelcomeEmbed(), Type: CommandTypeFullMatch, DMOnly: true}) + registerCommand(Command{Trigger: "!help", OutputEmbed: getHelpEmbed(), Type: CommandTypeFullMatch, DMOnly: true}) // Admin and/or debug registerCommand(Command{Trigger: "<@%s> <3", Output: "<@%s> <3", Type: CommandTypeFullMatch, AdminOnly: true, OutputIsReply: true, RequiresMention: true})