telegram-bot

Upload self-signed ssl certificate to telegram

老子叫甜甜 提交于 2019-12-03 04:01:29
I'm making telegram bot using webhook on php. The problem is that the webhook doesn't set correctly and idk whats the matter. my setwebhook code : $ch = curl_init(API_URL); try { $cert = new \CURLFile(SSL_KEY); apiRequest('setWebhook', array('url' => WEBHOOK_URL , 'certificate' => $cert)); echo "webhook set"; } catch (Exception $e) { echo "error"; } You can set the webhook via the terminal rather than in your code like so: curl -F "url=https://your_domain.com/where-the-script-will-be/bot-script.php" -F "certificate=@/location/of/cert/certificate.crt" https://api.telegram.org/bot000000000

How do I get authentication in a telegram bot?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 02:20:10
问题 Telegram Bots are ready now. If we use the analogy of web browser and websites, the telegram client applications are like the browser clients. The Telegram Chatrooms are like websites. Suppose we have some information we only want to restrict to certain users, on the websites, we will have authentication. How do we achieve the same effect on the Telegram Bots? I was told that I can use deep linking. See description here I will reproduce it below: Create a bot with a suitable username, e.g.

Telegram Bot How to delete or remove a message or media from a channel or group

只愿长相守 提交于 2019-12-03 01:22:16
I want to know an example of removing message or file like a photo I did not find any functional tutorial in this regard, ihoru There is no such functionality in Telegram Bot API right now. UPD 2017-05-19: There is an official method deleteMessage , more info: https://core.telegram.org/bots/api#deletemessage https://stackoverflow.com/a/43965602/1140438 fox.cpp There is an official support of deleteMessage method in Bot API 3.0. More details here: https://core.telegram.org/bots/api#deletemessage https://api.telegram.org/botTOKEN/deleteMessage?chat_id=CID&message_id=MID As you can see there are

Calling Telegram API to create a feedreader bot [closed]

人走茶凉 提交于 2019-12-03 00:29:20
Closed . This question needs to be more focused. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it focuses on one problem only by editing this post . I have seen New API for bots are enabled to create custome bots,I have seen some sources such as this and this I have also read about @fatherbot which is about registering bots,I also searched about some examples about telegram bots such as this one,I know how write codes in php and python but can not find out how to call api methods and where to get start.Does any one has any idea how to

How we should send query to Telegram bot API?

馋奶兔 提交于 2019-12-02 19:25:39
After creating a telegram bot and gain bot token, I want to send a request to the bot API. This link says we must send the HTTP request like this: https://api.telegram.org/bot<token>/METHOD_NAME and brings example for easiest method "getme" which has not any input parameters. Imagine I want to send some messages. I should use the sendMessage method which has two Required input parameters: chat_ID and text. Now my Questions begins: How can I write this sendMessage method in above request format with its parameters? I tried sendMessage(param1,param2) and received method not found message. What

Telegram BOT Api: how to send a photo using PHP?

独自空忆成欢 提交于 2019-12-02 18:37:32
The sendPhoto command require an argument photo defined as InputFile or String . The API doc tells: Photo to send. You can either pass a file_id as String to resend a photo that is already on the Telegram servers, or upload a new photo using multipart/form-data. And InputFile This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser. So I tried this method $bot_url = "https://api.telegram.org/bot<bot_id>/"; $url = $bot_url . "sendPhoto?chat_id=" . $chat_id; $ch = curl_init(); curl_setopt($ch,

How do I get authentication in a telegram bot?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 16:16:14
Telegram Bots are ready now. If we use the analogy of web browser and websites, the telegram client applications are like the browser clients. The Telegram Chatrooms are like websites. Suppose we have some information we only want to restrict to certain users, on the websites, we will have authentication. How do we achieve the same effect on the Telegram Bots? I was told that I can use deep linking. See description here I will reproduce it below: Create a bot with a suitable username, e.g. @ExampleComBot Set up a webhook for incoming messages Generate a random string of a sufficient length, e

How to convert Telegram voice in a wave file in python

ぃ、小莉子 提交于 2019-12-02 15:57:47
问题 I'm trying to save a Telegram voice file in a wave audio file using soundfile library: def ReceiveVoice(bot, update, user_data): voice = bot.getFile(update.message.voice.file_id) voice.download('file.ogg') data, samplerate = sf.read('file.ogg') sf.write('file.wav', data, samplerate) But I'm receiving the following error: File "C:\Python27\lib\site-packages\soundfile.py", line 257, in read subtype, endian, format, closefd) as f: File "C:\Python27\lib\site-packages\soundfile.py", line 624, in _

always failed to send image using telegram API using PHP

和自甴很熟 提交于 2019-12-02 07:47:14
I want to make a function to send an image using Telegram API (reference API: https://github.com/mgp25/Telegram-Bot-API/ ), but when I try to run this, I always get an error like this: Message: file_get_contents(''): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request Here is my code [updated]: <?php require 'Telegram.php'; $tele = new telegramBot('token'); //$info = $tele->sendMessage('218945828',"wadaw"); $url= 'image/maldini.jpg'; $info = $tele->sendPhoto('chatid',$url); print_r($info); ?> error : Warning: file_get_contents( https://api.telegram.org/bot_token/sendPhoto?chat

Telegram bot keybord send via JSON

隐身守侯 提交于 2019-12-02 03:54:41
问题 I'm using MS Bot Framework. I want to sen custom keyboard to user, so i try to reply message with this JSON: public async Task<Message> Post([FromBody]Message message) { var connector = new ConnectorClient(); if (message.Type == "Message") { var replyMessage = message.CreateReplyMessage($"You sent message"); replyMessage.ChannelData = @" { ""method"": ""sendMessage"", ""parameters"": { ""reply_markup"": { ""keyboard"":[[[""1""],[""2""]],[[""3""]],[[""4""],[""5""],[""6""]]] } } }"; return