all repos — gif-escarbot @ 4d9526acb2e33475f6e73d0da8a662488008209f

Earthbound Café's custom delivery bot with other cool utilities built-in.

send.py (view raw)

 1from dotenv import load_dotenv
 2from os import getenv
 3load_dotenv()
 4
 5## Config start
 6endpoint = "sendMessage"
 7payload = {
 8    "chat_id": getenv("group_id"),
 9    "text": "Hello world!",
10    
11    "parse_mode": "markdown",
12    "reply_to_message_id": None,
13    "disable_web_page_preview": False,
14    "disable_notification": False,
15}
16## Config end
17
18from requests import post
19response = post(f"https://api.telegram.org/bot{getenv('token')}/{endpoint}", json=payload,
20                headers={ "accept": "application/json", "content-type": "application/json" })
21print(response.text)