olgram/main.py

31 lines
548 B
Python
Raw Normal View History

2021-07-11 12:53:33 +03:00
import asyncio
from tortoise import Tortoise
2021-09-06 00:36:03 +03:00
from olgram.router import dp
from olgram.settings import TORTOISE_ORM
2021-07-11 12:53:33 +03:00
2021-09-06 00:36:03 +03:00
import olgram.commands.bots
import olgram.commands.start
2021-09-06 02:03:04 +03:00
import olgram.commands.menu
import olgram.commands.bot_actions
2021-07-11 12:53:33 +03:00
async def init_database():
await Tortoise.init(config=TORTOISE_ORM)
def main():
"""
Classic polling
"""
loop = asyncio.get_event_loop()
loop.run_until_complete(init_database())
loop.create_task(dp.start_polling())
loop.run_forever()
if __name__ == '__main__':
main()