This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import os | |
from loguru import logger | |
from aiogram import Bot, Dispatcher | |
from aiogram.contrib.fsm_storage.memory import MemoryStorage | |
from aiogram.contrib.fsm_storage.redis import RedisStorage2 | |
from aiogram.types import BotCommand | |
from aiogram.types.bot_command_scope import BotCommandScopeDefault |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aiogram.contrib.middlewares.i18n import I18nMiddleware | |
from aiogram import types, Bot | |
from tgbot.models.users import User | |
async def get_lang(bot: Bot, user_id: int): | |
# Get language from database | |
db = bot.get('db') | |
user = await User.get_user(db, user_id) |