TerraOceanPlugin/GoBot/discord/modules/commands.go

82 lines
1.5 KiB
Go

2019-10-12 09:45:43 +07:00
package modules
import (
"TerraOceanBot/discord/config"
"github.com/bwmarrin/discordgo"
)
2019-10-12 09:45:43 +07:00
2019-10-12 11:29:33 +07:00
type CommandHandler func(s *discordgo.Session, m *discordgo.MessageCreate, commands []string)
2019-10-12 09:45:43 +07:00
type Command struct {
Name string
Handler CommandHandler
Description string
Usage string
Admin bool
2019-10-12 09:45:43 +07:00
}
var Commands = []Command{
//Admin Commands
2019-10-12 09:45:43 +07:00
Command{
2019-10-15 11:01:36 +07:00
Name: "!batchrole",
Handler: batchGiveRole,
Usage: config.BatchRoleUsage,
Admin: true,
},
Command{
2019-10-12 09:45:43 +07:00
Name: "!editas",
Handler: editAs,
Usage: config.EditAsUsage,
Admin: true,
2019-10-12 09:45:43 +07:00
},
Command{
Name: "!peektrust",
Handler: viewTrustLevel,
Usage: config.VTLUsage,
Admin: true,
},
Command{
Name: "!sendas",
Handler: sendAs,
Usage: config.SendAsUsage,
Admin: true,
},
//Regular Commands
Command{
Name: "!help",
Handler: showHelp,
Usage: "!help",
Admin: false,
2019-10-12 09:45:43 +07:00
},
Command{
Name: "!invite",
Handler: createInvite,
Usage: config.InviteUsage,
Admin: false,
2019-10-12 09:45:43 +07:00
},
Command{
Name: "!setmcusername",
Handler: updateMinecraftUsername,
Usage: config.SetMCUsernameUsage,
Admin: false,
2019-10-12 09:45:43 +07:00
},
Command{
Name: "!trust",
Handler: changeTrust,
Usage: config.ChangeTrustUsage,
Admin: false,
2019-10-12 09:45:43 +07:00
},
2019-10-13 09:59:35 +07:00
Command{
Name: "!validate",
Handler: checkUseInvite,
Usage: config.ValidateUsage,
Admin: false,
2019-10-13 09:59:35 +07:00
},
Command{
Name: "!votesuggest",
Handler: voteSuggestion,
Usage: config.VoteSuggestionUsage,
Admin: false,
},
2019-10-12 09:45:43 +07:00
}