Skip to content

Commit 80b0327

Browse files
committed
followed flake8 linting
- Added covid19_telegram_bot - followed flake8 linting - Fix #767
1 parent 38f3149 commit 80b0327

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

covid19_telegram_bot/covid19_telegram_bot.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"""
55
import requests
66
from covid import Covid
7-
from os import *
87

98
previous_data = []
109
# #######################Telegram###########################
@@ -14,14 +13,9 @@ def send_msg(text):
1413
token = "YOUR-TOKEN-HERE"
1514
chat_id = "GROUP-CHAT-ID-HERE"
1615
url_req = (
17-
"https://api.telegram.org/bot" +
18-
token +
19-
"/sendMessage" +
20-
"?chat_id=" +
21-
chat_id +
22-
"&text=" +
23-
text
24-
)
16+
'https://api.telegram.org/'
17+
'bot' + token + '/sendMessage' +
18+
'?chat_id=' + chat_id + "&text=" + text)
2519
results = requests.get(url_req)
2620
print(results.json())
2721

@@ -34,9 +28,10 @@ def send_msg(text):
3428
"{} : \t{}".format(k, v)
3529
for k, v in India_cases.items()
3630
if not k.startswith(("population", "total"))
37-
) +
38-
"\n#IndiaFightsCorona"
31+
)
32+
+ "\n#IndiaFightsCorona"
3933
)
34+
4035
previous_data.append(stat)
4136
while 1:
4237
covid = Covid(source="worldometers")
@@ -46,8 +41,8 @@ def send_msg(text):
4641
"{} : \t{}".format(k, v)
4742
for k, v in India_cases.items()
4843
if not k.startswith(("population", "total"))
49-
) +
50-
"\n#IndiaFightsCorona"
44+
)
45+
+ "\n#IndiaFightsCorona"
5146
)
5247
if stat in previous_data:
5348
print("Duplicate")

0 commit comments

Comments
 (0)