Answer the question
In order to leave comments, you need to log in
Why is Telegram webHook giving 500 error in yii2?
Hello!
I’m trying to make a telegram webhook, I
set the link itself, the status on the link is OK
when I try to pull the link manually - the message arrives in the cart, everything is OK,
but when I send the message to the cart, I don’t receive a response, and the getWebhookInfo status shows 500:
Wrong response from the webhook: 500 Internal Server Error
getWebhookInfo:
{"ok":true,"result":{"url":"https://domain.ru/telegram/get","has_custom_certificate":false,"pending_update_count":39,"last_error_date":1643103534,"last_error_message":"Wrong response from the webhook: 500 Internal Server Error","max_connections":40,"ip_address":"xxx.xxx.xxx.xxx"}}
class TelegramController extends BaseController
{
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'get' => ['post'],
],
],
];
}
public function beforeAction($action)
{
if ($action->id == 'get') {
$this->enableCsrfValidation = false;
}
return parent::beforeAction($action);
}
public function actionGet()
{
TelegramBot::message('000000', 'ok');
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question