// Lists out all commands for the given user
Lists out all commands for the given user
// Lists out all commands for the given user
func (hc *HelpCommand) listAllCommands(pack *CommPackage) {
	var message strings.Builder
	message.WriteString("For details on each command, use the detailed help command or check out the wiki! <https://github.com/camd67/moebot/wiki>\n")
	message.WriteString("**Moebot has the following commands**:\n")
	for commIndex, command := range hc.Commands() {
		if hc.currentUserHasCommandPermission(pack, command) {
			for commKeyIndex, commKey := range command.GetCommandKeys() {
				if commIndex > 0 || commKeyIndex > 0 {
					message.WriteString(", ")
				}
				message.WriteString("`")
				message.WriteString(util.ForceTitleCase(commKey))
				message.WriteString("`")
			}
		}
	}
	message.WriteString("\nYou can also use `")
	message.WriteString(hc.ComPrefix)
	message.WriteString(" help <command name>` for more details.")
	_, err := pack.session.ChannelMessageSend(pack.channel.ID, message.String())
	if err != nil {
		log.Println("An error occurred sending help message to channel: "+pack.channel.ID+" with error: ", err)
		return
	}
}
func ( hc * HelpCommand ) listAllCommands ( pack * CommPackage ) { var message strings . Builder message . WriteString ( " \n " ) message . WriteString ( " \n " ) for commIndex , command := range hc . Commands ( ) { if hc . currentUserHasCommandPermission ( pack , command ) { for commKeyIndex , commKey := range command . GetCommandKeys ( ) { if commIndex > 0 || commKeyIndex > 0 { message . WriteString ( " " ) } message . WriteString ( " " ) message . WriteString ( util . ForceTitleCase ( commKey ) ) message . WriteString ( " " ) } } } message . WriteString ( " \n " ) message . WriteString ( hc . ComPrefix ) message . WriteString ( " " ) _ , err := pack . session . ChannelMessageSend ( pack . channel . ID , message . String ( ) ) if err != nil { log . Println ( " " + pack . channel . ID + " " , err ) return } }
Lists out all commands for the given user
Lists out all commands for the given user
// Don't add a , unless we're not the first command