diff --git a/run.py b/run.py index aaa3a80..03d5843 100644 --- a/run.py +++ b/run.py @@ -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"):