@@ -21,10 +21,10 @@ |
||
| 21 | 21 | |
| 22 | 22 | // Enter your MySQL database credentials |
| 23 | 23 | $mysql_credentials = [ |
| 24 | - 'host' => 'localhost', |
|
| 25 | - 'user' => 'dbuser', |
|
| 26 | - 'password' => 'dbpass', |
|
| 27 | - 'database' => 'dbname', |
|
| 24 | + 'host' => 'localhost', |
|
| 25 | + 'user' => 'dbuser', |
|
| 26 | + 'password' => 'dbpass', |
|
| 27 | + 'database' => 'dbname', |
|
| 28 | 28 | ]; |
| 29 | 29 | |
| 30 | 30 | try { |
@@ -14,7 +14,6 @@ |
||
| 14 | 14 | use Longman\TelegramBot\Conversation; |
| 15 | 15 | use Longman\TelegramBot\Commands\UserCommand; |
| 16 | 16 | use Longman\TelegramBot\Entities\ForceReply; |
| 17 | -use Longman\TelegramBot\Entities\ReplyKeyboardHide; |
|
| 18 | 17 | use Longman\TelegramBot\Entities\ReplyKeyboardMarkup; |
| 19 | 18 | |
| 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 | } |
@@ -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 | ) |
@@ -729,7 +729,7 @@ |
||
| 729 | 729 | /** |
| 730 | 730 | * Unset Webhook for bot |
| 731 | 731 | * |
| 732 | - * @return mixed |
|
| 732 | + * @return ServerResponse |
|
| 733 | 733 | * @throws \Longman\TelegramBot\Exception\TelegramException |
| 734 | 734 | */ |
| 735 | 735 | public function unsetWebHook() |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | /** |
| 46 | 46 | * Reflect |
| 47 | 47 | * |
| 48 | - * @param null $object |
|
| 48 | + * @param Entity $object |
|
| 49 | 49 | * @return array |
| 50 | 50 | */ |
| 51 | 51 | public function reflect($object = null) |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * ServerResponse constructor. |
| 35 | 35 | * |
| 36 | 36 | * @param array $data |
| 37 | - * @param $bot_name |
|
| 37 | + * @param string|null $bot_name |
|
| 38 | 38 | */ |
| 39 | 39 | public function __construct(array $data, $bot_name) |
| 40 | 40 | { |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | /** |
| 103 | 103 | * Get update id |
| 104 | 104 | * |
| 105 | - * @return mixed|null |
|
| 105 | + * @return integer |
|
| 106 | 106 | */ |
| 107 | 107 | public function getUpdateId() |
| 108 | 108 | { |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | /** |
| 37 | 37 | * Command execute method |
| 38 | 38 | * |
| 39 | - * @return mixed |
|
| 39 | + * @return \Longman\TelegramBot\Entities\ServerResponse |
|
| 40 | 40 | */ |
| 41 | 41 | public function execute() |
| 42 | 42 | { |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | /** |
| 21 | 21 | * @var string |
| 22 | 22 | */ |
| 23 | - protected $name = 'Channelchatcreated'; |
|
| 23 | + protected $name = 'Channelchatcreated'; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * @var string |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | /** |
| 31 | 31 | * @var string |
| 32 | 32 | */ |
| 33 | - protected $version = '1.0.1'; |
|
| 33 | + protected $version = '1.0.1'; |
|
| 34 | 34 | |
| 35 | 35 | /*public function execute() |
| 36 | 36 | { |