init
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
from aiogram.filters import BaseFilter
|
||||
from aiogram.types import Message
|
||||
|
||||
|
||||
class AllowedUserFilter(BaseFilter):
|
||||
def __init__(self, allowed_user_ids: set[int]) -> None:
|
||||
self.allowed_user_ids = allowed_user_ids
|
||||
|
||||
async def __call__(self, message: Message) -> bool:
|
||||
return message.from_user is not None and message.from_user.id in self.allowed_user_ids
|
||||
Reference in New Issue
Block a user