1234567891011121314151617181920212223 |
- <?php
- /**
- * Created by IntelliJ IDEA.
- * User: solu
- * Date: 2019/3/26
- * Time: 4:59 PM
- */
- class TgController extends BaseController {
- public function actionWebhook($args) {
- $content = file_get_contents("php://input");
- $update = json_decode($content, true);
- file_put_contents('/tmp/telegram_message.log', var_export($update, true), FILE_APPEND);
- if (isset($update["message"])) {
- try {
- Telegram::processMessage($update["message"]);
- } catch (Exception $e) {
- Response::error(CODE_NORMAL_ERROR, $e->getMessage());
- }
- }
- }
- }
|