@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | require __DIR__ . '/../vendor/autoload.php'; |
3 | 3 | |
4 | -$filename='logfile.log'; |
|
4 | +$filename = 'logfile.log'; |
|
5 | 5 | $API_KEY = 'random'; |
6 | 6 | $BOT_NAME = 'bot_name'; |
7 | 7 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | new InlineKeyboardButton(['text' => 'callback', 'callback_data' => 'identifier']), |
42 | 42 | new InlineKeyboardButton(['text' => 'open url', 'url' => 'https://github.com/akalongman/php-telegram-bot']), |
43 | 43 | ]; |
44 | - $data = [ |
|
44 | + $data = [ |
|
45 | 45 | 'chat_id' => $message->getChat()->getId(), |
46 | 46 | 'text' => 'inline keyboard', |
47 | 47 | 'reply_markup' => new InlineKeyboardMarkup(['inline_keyboard' => [$inline_keyboard]]), |
@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | //Only get enabled Admin and User commands |
57 | 57 | /** @var Command[] $command_objs */ |
58 | - $command_objs = array_filter($this->telegram->getCommandsList(), function ($command_obj) { |
|
58 | + $command_objs = array_filter($this->telegram->getCommandsList(), function($command_obj) { |
|
59 | 59 | /** @var Command $command_obj */ |
60 | 60 | return !$command_obj->isSystemCommand() && $command_obj->isEnabled(); |
61 | 61 | }); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | return ''; |
75 | 75 | } |
76 | 76 | |
77 | - return (string)$response->getBody(); |
|
77 | + return (string) $response->getBody(); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | //http://openweathermap.org/weather-conditions |
95 | - $conditions = [ |
|
95 | + $conditions = [ |
|
96 | 96 | 'clear' => ' ☀️', |
97 | 97 | 'clouds' => ' ☁️', |
98 | 98 | 'rain' => ' ☔', |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $this->conversation = new Conversation($user_id, $chat_id, $this->getName()); |
81 | 81 | $notes = &$this->conversation->notes; |
82 | 82 | |
83 | - $channels = (array)$this->getConfig('your_channel'); |
|
83 | + $channels = (array) $this->getConfig('your_channel'); |
|
84 | 84 | if (isset($notes['state'])) { |
85 | 85 | $state = $notes['state']; |
86 | 86 | } else { |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | ]; |
345 | 345 | |
346 | 346 | if ($text !== '') { |
347 | - $channels = (array)$this->getConfig('your_channel'); |
|
347 | + $channels = (array) $this->getConfig('your_channel'); |
|
348 | 348 | $first_channel = $channels[0]; |
349 | 349 | $data['text'] = $this->publish( |
350 | 350 | new Message($message->reflect(), $this->telegram->getBotName()), |
@@ -296,7 +296,7 @@ |
||
296 | 296 | $this->type = 'Voice'; |
297 | 297 | } |
298 | 298 | |
299 | - $this->caption = isset($data['caption']) ? $data['caption'] : null;//string |
|
299 | + $this->caption = isset($data['caption']) ? $data['caption'] : null; //string |
|
300 | 300 | |
301 | 301 | $this->contact = isset($data['contact']) ? $data['contact'] : null; |
302 | 302 | if (!empty($this->contact)) { |
@@ -84,7 +84,7 @@ |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | try { |
87 | - $sth = self::$pdo->prepare('INSERT INTO `' . TB_CONVERSATION . '` |
|
87 | + $sth = self::$pdo->prepare('INSERT INTO `' . TB_CONVERSATION . '` |
|
88 | 88 | ( |
89 | 89 | `status`, `user_id`, `chat_id`, `command`, `notes`, `created_at`, `updated_at` |
90 | 90 | ) |
@@ -153,7 +153,7 @@ |
||
153 | 153 | 'first_name' => 'botname', |
154 | 154 | 'username' => 'namebot', |
155 | 155 | ]; |
156 | - $data['chat'] = ['id' => $data['chat_id']]; |
|
156 | + $data['chat'] = ['id' => $data['chat_id']]; |
|
157 | 157 | |
158 | 158 | $fake_response['result'] = $data; |
159 | 159 | } |