2019-03-14 20:21:53 +01:00
|
|
|
package common
|
|
|
|
|
|
|
|
import "strings"
|
|
|
|
|
|
|
|
const CommandNameSeparator = ","
|
|
|
|
|
|
|
|
type ChatCommandNames []string
|
|
|
|
|
|
|
|
func (c ChatCommandNames) String() string {
|
|
|
|
return strings.Join(c, CommandNameSeparator)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Names for commands
|
|
|
|
var (
|
|
|
|
// User Commands
|
|
|
|
CNMe ChatCommandNames = []string{"me"}
|
|
|
|
CNHelp ChatCommandNames = []string{"help"}
|
|
|
|
CNCount ChatCommandNames = []string{"count"}
|
|
|
|
CNColor ChatCommandNames = []string{"color", "colour"}
|
|
|
|
CNWhoAmI ChatCommandNames = []string{"w", "whoami"}
|
|
|
|
CNAuth ChatCommandNames = []string{"auth"}
|
|
|
|
CNUsers ChatCommandNames = []string{"users"}
|
2019-03-19 22:03:34 +01:00
|
|
|
CNNick ChatCommandNames = []string{"nick", "name"}
|
2019-04-14 06:25:49 +02:00
|
|
|
CNStats ChatCommandNames = []string{"stats"}
|
2019-09-22 22:15:59 +02:00
|
|
|
CNPin ChatCommandNames = []string{"pin", "password"}
|
2019-11-29 18:48:17 +01:00
|
|
|
CNEmotes ChatCommandNames = []string{"emotes"}
|
2019-03-14 20:21:53 +01:00
|
|
|
// Mod Commands
|
|
|
|
CNSv ChatCommandNames = []string{"sv"}
|
|
|
|
CNPlaying ChatCommandNames = []string{"playing"}
|
|
|
|
CNUnmod ChatCommandNames = []string{"unmod"}
|
|
|
|
CNKick ChatCommandNames = []string{"kick"}
|
|
|
|
CNBan ChatCommandNames = []string{"ban"}
|
|
|
|
CNUnban ChatCommandNames = []string{"unban"}
|
2019-03-18 03:29:31 +01:00
|
|
|
CNPurge ChatCommandNames = []string{"purge"}
|
2019-03-14 20:21:53 +01:00
|
|
|
// Admin Commands
|
|
|
|
CNMod ChatCommandNames = []string{"mod"}
|
|
|
|
CNReloadPlayer ChatCommandNames = []string{"reloadplayer"}
|
|
|
|
CNReloadEmotes ChatCommandNames = []string{"reloademotes"}
|
|
|
|
CNModpass ChatCommandNames = []string{"modpass"}
|
2019-03-26 16:58:46 +01:00
|
|
|
CNIP ChatCommandNames = []string{"iplist"}
|
2019-03-18 04:46:46 +01:00
|
|
|
CNAddEmotes ChatCommandNames = []string{"addemotes"}
|
2019-03-23 02:39:55 +01:00
|
|
|
CNRoomAccess ChatCommandNames = []string{"changeaccess", "hodor"}
|
2019-03-14 20:21:53 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
var ChatCommands = []ChatCommandNames{
|
2019-03-22 04:01:21 +01:00
|
|
|
// User
|
2019-03-28 21:21:23 +01:00
|
|
|
CNMe,
|
|
|
|
CNHelp,
|
|
|
|
CNCount,
|
|
|
|
CNColor,
|
|
|
|
CNWhoAmI,
|
|
|
|
CNAuth,
|
|
|
|
CNUsers,
|
|
|
|
CNNick,
|
2019-04-14 06:25:49 +02:00
|
|
|
CNStats,
|
2019-09-22 22:15:59 +02:00
|
|
|
CNPin,
|
2019-11-29 18:48:17 +01:00
|
|
|
CNEmotes,
|
2019-03-28 21:21:23 +01:00
|
|
|
|
2019-03-22 04:01:21 +01:00
|
|
|
// Mod
|
2019-03-28 21:21:23 +01:00
|
|
|
CNSv,
|
|
|
|
CNPlaying,
|
|
|
|
CNUnmod,
|
|
|
|
CNKick,
|
|
|
|
CNBan,
|
|
|
|
CNUnban,
|
|
|
|
CNPurge,
|
|
|
|
|
2019-03-22 04:01:21 +01:00
|
|
|
// Admin
|
2019-03-28 21:21:23 +01:00
|
|
|
CNMod,
|
|
|
|
CNReloadPlayer,
|
|
|
|
CNReloadEmotes,
|
|
|
|
CNModpass,
|
|
|
|
CNIP,
|
2019-03-28 21:47:58 +01:00
|
|
|
CNAddEmotes,
|
2019-09-22 22:15:59 +02:00
|
|
|
CNRoomAccess,
|
2019-03-14 20:21:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func GetFullChatCommand(c string) string {
|
|
|
|
for _, names := range ChatCommands {
|
|
|
|
for _, n := range names {
|
|
|
|
if c == n {
|
|
|
|
return names.String()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|