Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d24f3a9

Browse files
style: format code with autopep8
Format code with autopep8 This commit fixes the style issues introduced in 2effc6e according to the output from Autopep8. Details: None
1 parent 22c3088 commit d24f3a9

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

‎Ping_Server_Script/Ping_Server_Script.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from telethon.tl.functions.messages import ImportChatInviteRequest
66

77
# Define your API credentials
8-
api_id =#####
8+
api_id =
99
api_hash = '######################'
1010

1111
# Twilio API credentials
@@ -17,15 +17,21 @@
1717
telegram_client = TelegramClient('session_name', api_id, api_hash)
1818
telegram_client.start()
1919

20+
2021
def send_telegram_message(chat_id, message):
2122
chat = InputPeerChat(chat_id)
2223
telegram_client.send_message(chat, message)
2324

25+
2426
def 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

2731
def 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

3036
def 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+
4451
if __name__ == '__main__':
4552
# Define the site list and chat ID here
4653
site_list = ['http://example.com', 'http://example2.com']

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /