pyrobale.filters¶
Attributes¶
Classes¶
Functions¶
|
Check if the event text or caption or callbackQuery data is equal to the expected text. |
|
Check if the event text or caption or callbackQuery data is started with to the expected text. |
|
checks the event text or caption with given pattern using regex |
|
Check if the event text or caption or callbackQuery sender is in allowed user. |
|
Checks if the event User is joined in specified chats. |
|
Checks if the event User is at specified state. |
|
Package Contents¶
- class pyrobale.filters.Filter(check_func, inv=False)[source]¶
- Parameters:
check_func (Callable)
inv (bool)
- pyrobale.filters.equals(expected_text)[source]¶
Check if the event text or caption or callbackQuery data is equal to the expected text.
- Parameters:
expected_text (str) – The expected text to compare with.
- Returns:
A function that checks if the event text or caption or callbackQuery data is equal to the expected text.
- Return type:
Callable
- pyrobale.filters.startswith(expected_text)[source]¶
Check if the event text or caption or callbackQuery data is started with to the expected text.
- Parameters:
expected_text (str) – The expected text to compare with.
- Returns:
A function that checks if the event text or caption or callbackQuery data is started with to the expected text.
- Return type:
Callable
- pyrobale.filters.regex(pattern)[source]¶
checks the event text or caption with given pattern using regex
- Parameters:
pattern (str) – The pattern to check with text
- Returns:
A function that checks if the event text or caption is match with given pattern
- Return type:
Callable
- pyrobale.filters.from_users(allowed_users)[source]¶
Check if the event text or caption or callbackQuery sender is in allowed user.
- Parameters:
allowed_users (List[Union["User", int]]) – Allowed users to use this handler.
- Returns:
A function that checks if the event text or caption or callbackQuery sender is in allowed user.
- Return type:
Callable
- pyrobale.filters.is_joined(chat_ids)[source]¶
Checks if the event User is joined in specified chats.
- Parameters:
allowed_users (List[Union["User", int]]) – Allowed users to use this handler.
chat_ids (Union[List[Union[pyrobale.objects.user.User, int, str]], int, str])
- Returns:
A function that checks if the event User is joined in specified chats
- Return type:
Callable