Simplified HTTP version of the MTProto API for bots
The Telegram Bot API is an HTTP-based interface for building bots to interact with Telegram, featuring recent updates like checklists and gifts.
import requests
bot_token = 'YOUR_BOT_TOKEN'
chat_id = 'YOUR_CHAT_ID' # e.g., a user ID or group chat ID
message_text = 'Hello from your bot!'
url = f'https://api.telegram.org/bot{bot_token}/sendMessage'
payload = {
'chat_id': chat_id,
'text': message_text
}
response = requests.post(url, json=payload)
print(response.json())Last 50 checks (10 min intervals)