telegram

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 force telegram to update link preview?

人走茶凉 提交于 2019-12-02 16:13:22
Telegram show description meta tag as link preview. I changed the description meta tag but the link preview of my website didn't changed. How to force telegram to update link preview? littleguga Go to @webpagebot and send the link (up to 10) you want to update. Automatically will scan your site and generate the new image thumbnail, site name and description. Remember to have og prefix in your html tag as: <html prefix="og: http://ogp.me/ns#"> or telegram bot will not update the graph cache. via telegramgeeks Morteza Pourmirzai You may add /?v=n at the end of URL when sharing the link, where n

Accessing Telegram API via web-based client [duplicate]

别来无恙 提交于 2019-12-02 08:12:46
This question already has an answer here: How to implement authorization using a Telegram API? 4 answers I am studying Telegram API to develop a web-based app to communicate with Telegram API server but stumble upon this statement. The protocol is designed for access to a server API from applications running on mobile devices. It must be emphasized that a web browser is not such an application. Does this anyway tell us that Telegram API is ONLY accessible by Mobile-based applications (Clients) such as those on Android, iOS and etc? You might find it easier to communicate with Telegram through

Telegram Api layer 52 (super groups and channels)

穿精又带淫゛_ 提交于 2019-12-02 08:00:29
问题 i am java developer . i found telegram java api in github .but this api is old . i want to make new library for java (support channels and superGroups). but i cant see new layer in telegram site .the last layer in site is layer23 and it can not support channels and superGroups. i want new layer of schema and json. please help me 回答1: At this time, the latest telegram layer is 54 You can always get the latest Telegram API layer from here: https://raw.githubusercontent.com/telegramdesktop

Telegram Api - Creating an Authorization Key 404 error

本小妞迷上赌 提交于 2019-12-01 23:03:44
I am trying to write a simple program in python to use telegram api, (not bot api, main messaging api) Now i have written this code #!/usr/bin/env python import socket import random import time import struct import requests def swap64(i): return struct.unpack("<L", struct.pack(">L", i))[0] MESSAGE = '0000000000000000'+format(swap32(int(time.time()*1000%1000)<<21|random.randint(0,1048575)<<3|4),'x')+format(swap32(int(time.time())),'x')+'140000007897466068edeaecd1372139bbb0394b6fd775d3' res = requests.post(url='http://149.154.167.40', data=bytes.fromhex(MESSAGE), headers={'connection': 'keep

Decompose a number into 2 prime co-factors

杀马特。学长 韩版系。学妹 提交于 2019-12-01 21:37:31
One of the requirements for Telegram Authentication is decomposing a given number into 2 prime co-factors. In particular P*Q = N, where N < 2^63 How can we find the smaller prime co-factor, such that P < square_root(N) My Suggestions: 1) pre-compute primes from 3 to 2^31.5 , then test if N mod P = 0 2) Find an algorithm to test for primes (but we still have to test N mod P =0 ) Is there an algorithm for primes that is well suited to this case? Ugh! I just put this program in and then realized you had tagged your question C#. This is C++, a version of Pollard Rho I wrote a couple years ago and

How can I detect whether a user deletes the Telegram Bot chat?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 17:53:12
Is it possible to check, via an API, whether somebody has deleted the Bot Chat in Telegram? My test : Currently if a user deletes a chat, new messages will not stop sending to user. Nope. Only by getting error while sending user something. Even calling sendChatAction method does not return error if user blocked the chat: $ curl https://api.telegram.org/bot***/sendChatAction -d 'chat_id=7975895' -d "action=typing" {"ok":true,"result":true} $ curl https://api.telegram.org/bot***/sendMessage -d 'chat_id=81083738' -d "text=ololo" {"ok":false,"error_code":403,"description":"[Error]: Bot was blocked

Add new contact in api telegram python telethon

若如初见. 提交于 2019-12-01 17:50:48
How do I save a number in my contacts in telethon python? from telethon import TelegramClient from telethon.tl.functions.contacts import GetContactsRequest from telethon.tl.types import InputPeerUser client = TelegramClient('arta0', api_id, api_hash) client.connect() #number=+19133704541 #name='ali karimi' What module do I need to add contact? You can create a contact like this: contact = InputPhoneContact(client_id = 0, phone = "+12345678", first_name="ABC", last_name="abc") result = client.invoke(ImportContactsRequest([contact], replace=True)) To create a new contact you need to pass 0 for

How can I detect whether a user deletes the Telegram Bot chat?

柔情痞子 提交于 2019-12-01 16:24:08
问题 Is it possible to check, via an API, whether somebody has deleted the Bot Chat in Telegram? My test : Currently if a user deletes a chat, new messages will not stop sending to user. 回答1: Nope. Only by getting error while sending user something. Even calling sendChatAction method does not return error if user blocked the chat: $ curl https://api.telegram.org/bot***/sendChatAction -d 'chat_id=7975895' -d "action=typing" {"ok":true,"result":true} $ curl https://api.telegram.org/bot***

how i can restore sessions old in telethon telegram and connect this again(without send again code))

一曲冷凌霜 提交于 2019-12-01 12:11:11
i use this script for connect and create sessions in telethon from telethon import TelegramClient from telethon.tl.functions.messages import GetHistoryRequest from telethon.utils import get_input_peer api_id = 7**** api_hash = 'ef584d*****************' client = TelegramClient('+15159947451', api_id, api_hash) client.connect() if not client.is_user_authorized(): client.send_code_request('+15159947451') client.sign_in('+15159947451', cod) with this cod i can login good in this number telegram and create file:+15159947451.session. now i close and disconnect, how i can again login this number with