diff --git a/bot/Bot.php b/bot/Bot.php index ae0da97..cdfa45f 100644 --- a/bot/Bot.php +++ b/bot/Bot.php @@ -51,9 +51,9 @@ class Bot $preg_pattern = sprintf('#%s#i', $pattern); if (preg_match($preg_pattern, $sentence, $matches)) { if (is_callable($command)) { - $command($this); + call_user_func($command, $this); } else { - $command->getMessage($this, $matches); + call_user_func([$command, 'getMessage'], $this, $matches); } return; }