@@ -14,7 +14,6 @@ |
||
14 | 14 | use Longman\TelegramBot\Conversation; |
15 | 15 | use Longman\TelegramBot\Commands\AdminCommand; |
16 | 16 | use Longman\TelegramBot\Entities\Message; |
17 | -use Longman\TelegramBot\Entities\ReplyKeyboardHide; |
|
18 | 17 | use Longman\TelegramBot\Entities\ReplyKeyboardMarkup; |
19 | 18 | use Longman\TelegramBot\Exception\TelegramException; |
20 | 19 |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | // Conversation |
75 | 75 | $this->conversation = new Conversation($user_id, $chat_id, $this->getName()); |
76 | 76 | |
77 | - $channels = (array)$this->getConfig('your_channel'); |
|
77 | + $channels = (array) $this->getConfig('your_channel'); |
|
78 | 78 | if (!isset($this->conversation->notes['state'])) { |
79 | 79 | $state = (count($channels) == 0) ? -1 : 0; |
80 | 80 | $this->conversation->notes['last_message_id'] = $message->getMessageId(); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | 'selective' => true |
163 | 163 | ] |
164 | 164 | ); |
165 | - $data['reply_markup'] = $reply_keyboard_markup; |
|
165 | + $data['reply_markup'] = $reply_keyboard_markup; |
|
166 | 166 | |
167 | 167 | $data['text'] = 'Would you insert caption?'; |
168 | 168 | if ($this->conversation->notes['last_message_id'] != $message->getMessageId() && !($text == 'Yes' || $text == 'No')) { |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | if ($text === '') { |
267 | 267 | $data['text'] = 'Usage: /sendtochannel <text>'; |
268 | 268 | } else { |
269 | - $channels = (array)$this->getConfig('your_channel'); |
|
269 | + $channels = (array) $this->getConfig('your_channel'); |
|
270 | 270 | $first_channel = $channels[0]; |
271 | 271 | $data['text'] = $this->publish(new Message($message->reflect(), 'anystring'), $first_channel); |
272 | 272 | } |
@@ -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 |
@@ -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' => ' ☔', |
@@ -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 | } |
@@ -12,7 +12,6 @@ |
||
12 | 12 | |
13 | 13 | use Longman\TelegramBot\Commands\UserCommand; |
14 | 14 | use Longman\TelegramBot\Request; |
15 | -use Longman\TelegramBot\Entities\ReplyKeyboardMarkup; |
|
16 | 15 | |
17 | 16 | /** |
18 | 17 | * User "/markdown" command |
@@ -14,7 +14,6 @@ |
||
14 | 14 | use Longman\TelegramBot\Conversation; |
15 | 15 | use Longman\TelegramBot\Commands\AdminCommand; |
16 | 16 | use Longman\TelegramBot\Entities\Message; |
17 | -use Longman\TelegramBot\Entities\ReplyKeyboardHide; |
|
18 | 17 | use Longman\TelegramBot\Entities\ReplyKeyboardMarkup; |
19 | 18 | use Longman\TelegramBot\Exception\TelegramException; |
20 | 19 |
@@ -224,7 +224,7 @@ |
||
224 | 224 | 'selective' => true, |
225 | 225 | ] |
226 | 226 | ); |
227 | - $result = Request::sendMessage($data); |
|
227 | + $result = Request::sendMessage($data); |
|
228 | 228 | break; |
229 | 229 | } |
230 | 230 | $this->conversation->notes['phone_number'] = $message->getContact()->getPhoneNumber(); |
@@ -13,7 +13,6 @@ |
||
13 | 13 | namespace Longman\TelegramBot\Commands\UserCommands; |
14 | 14 | |
15 | 15 | use Longman\TelegramBot\Commands\UserCommand; |
16 | -use Longman\TelegramBot\Entities\File; |
|
17 | 16 | use Longman\TelegramBot\Request; |
18 | 17 | |
19 | 18 | /** |