telegram-webhook

Message not receiving automatically for Telegram CHATBOT funciton using PHP

纵饮孤独 提交于 2019-12-23 04:33:31
问题 In order to integrate Telegram Chatbot using PHP, I have already followed below steps. Server with SSL certificate Webhook with working condition URL : https://api.telegram.org/bot/setWebhook?url=https://mywebsite.com/path/to/filename.php Created ChatBot and have a valid Token After that, I have made simple PHP file using following line of code. <?php define('BOT_TOKEN', 'CHANGE-ME'); define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/'); // This is to read incoming message and

clear pending_update_count in Telegram Bot

寵の児 提交于 2019-12-12 04:04:22
问题 I created a Telegram Bot and setwebhook to a ssl url. My developing language is Php. In testing time, every thing worked fine but after many hours and two or three users have been registered, I got bellow error on getWebhookInfo {"ok":true,"result":{"url":"https://xx.com/get-text","has_custom_certificate":false,"pending_update_count":111,"last_error_date":1501993548,"last_error_message":"Read timeout expired","max_connections":40}} I found that pending_update_count could not be cleared. After

What's the structure of Telegram's updates to webhook Flask app?

梦想的初衷 提交于 2019-12-11 07:48:53
问题 I'm trying to program a Telegram bot using webhook in a Flask app with telepot, in PythonAnywhere. And so, I want to know what's the structure of the updates comming from Telegram, so as to know what's there and how is it called, and use it in the bot, essentially. I've tried to log the message it receives to the console (though I'm not sure where the console should be on PythonAnywhere), and also to write in a file in the same server, through python, but that's not working either. #This that

Can't setup a webhook for a telegram bot

非 Y 不嫁゛ 提交于 2019-12-11 04:25:15
问题 I'm trying make a simple telegram bot in Google App Engine. When I open the console in GAE, and enter the following, the webhook gets set up just fine curl -F "url=https://example.appspot.com:8443/<token>" -F "certificate=@certificate.pem" https://api.telegram.org/bot<token>/setWebhook But when I run this python script in GAE (of course, having deleted the previous webhook), the webhook doesn't get set up. I couldn't figure out what did I do wrong. import sys import os import time from flask

Upload file on Telegram with bot

白昼怎懂夜的黑 提交于 2019-12-11 01:47:01
问题 I want to send file from URL to user with Telegram Bots, My files extension in .attheme but I can't upload this files from Url. Currently I can upload .zip , .pdf , but i want upload a .attheme file from PHP code. This bot can upload any type of files into Telegram: @uploadbot How can I do this ? 回答1: Sending a file by URL only works for certaining file types. If you want to upload other types of files you will have to post the file, after saving it on your own server, using multipart/form

encountering “Read timeout expired” error by Webhook after 60 Sec of execution

折月煮酒 提交于 2019-12-04 21:12:30
lately Im facing a problem with telegram bot api which i haven't had before... Im using Webhook method of connection to catch bot requests and respoding with PHP script and sometimes the triggered script takes more than a minute to finish processing. about a month ago everything was working fine and telegram bot wait long enough for script to completely execute, but now my connection suspend and im getting this Webhook error through telegram api "Read timeout expired" after 60 Seconds of execution and then it attempt the same request again and these goes on and on until my server overloads

How can create menu for telegram bot in bot father?

十年热恋 提交于 2019-12-01 06:38:54
I'm new in telegram bot and see this bot: that but when type /start show menu to me and with out type slash to command just fire the menu button,how can i create menu in telegram like that bot? You must add the return ajax call a string like this: '{ "keyboard": [["uno :+1:"],["uno \ud83d\udc4d", "due"],["uno", "due","tre"],["uno", "due","tre","quattro"]]}'; The result is: 来源: https://stackoverflow.com/questions/41956166/how-can-create-menu-for-telegram-bot-in-bot-father

Clear “pending_update_count” in Telegram Bot

两盒软妹~` 提交于 2019-12-01 03:56:31
I want to clear all pending_update_count in my bot! The output of below command : https://api.telegram.org/botxxxxxxxxxxxxxxxx/getWebhookInfo Obviously I replaced the real API token with xxx is this : { "ok":true,"result": { "url":"", "has_custom_certificate":false, "pending_update_count":5154 } } As you can see, I have 5154 unread updates til now!! ( I'm pretty sure this pending updates are errors! Because no one uses this Bot! It's just a test Bot) By the way, this pending_update_count number are increasing so fast! Now that I'm writing this post the number increased 51 and reached to 5205 !

How can create menu for telegram bot in bot father?

淺唱寂寞╮ 提交于 2019-12-01 03:44:12
问题 I'm new in telegram bot and see this bot: that but when type /start show menu to me and with out type slash to command just fire the menu button,how can i create menu in telegram like that bot? 回答1: You must add the return ajax call a string like this: '{ "keyboard": [["uno :+1:"],["uno \ud83d\udc4d", "due"],["uno", "due","tre"],["uno", "due","tre","quattro"]]}'; The result is: 来源: https://stackoverflow.com/questions/41956166/how-can-create-menu-for-telegram-bot-in-bot-father