Minor fix to canChatWith check
authorCameron Ball <cameron@cameron1729.xyz>
Sat, 22 Dec 2018 14:44:00 +0000 (22:44 +0800)
committerCameron Ball <cameron@cameron1729.xyz>
Fri, 28 Dec 2018 06:27:20 +0000 (14:27 +0800)
src/purjolok.php

index acd6a42..bc938dd 100644 (file)
@@ -5,7 +5,7 @@ require_once('common.php');
 use Telegram\Bot\Actions;
 use Telegram\Bot\Commands\Command;
 
-if(!canChatWith(getTelegram()->getWebhookUpdates())) {
+if(getTelegram()->getWebHookUpdates() && !canChatWith(getTelegram()->getWebhookUpdates())) {
     getTelegram()->sendMessage([
         'chat_id' => getTelegram()->getWebhookUpdates()->get('message')->get('chat')->get('id'),
         'text' => "Sorry, Dad says I can't talk to you."