Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- message="123456"
- proxies = {
- 'http': 'http://157.230.44.89:3128'
- }
- def send_telegram(text: str):
- token = "чччччччччччч"
- url = "https://api.telegram.org/bot"
- channel_id = "@ччччччч"
- url += token
- method = url + "/sendMessage"
- proxies = {
- 'http': 'http://157.230.44.89:3128'
- }
- r = requests.post(method, data={
- "chat_id": channel_id,
- "text": text
- }, proxies=proxies)
- if r.status_code != 200:
- raise Exception("post_text error")
- if __name__ == '__main__':
- send_telegram(message)
Add Comment
Please, Sign In to add comment