Oh forgot this thing
This commit is contained in:
parent
a565a604e8
commit
a4b11d0b75
1 changed files with 11 additions and 5 deletions
16
mods/main.go
16
mods/main.go
|
@ -99,12 +99,18 @@ func initmods() {
|
|||
}
|
||||
|
||||
func dispatch(broker *tg.Broker, update tg.APIUpdate) {
|
||||
for _, mod := range mods {
|
||||
if mod.OnInline != nil {
|
||||
go mod.OnInline(broker, *update.Inline)
|
||||
if update.Inline != nil {
|
||||
for _, mod := range mods {
|
||||
if mod.OnInline != nil {
|
||||
go mod.OnInline(broker, *update.Inline)
|
||||
}
|
||||
}
|
||||
if mod.OnMessage != nil {
|
||||
go mod.OnMessage(broker, *update.Message)
|
||||
}
|
||||
if update.Message != nil {
|
||||
for _, mod := range mods {
|
||||
if mod.OnMessage != nil {
|
||||
go mod.OnMessage(broker, *update.Message)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue