Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var discordInbound stringArrayFlags
var discordOutbound stringArrayFlags

var addr = flag.String("redis", "redis:6379", "Redis server address")
var modules = flag.String("modules", "all", "Which party pack reactions to enable")

func init() {
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
Expand Down
44 changes: 23 additions & 21 deletions reactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,30 @@ func reactions(message Message) (string, bool) {

reactionContent := ""
switchToken := strings.Split(message.Content, " ")[0]
switch switchToken {
case "!shrug":
reactionContent = "¯\\_(ツ)_/¯"
case "!lenny":
reactionContent = "( ͡° ͜ʖ ͡°)"
case "!tableflip":
reactionContent = "(╯°□°)╯︵ ┻━┻"
case "!tablefix":
reactionContent = "┬─┬ノ( º _ ºノ)"
case "!8ball":
reactionContent = make8BallAnswer()
case "!epeen":
reactionContent = epeen(message.From)
case "!ipinfo":
reactionContent = ipinfo(message.Content)
case "!roll":
reactionContent = diceTrigger(message.From, message.Content)
case "!choose":
reactionContent = decisions(message.From, message.Content)
case "!dadjoke":
reactionContent = jokeTrigger()

if *modules == "all" || strings.Contains(*modules, switchToken[1:]) {
switch switchToken {
case "!shrug":
reactionContent = "¯\\_(ツ)_/¯"
case "!lenny":
reactionContent = "( ͡° ͜ʖ ͡°)"
case "!tableflip":
reactionContent = "(╯°□°)╯︵ ┻━┻"
case "!tablefix":
reactionContent = "┬─┬ノ( º _ ºノ)"
case "!8ball":
reactionContent = make8BallAnswer()
case "!epeen":
reactionContent = epeen(message.From)
case "!ipinfo":
reactionContent = ipinfo(message.Content)
case "!roll":
reactionContent = diceTrigger(message.From, message.Content)
case "!choose":
reactionContent = decisions(message.From, message.Content)
case "!dadjoke":
reactionContent = jokeTrigger()
}
}

return reactionContent, reactionContent != ""
Expand Down