Eleirbag89 / TelegramBotPHP

A very simple PHP Telegram Bot API for sending messages.
http://eleirbag89.github.io/TelegramBotPHP
MIT License
807 stars 341 forks source link

My Web Hook Not Working #163

Closed rifkysyaripudin closed 6 years ago

rifkysyaripudin commented 6 years ago

Huy guys,

I have some problem

I have created a webhook and it has been registered at https://api.telegram.org/bot**[REDACTED]**/setWebhook?url=https://**[REDACTED]**/webhook

I made my application with a codeigniter framework.

public function webhook(){
  log_message('debug', 'webhook run');
  $result = $telegram->getData();
  log_message('error', print_r($result));
  $text = $result['message']['text'];
  $chat_id = $result['message']['chat']['id'];
  $content = array('chat_id' => $chat_id, 'text' => 'Test reply web hook');
  $telegram->sendMessage($content);
}

But when I send a chat, there is no reply. I have tried to log whether there is a request to the webhook that I made also apparently does not exist.

In this case i use cloudflare in hosting, so i have ssl from cloudflare.

Can help me?

rifkysyaripudin commented 6 years ago

i resolve

eMaurits commented 6 years ago

It's not smart that you have shared your bot id in the url you provided. I would change your issue to delete the id from the url. Or retrieve a new bot id from telegram

Eleirbag89 commented 6 years ago

Now github has an issue revision history, i would change the bot webhook url and bot token.