-
-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathchatcommands.go
85 lines (76 loc) · 1.95 KB
/
chatcommands.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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"}
CNNick ChatCommandNames = []string{"nick", "name"}
CNStats ChatCommandNames = []string{"stats"}
CNPin ChatCommandNames = []string{"pin", "password"}
CNEmotes ChatCommandNames = []string{"emotes"}
// 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"}
CNPurge ChatCommandNames = []string{"purge"}
// Admin Commands
CNMod ChatCommandNames = []string{"mod"}
CNReloadPlayer ChatCommandNames = []string{"reloadplayer"}
CNReloadEmotes ChatCommandNames = []string{"reloademotes"}
CNModpass ChatCommandNames = []string{"modpass"}
CNIP ChatCommandNames = []string{"iplist"}
CNRoomAccess ChatCommandNames = []string{"changeaccess", "hodor"}
)
var ChatCommands = []ChatCommandNames{
// User
CNMe,
CNHelp,
CNCount,
CNColor,
CNWhoAmI,
CNAuth,
CNUsers,
CNNick,
CNStats,
CNPin,
CNEmotes,
// Mod
CNSv,
CNPlaying,
CNUnmod,
CNKick,
CNBan,
CNUnban,
CNPurge,
// Admin
CNMod,
CNReloadPlayer,
CNReloadEmotes,
CNModpass,
CNIP,
CNRoomAccess,
}
func GetFullChatCommand(c string) string {
for _, names := range ChatCommands {
for _, n := range names {
if c == n {
return names.String()
}
}
}
return ""
}