yii2-bot-telegram
yii2-bot-telegram copied to clipboard
file_get_contents("php://input")
hi i am trying to use your dependency in my project but when trying to call Yii :: $ app-> telegram-> sendMessage ([ 'chat_id' => $ chat_id, 'text' => 'test', ]); after which I get a 500 error, because the data from my form goes into your constructor:
public function __construct ($ config = []) {
parent :: __ construct ($ config);
$ input = file_get_contents ("php: // input");
$ array = json_decode ($ input, true);
$ this-> input = new Input ($ array);
}
namely in $ input = file_get_contents ("php: // input") your script can work fine and error-free without $ input = file_get_contents ("php: // input"); $ array = json_decode ($ input, true); $ this-> input = new Input ($ array);
Hi I could not handle your error. Please indicate the circumstances in which the error occurs.
i am trying to use this code: $ res = Yii :: $ app-> telegram-> sendMessage ([ 'chat_id' => $ chat_id, 'text' => 'hello world !!' ]); In my controller, in which a post request sends a notification to mail with data from my form, I wanted to make the notifications arrive in telegram, but the data from my form goes into this piece of code: $ input = file_get_contents ("php: / / input "); in TelegramBase After which I get a 500 error.
My dear friend, in a part of the explanation, I said that you should get an answer from Telegram enableCsrfValidation Turn off. Probably a problem with this part. https://github.com/akbarjoudi/yii2-bot-telegram#usage-in-controller
My dear friend, in a part of the explanation, I said that you should get an answer from Telegram enableCsrfValidation Turn off. Probably a problem with this part. https://github.com/akbarjoudi/yii2-bot-telegram#usage-in-controller
No, the problem is that I cant use telegram in my usual controllers.
hi i am trying to use your dependency in my project but when trying to call Yii :: $ app-> telegram-> sendMessage ([ 'chat_id' => $ chat_id, 'text' => 'test', ]); after which I get a 500 error, because the data from my form goes into your constructor:
public function __construct ($ config = []) {
parent :: __ construct ($ config); $ input = file_get_contents ("php: // input"); $ array = json_decode ($ input, true); $ this-> input = new Input ($ array); }
namely in $ input = file_get_contents ("php: // input") your script can work fine and error-free without $ input = file_get_contents ("php: // input"); $ array = json_decode ($ input, true); $ this-> input = new Input ($ array);
Сould you solve this problem?
Dear friend @Rafinol I can not see the result of your error and in this case I can not recognize the desired error. Please show me the error that occurs in php.