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
|
// integration with games in other bots
|
||||||
isBot, games := w.integration.Bot(m)
|
if w.integration.HandleIntegration(m, args) {
|
||||||
if isBot {
|
return
|
||||||
if w.integration.HandleIntegration(m, args, games) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if command char (or something weird) is present
|
// 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
|
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
|
isBot, games := w.Bot(m)
|
||||||
if msgargs[0] == "Top" && msgargs[1] == "finishers:" && w.bot.Allowed("jeopardy", games) {
|
if isBot {
|
||||||
w.Jeopardy(m, msgargs)
|
// handles a message "Top finishers: (nick1: 1300) (nick2: 1200)" from an authorized Jeopardy game bot
|
||||||
return true
|
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
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user