Compare commits
1 Commits
984e86a123
...
82534a9030
Author | SHA1 | Date | |
---|---|---|---|
82534a9030 |
@ -128,11 +128,8 @@ func (w *WatBot) Msg(m *irc.Message) {
|
||||
}
|
||||
|
||||
// integration with games in other bots
|
||||
isBot, games := w.integration.Bot(m)
|
||||
if isBot {
|
||||
if w.integration.HandleIntegration(m, args, games) {
|
||||
return
|
||||
}
|
||||
if w.integration.HandleIntegration(m, args) {
|
||||
return
|
||||
}
|
||||
|
||||
// check if command char (or something weird) is present
|
||||
|
@ -39,14 +39,18 @@ func (w *WatIntegration) Bot(m *irc.Message) (bool, []string) {
|
||||
return isBot, games
|
||||
}
|
||||
|
||||
func (w *WatIntegration) HandleIntegration(m *irc.Message, msgargs []string, games []string) bool {
|
||||
func (w *WatIntegration) HandleIntegration(m *irc.Message, msgargs []string) bool {
|
||||
|
||||
// handles a message "Top finishers: (nick1: 1300) (nick2: 1200)" from an authorized Jeopardy game bot
|
||||
if msgargs[0] == "Top" && msgargs[1] == "finishers:" && w.bot.Allowed("jeopardy", games) {
|
||||
w.Jeopardy(m, msgargs)
|
||||
return true
|
||||
isBot, games := w.Bot(m)
|
||||
if isBot {
|
||||
// handles a message "Top finishers: (nick1: 1300) (nick2: 1200)" from an authorized Jeopardy game bot
|
||||
if msgargs[0] == "Top" && msgargs[1] == "finishers:" && w.bot.Allowed("jeopardy", games) {
|
||||
w.Jeopardy(m, msgargs)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
// not an authorized bot or no integration matched the given message
|
||||
return false
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user