From 9f5492459836555792f1c7997bda1c9d4af8c2f8 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Tue, 9 Feb 2016 10:51:04 +0000 Subject: [PATCH] Forgot to actually call the function --- mods/metafora.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/mods/metafora.go b/mods/metafora.go index ed05b31..a10d165 100644 --- a/mods/metafora.go +++ b/mods/metafora.go @@ -24,12 +24,10 @@ var objects []string = []string{ } func metafora(broker *tg.Broker, update tg.APIMessage) { - if update.Text != nil { - if *(update.Text) == "/metafora" { - n := rand.Intn(len(actions)) - m := rand.Intn(len(objects)) - broker.SendTextMessage(update.Chat, actions[n]+" "+objects[m], nil) - return - } + if isCommand(update, "metafora") { + n := rand.Intn(len(actions)) + m := rand.Intn(len(objects)) + broker.SendTextMessage(update.Chat, actions[n]+" "+objects[m], nil) + return } }