from aiogram import types from aiogram.dispatcher.filters import BoundFilter from load import config ''' class OnlyMy(BoundFilter): key = 'only_my' def __init__(self, only_my): self.onlymy = only_my async def check(self, message: types.Message): logging.info("User: {user_id} - {username}".format( user_id=str(message.from_user.id), username=str(message.from_user.username) )) if message.from_user.id in config.allowed_users: return True return False ''' class BotAdmin(BoundFilter): key = 'admin' def __init__(self, admin): self.admin = admin async def check(self, message: types.Message): if message.from_user.id in config.admin_user: return True else: await message.answer("Хорошая попытка, но ты не администратор!") return False