mirror of
https://github.com/civsocit/olgram.git
synced 2023-07-22 01:29:12 +03:00
31 lines
548 B
Python
31 lines
548 B
Python
import asyncio
|
|
from tortoise import Tortoise
|
|
|
|
from olgram.router import dp
|
|
from olgram.settings import TORTOISE_ORM
|
|
|
|
import olgram.commands.bots
|
|
import olgram.commands.start
|
|
import olgram.commands.menu
|
|
import olgram.commands.bot_actions
|
|
|
|
|
|
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()
|