Answer the question
In order to leave comments, you need to log in
How to port code from console python to aiogram?
Hello! I ran into a problem, I can not transfer the code from python to aiogram. This script sends a message at a specific time of the day. Please help
Python code:
import schedule
import requests
def greeting():
todos_dict = {
'08:00': 'Drink coffee'
}
print("Day's tasks")
for k, v in todos_dict.items():
print(f'{k} - {v}')
def main():
#greeting()
#schedule.every(4).seconds.do(greeting)
#schedule.every(4).minutes.do(greeting)
#schedule.every(4).hour.do(greeting)
schedule.every().day.at('16:27').do(greeting)
while True:
schedule.run_pending()
if __name__ == "__main__":
main()
import schedule
import requests
async def hello_users():
await bot.send_message(message.chat.id == CHANNEL_ID, f'Доброе утро, хакеры!')
async def main():
schedule.every().day.at('16:35').do(hello_users)
while True:
schedule.run_pending()
if __name__ == "__main__":
asyncio.run(main())
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question