From a4b11d0b750a091380c18a7d62c683c16cdcba21 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Fri, 2 Nov 2018 15:20:10 +0100 Subject: [PATCH] Oh forgot this thing --- mods/main.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/mods/main.go b/mods/main.go index 643f8d5..e394ac4 100644 --- a/mods/main.go +++ b/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) + } } } }