telegram

how to promote users to supergroup using telegram bot api(PHP)?

一笑奈何 提交于 2019-12-25 00:37:58
问题 I'm using this code to add some of my users to a supergroup but it doesn't work is there something wrong with it? function makereq($method,$datas=[]) { $url = "https://api.telegram.org/bot".API_KEY."/".$method; $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_POSTFIELDS,http_build_query($datas)); $res = curl_exec($ch); if(curl_error($ch)){ var_dump(curl_error($ch)); }else{ return json_decode($res); } } makereq(

Telethon: OperationalError: database is locked

て烟熏妆下的殇ゞ 提交于 2019-12-25 00:14:48
问题 Apologies if it is a silly question. I am trying telethon for the first time and it fails to synchronize with my telegram API. I get an IP address when I type this code: But I get this message when I try to connect to start or connect the client: And finally, I get OperationalError: database is locked error when I try to log in using my phone. The error message in full: -------------------------------------------------------------------- OperationalError Traceback (most recent call last)

Telegram bot sending message to itself but not in a public group

守給你的承諾、 提交于 2019-12-24 23:37:55
问题 I made a telegram bot with @botfather and promoted the bot as admin of the public group. Whenever I try to send a message from the python code, it always sends the message to itself, I mean in the private chat and not in the public group. Snapshot of the code written: bot_token = 'XXXXXXXXXXXXXXXXXXX' bot_chatID = '395014927' bot_message = "Testing" send_text = 'https://api.telegram.org/bot' + bot_token + '/sendMessage?chat_id=' + bot_chatID + '&text=' + bot_message response = requests.get

How to use setWebhook in Telegram with self certificates on Windows 7 and PHP?

此生再无相见时 提交于 2019-12-24 13:42:44
问题 I'm quite a newbye in Telegram and I'm trying moving my first steps with it. I've found a good tutorial here https://www.youtube.com/watch?v=hJBYojK7DO4: I've configured my Apache 2.4 with PHP and SSL and all works fine, also the samples in the tutorial. Troubles are using the setWebhook method .... when I try to put in my browser https://api.telegram.org/<my_bot_code>/setWebHook?url=https://localhost/Telegram/MyYouTubeTutorialBot/YouTubeTutorialBot.php the response is {"ok":false,"error_code

How to ensure that chat_id exists?

戏子无情 提交于 2019-12-24 08:59:14
问题 I wrote a piece of code which sends messages to a Telegram bot. In order to do so, I use the chat_id of the last conversation retrieved via the getUpdates method. id = requests.get(f"https://api.telegram.org/bot{token}/getUpdates").json()['result'][-1]['message']['chat']['id'] My understanding is that the a conversation exists if someone started one with the bot via /start . How can I initiate, from my code, a conversation to make sure a chat_id is available? (= that there is a conversion I

How do I know if a telegram user joined my channel?

守給你的承諾、 提交于 2019-12-24 07:53:48
问题 I am writing a C# desktop app.in this app I write a telegram Id of a user and it says that user is member of the channel or not. my bot is admin of the channel. I use telegram.bot v9 nugget and searched about this issue all day. I tried using GetChatMembersCountAsync() in v13 and a lot of other methods but didn't work. static private Api bot = new Api("Token"); long id; string channel="@ChannelName"; public Main() { InitializeComponent(); } private void button1_Click(object sender, EventArgs

How to listen for Telegram messages / push notifications in webogram

江枫思渺然 提交于 2019-12-24 07:09:19
问题 I need to receive latest telegram updates through the Telegram API. It seems that webogram is the only up-to-date javascript library for the task. I was using telegram link previously which did the task fine over TCP. I want to know if webogram can do the same, and specifically what methods to use for receiving incoming messages / push notifications. 回答1: The log below is from webogram. I've added some comments with console.log to show what functions are being called and some extra response

How to send valid TCP messages to a telegram server on .NET framework?

不想你离开。 提交于 2019-12-24 06:23:40
问题 So I want to create a telegram client using .NET framework. I read this page on telegram website, which is an example of authorization process and messages exchanged between client and the server. Well, my program can generate the described 40-byte message which must be send to server as request, and the server is supposed to return an 84-byte message back. However I'm having difficulties with telegram customization of the TCP. My program generates the 40-byte request and feeds it to the .NET

How to send valid TCP messages to a telegram server on .NET framework?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 06:23:06
问题 So I want to create a telegram client using .NET framework. I read this page on telegram website, which is an example of authorization process and messages exchanged between client and the server. Well, my program can generate the described 40-byte message which must be send to server as request, and the server is supposed to return an 84-byte message back. However I'm having difficulties with telegram customization of the TCP. My program generates the 40-byte request and feeds it to the .NET

How to send valid TCP messages to a telegram server on .NET framework?

怎甘沉沦 提交于 2019-12-24 06:23:05
问题 So I want to create a telegram client using .NET framework. I read this page on telegram website, which is an example of authorization process and messages exchanged between client and the server. Well, my program can generate the described 40-byte message which must be send to server as request, and the server is supposed to return an 84-byte message back. However I'm having difficulties with telegram customization of the TCP. My program generates the 40-byte request and feeds it to the .NET