Skip to content

Instantly share code, notes, and snippets.

View nodir-malikov's full-sized avatar
:electron:
Coding...

Nodir Malikov nodir-malikov

:electron:
Coding...
View GitHub Profile
@nodir-malikov
nodir-malikov / file-upload-progress-bar.markdown
Created December 23, 2021 15:34
File Upload Progress bar
@nodir-malikov
nodir-malikov / language_middleware.py
Created January 21, 2022 15:44
Aiogram Language Middleware
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)
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