telegram

Telegram sends duplicate POST JSON requests to webhook

荒凉一梦 提交于 2019-12-10 15:18:35
问题 I am trying to develop city bot for telegram, but meet a problem. After sending message to bot, Telegram sends 2 duplicate requests to a webhook url. Webhook script works twice and sends twice responses to user. Script - hellobot.php from official telegram docs. Server vps hosting with self-signed SSL, with uploaded cert key to telegram. From server logs. 149.154.167.209 - - [28/Jun/2016:13:48:00 +0300] "POST /apps/gate.php HTTP/1.0" 200 86 "-" "- 149.154.167.209 - - [28/Jun/2016:13:48:00

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 can I redirect messages from telegram channels that are in certain format?[telegram bot]

浪尽此生 提交于 2019-12-10 00:30:40
问题 I have many telegram channels, 24\7 they send messages in the format "buy usdjpy sl 145.2 tp 167.4" "eurusd sell sl 145.2 tp 167.4" "eurusd sl 145.2 tp 167.4 SELL" or these words in some order My idea is to create app that checks every channel's message, and redirects it to my channel if it is in the above format. Does telegram api allow it? 回答1: I solved a similar problem with TdLib. Their GitHub site has full C++, Java and C# examples that you can just modify. I worked on the Java example,

supply a filename for a file-like object created by urlopen() or requests.get()

我的未来我决定 提交于 2019-12-09 16:30:32
问题 I am building a Telegram bot using a Telepot library. To send a picture downloaded from Internet I have to use sendPhoto method, which accepts a file-like object. Looking through the docs I found this advice: If the file-like object is obtained by urlopen() , you most likely have to supply a filename because Telegram servers require to know the file extension. So the question is, if I get my filelike object by opening it with requests.get and wrapping with BytesIO like so: res = requests.get

Can i get a phone number by user id via Telegram Bot API?

北城以北 提交于 2019-12-09 09:03:39
问题 I'm using Telegram Bot API for sending instant messages to users. I've installed nuget package. This package is recommend by telegram developers. I've created a telegram bot and successfully got access to it by using code. When I send messsage to bot, bot gets some info about sender. I need the phone numbers of users to identify them in our system and send the information back to them. My question is Can i get a user phone number by telegramUserId ? I'm doing it for user convenience. If i

Telegram API with Google Apps Script

旧时模样 提交于 2019-12-09 06:02:54
问题 I'm searching an example of Telegram API usage with Google Apps Script, or anyone/anything that can help me to learn how to use this API, for instance to send a message to a certain user 回答1: I was searching for something similar, and couldn't find any, so I have made my own, I will write it down here perhaps someone would make use of it. This is a simple proof of concept that works: function sendTelegramNotification(botSecret, chatId, body) { var response = UrlFetchApp.fetch("https://api

Telegram source code compile error

北城余情 提交于 2019-12-09 03:07:31
i download Telegram source code from github,i got some problems. First: Error for NDK, I found the solution to solve it. Second: it shows google-services.json is missing after I solve the first problem. So I download the google-services.json and put it in the src. Now here is my problem, it shows an Error in one location like this No matching client found for package name I try to put the json file in that location.It doesn't work. Someone can teach me how to solve this problem,please. Where can i find the Telegram toturial for chat besides official ? Is anyone can compile Telegram source code

Telegram bot weird error : Bad Request: wrong file identifier/HTTP URL specified

倖福魔咒の 提交于 2019-12-09 02:28:12
问题 I am sending message to telegram channel using bot. With using webhook method. I'm sending file_id via the link. I got the file_id from a channel post. For some files like GIF & video format (MP4), when i use this code: $url = 'https://api.telegram.org/bot'.token.'/sendVideo?chat_id='.uid."&video=".$file."&caption=" .urlencode($caption); file_get_contents($url); i get such this error : {"ok":false,"error_code":400,"description":"Bad Request: wrong file identifier/HTTP URL specified"} I really

telegram channel's post view count [closed]

ε祈祈猫儿з 提交于 2019-12-08 16:07:06
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 12 months ago . I'm an intermediate vb.net programmer and this is my first time trying to know telegram core more. I want to learn more about telegram channel's post view count system. How does it work ? and what are the API parts involved regarding to this. I searched the web , but I didn't

Telegram Bot API error when try to edit message: “Bad Request: message not found”

末鹿安然 提交于 2019-12-08 15:19:04
问题 I've tried to edit bot's message which was sended about 2 hours ago and got this error and supposed that this message so old for editing that it is unable. Then I've tried to edit another message which was sended a little later and it was successful. But after this I've tried to edit one of recently sended messages an got this error one more time. Now it seems like request's results is random. What does it mean? Here an example of my POST query: https://api.telegram.org/bot{token}