Answer the question
In order to leave comments, you need to log in
I create my own filter for Tbot in aiogram, the error MyFilter() takes no arguments comes out. wat tu doo?
from aiogram.dispatcher.filters import BoundFilter
from aiogram import types
class MyFilter(BoundFilter):
key = 'is_admin'
def __init__(self, is_admin):
self.isin = is_admin
async def check(self, message: types.Message):
member = await bot.get_chat_member(message.chat.id, message.from_user.id)
return member.is_chat_admin()
Answer the question
In order to leave comments, you need to log in
Well, you have init and check not class methods, but separate functions, you forgot the indent
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question