55from telethon .tl .functions .messages import ImportChatInviteRequest
66
77# Define your API credentials
8- api_id = #####
8+ api_id =
99api_hash = '######################'
1010
1111# Twilio API credentials
1717telegram_client = TelegramClient ('session_name' , api_id , api_hash )
1818telegram_client .start ()
1919
20+
2021def send_telegram_message (chat_id , message ):
2122 chat = InputPeerChat (chat_id )
2223 telegram_client .send_message (chat , message )
2324
25+
2426def send_twilio_sms (to_phone_number , message ):
25- twilio_client .messages .create (to = to_phone_number , from_ = '##########' , body = message )
27+ twilio_client .messages .create (
28+ to = to_phone_number , from_ = '##########' , body = message )
29+
2630
2731def make_twilio_call (to_phone_number ):
28- twilio_client .calls .create (url = 'http://demo.twilio.com/docs/voice.xml' , to = to_phone_number , from_ = '#############' )
32+ twilio_client .calls .create (
33+ url = 'http://demo.twilio.com/docs/voice.xml' , to = to_phone_number , from_ = '#############' )
34+
2935
3036def check_sites (site_list , chat_id ):
3137 for site in site_list :
@@ -41,6 +47,7 @@ def check_sites(site_list, chat_id):
4147 message = "Oops " + site + " not available at the moment"
4248 send_telegram_message (chat_id , message )
4349
50+
4451if __name__ == '__main__' :
4552 # Define the site list and chat ID here
4653 site_list = ['http://example.com' , 'http://example2.com' ]
0 commit comments