php-telegram-bot

How to solve a error with callback_data or method in PHP

天大地大妈咪最大 提交于 2019-12-13 03:18:51
问题 The idea is to have some buttons to do something, I got the following code, and something is wrong with the method (sendMessage) or callback_data because I received a undefined index error in all the rows where is the $message, if I use a url instead of a call back data works fine I use a webhook <?php $botToken = "TOKEN"; $website = "https://api.telegram.org/bot".$botToken; $update = file_get_contents('php://input'); $update = json_decode($update, TRUE); $chatId = $update["message"]["chat"][

Simulate sending a message to a bot from url

雨燕双飞 提交于 2019-12-13 02:56:14
问题 I'm trying to simulate how to send a message to a bot from a url but it doesn't work. I try to explain (note: all the ids and tokens are not real, they are only to explain !!) .. I've built a first bot from BotFather named Bot1Bot and then, form url if I try https://api.telegram.org/bot532708503:BBGn5ORfLppFu05-bi088F4SyKAiITfXH1w/getme the response is {"ok":true,"result":{"id":532708503,"is_bot":true,"first_name":"Bot1Bot","username":"Bot1Bot"}} Then I've built a second bot from BotFather

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

telegram botfather doesn't allow making more bots

泪湿孤枕 提交于 2019-12-11 02:05:49
问题 I'm trying to make telegram bot .I have made 20 bot so far and now when I select newbot from bot father it says this : " That I cannot do. You come to me asking for more than 20 bots. But you don't ask with respect. You don't offer friendship. You don't even think to call me Botfather" How Should I make more bots?? Thanks 回答1: It already said that you can't create more bot with this account. There is no way to do that except delete useless one. You might want to create bot via your friends'

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

Telegram Bot Game not working

筅森魡賤 提交于 2019-12-10 11:55:13
问题 I am realizing my bot telegram with a game. I wrote this: $content = file_get_contents("php://input"); $update = json_decode($content, true); if(!$update) { exit; } $chatId = isset($message['chat']['id']) ? $message['chat']['id'] : ""; header("Content-Type: application/json"); $parameters = array('chat_id' => $chatId); $parameters["method"] = "sendGame"; $parameters["game_short_name"] = "prova"; $parameters["text"] = parse_url("<my_html_5_url>"); $message = json_encode($parameters); echo json

How to send big files from URL to Telegram bot?

余生颓废 提交于 2019-12-07 15:50:25
问题 I have some big size files (in MP4 and Zip formats) and I want to send them to my chat by Telegram bot, I used the code below: file_get_contents('https://api.telegram.org/bot[[app:token]]/sendDocument?chat_id=24523586&document='.$fileAddress); But it just can send files with small sizes, less than 50MB! But I know there is no file size limitation for documents which are sending by file_id . You can see this page Now how can I make file_id for my files? My files are uploaded on my server and I

Chat API to add and remove members automatically [closed]

时光毁灭记忆、已成空白 提交于 2019-12-07 13:06:37
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 12 months ago . I'm working with a guy who uses telegram app to send bet tips on football matches. He wants the group to be private, right now he is adding and removing all members manually. The group is growing and now has more than 300 members which makes his job harder, what he wants is an automatic way of adding and

Chat API to add and remove members automatically [closed]

你离开我真会死。 提交于 2019-12-06 05:12:06
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 12 months ago . I'm working with a guy who uses telegram app to send bet tips on football matches. He wants the group to be private, right now he is adding and removing all members manually. The group is growing and now has more than 300 members which makes his job harder, what he wants is an automatic way of adding and removing members from the group . Is there any api that let me do this? I'm open to change to another chat