-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathenabled.go
78 lines (71 loc) · 2.71 KB
/
enabled.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
package commands
import (
"github.com/ritsec/ops-bot-iii/commands/handlers"
"github.com/ritsec/ops-bot-iii/commands/scheduled"
"github.com/ritsec/ops-bot-iii/commands/slash"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
)
// populateSlashCommands populates the SlashCommands map with all of the slash commands
func populateSlashCommands(ctx ddtrace.SpanContext) {
span := tracer.StartSpan(
"commands.enabled:populateSlashCommands",
tracer.ResourceName("commands.enabled:populateSlashCommands"),
tracer.ChildOf(ctx),
)
defer span.Finish()
// Populate the slash commands
SlashCommands["ping"] = slash.Ping
SlashCommands["purge"] = slash.Purge
SlashCommands["kudos"] = slash.Kudos
SlashCommands["reboot"] = slash.Reboot
SlashCommands["log"] = slash.Log
SlashCommands["usage"] = slash.Usage
SlashCommands["member"] = slash.Member
SlashCommands["signin"] = slash.Signin
SlashCommands["vote"] = slash.Vote
SlashCommands["feedback"] = slash.Feedback
SlashCommands["update"] = slash.Update
SlashCommands["query"] = slash.Query
SlashCommands["scoreboard"] = slash.Scoreboard
SlashCommands["birthday"] = slash.Birthday
SlashCommands["dquery"] = slash.DQuery
SlashCommands["attendance"] = slash.Attendance
SlashCommands["attendanceof"] = slash.Attendanceof
SlashCommands["openstack"] = slash.Openstack
SlashCommands["verify"] = slash.Verify
}
// populateHandlers populates the Handlers map with all of the handlers
func populateHandlers(ctx ddtrace.SpanContext) {
span := tracer.StartSpan(
"commands.enabled:populateHandlers",
tracer.ResourceName("commands.enabled:populateHandlers"),
tracer.ChildOf(ctx),
)
defer span.Finish()
// Populate the handlers
Handlers["uwu"] = handlers.Uwu
Handlers["angryReact"] = handlers.AngryReact
Handlers["memberJoin"] = handlers.MemberJoin
Handlers["memberLeave"] = handlers.MemberLeave
Handlers["flag"] = handlers.Flag
Handlers["isTheStackRunning"] = handlers.IsTheStackRunning
Handlers["messageDelete"] = handlers.MessageDelete
Handlers["messageEdit"] = handlers.MessageEdit
Handlers["scoreboard"] = handlers.Scoreboard
}
// populateScheduledEvents populates the ScheduledEvents map with all of the scheduled events
func populateScheduledEvents(ctx ddtrace.SpanContext) {
span := tracer.StartSpan(
"commands.enabled:populateScheduledEvents",
tracer.ResourceName("commands.enabled:populateScheduledEvents"),
tracer.ChildOf(ctx),
)
defer span.Finish()
// Populate the scheduled events
// ScheduledEvents["goodfood"] = scheduled.GoodFood
ScheduledEvents["heartbeat"] = scheduled.Heartbeat
ScheduledEvents["status"] = scheduled.Status
ScheduledEvents["update"] = scheduled.Update
ScheduledEvents["birthday"] = scheduled.Birthday
}