File size: 525 Bytes
8951a9e
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import requests

class CaesarAITelegramBOT:
    def __init__(self) -> None:
        self.TOKEN = "6186492282:AAEOrXHlfhKZDnOo8ekQqu2glfmF9v4UEWE"
    def get_chatids(self):
        url = f"https://api.telegram.org/bot{self.TOKEN}/getUpdates"
        response = requests.get(url).json()
        return response
    def send_message(self,chat_id,message):
        url = f"https://api.telegram.org/bot{self.TOKEN}/sendMessage?chat_id={chat_id}&text={message}"
        response = requests.get(url).json()
        return response