2021-06-11 21:56:03 +03:00
|
|
|
import asyncio
|
|
|
|
from aiogram import Bot, Dispatcher, executor
|
|
|
|
from aiogram.contrib.fsm_storage.memory import MemoryStorage
|
|
|
|
|
|
|
|
from settings import BotSettings
|
|
|
|
|
|
|
|
from olgram.bot.bots import router as bots_router
|
|
|
|
from olgram.bot.start import router as start_router
|
2021-06-29 15:29:41 +03:00
|
|
|
from olgram.bot.bot import router as bot_router
|
2021-06-11 21:56:03 +03:00
|
|
|
from olgram.utils.database import init_database
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
"""
|
|
|
|
Classic polling
|
|
|
|
"""
|
|
|
|
asyncio.get_event_loop().run_until_complete(init_database())
|
|
|
|
|
|
|
|
bot = Bot(BotSettings.token())
|
|
|
|
dp = Dispatcher(bot, storage=MemoryStorage())
|
|
|
|
|
|
|
|
start_router.setup(dp)
|
|
|
|
bots_router.setup(dp)
|
2021-06-29 15:29:41 +03:00
|
|
|
bot_router.setup(dp)
|
2021-06-11 21:56:03 +03:00
|
|
|
|
|
|
|
executor.start_polling(dp, skip_updates=True)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|