mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Extended logic filter arguments
This commit is contained in:
parent
f704922fe2
commit
d07e8fc407
1 changed files with 4 additions and 4 deletions
|
|
@ -59,16 +59,16 @@ class _OrFilter(_LogicFilter):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def and_f(target1: "CallbackType", target2: "CallbackType") -> _AndFilter:
|
def and_f(*targets: "CallbackType") -> _AndFilter:
|
||||||
from aiogram.dispatcher.event.handler import FilterObject
|
from aiogram.dispatcher.event.handler import FilterObject
|
||||||
|
|
||||||
return _AndFilter(FilterObject(target1), FilterObject(target2))
|
return _AndFilter(*(FilterObject(target) for target in targets))
|
||||||
|
|
||||||
|
|
||||||
def or_f(target1: "CallbackType", target2: "CallbackType") -> _OrFilter:
|
def or_f(*targets: "CallbackType") -> _OrFilter:
|
||||||
from aiogram.dispatcher.event.handler import FilterObject
|
from aiogram.dispatcher.event.handler import FilterObject
|
||||||
|
|
||||||
return _OrFilter(FilterObject(target1), FilterObject(target2))
|
return _OrFilter(*(FilterObject(target) for target in targets))
|
||||||
|
|
||||||
|
|
||||||
def invert_f(target: "CallbackType") -> _InvertFilter:
|
def invert_f(target: "CallbackType") -> _InvertFilter:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue