diff --git a/mods/main.go b/mods/main.go index 9cce2c3..643f8d5 100644 --- a/mods/main.go +++ b/mods/main.go @@ -15,6 +15,7 @@ type Mod struct { Description string OnInit func() OnMessage func(*tg.Broker, tg.APIMessage) + OnInline func(*tg.Broker, tg.APIInlineQuery) Help func(*tg.Broker, tg.APIMessage) } @@ -97,10 +98,13 @@ func initmods() { log.Println("Active modules: " + strings.Join(enabledmods, ", ")) } -func dispatch(broker *tg.Broker, update tg.APIMessage) { +func dispatch(broker *tg.Broker, update tg.APIUpdate) { for _, mod := range mods { + if mod.OnInline != nil { + go mod.OnInline(broker, *update.Inline) + } if mod.OnMessage != nil { - go mod.OnMessage(broker, update) + go mod.OnMessage(broker, *update.Message) } } }