Send to all users

This commit is contained in:
Kekskurse 2019-06-21 15:23:02 +02:00
parent 13eb5c0e26
commit 1b1e258172
1 changed files with 5 additions and 3 deletions

8
run.py
View File

@ -75,11 +75,13 @@ def sendAudio(a, b):
f = open("./pv/sendDays/"+day, "w")
f.write("DONE")
f.close()
users = getAllUsers()
if os.path.exists('mp3/'+day+'.mp3'):
a.send_message(chat_id='184170946', text='Der frühe Vogel fängt den Wurm, und hier ist deine motivation für heute:')
a.send_audio(chat_id='184170946', audio=open('mp3/'+day+'.mp3', 'rb'))
for user in users:
a.send_message(chat_id=user["chatId"], text='Der frühe Vogel fängt den Wurm, und hier ist deine motivation für heute:')
a.send_audio(chat_id=user["chatId"], audio=open('mp3/'+day+'.mp3', 'rb'))
else:
a.send_message(chat_id='184170946', text='Für heute habe ich keine Motivierende nachricht gefunden, das wird bestimmt ein scheiß tag :(')
a.send_message(chat_id=user["chatId"], text='Für heute habe ich keine Motivierende nachricht gefunden, das wird bestimmt ein scheiß tag :(')
if not os.path.isdir("pv/sendDays"):