foamrider / osticket-telegram

Post notifications from osTicket to Telegram with Telegram Bot
MIT License
31 stars 24 forks source link

Update telegrambot.php #2

Closed vviudez closed 6 years ago

vviudez commented 8 years ago

Corrections for avoiding HTTP 502 error

foamrider commented 8 years ago

Seems to be breaking working config

Whats is the expected input / result?

vviudez commented 8 years ago

Using 1.9.14 version of osTicket, the plugin can't send messages to the Telegram API servers. All the responsers are HTTP 502. After debugging a while, I noticed that the plugin doesn't adds the command "sendMessage" to the URL, only in the POST fields. For some reason, the API doesn't recognize that.

Simply modifiying the $url variable, adding the command, it works without problems.

foamrider commented 8 years ago

That hasn't been a problem for me yet. Why can't you just append /sendMessage to the url in plugin-settings?

Also, got it working. There is a typ-o in L27. You should also check for trailing slash if adding to the $url variable.