pyrobale.filters

Attributes

Classes

Functions

equals(expected_text)

Check if the event text or caption or callbackQuery data is equal to the expected text.

startswith(expected_text)

Check if the event text or caption or callbackQuery data is started with to the expected text.

regex(pattern)

checks the event text or caption with given pattern using regex

from_users(allowed_users)

Check if the event text or caption or callbackQuery sender is in allowed user.

is_joined(chat_ids)

Checks if the event User is joined in specified chats.

at_state([state])

Checks if the event User is at specified state.

func(function)

Package Contents

class pyrobale.filters.Filter(check_func, inv=False)[source]
Parameters:
  • check_func (Callable)

  • inv (bool)

state[source]
lst[source]
__invert__()[source]
__and__(other)[source]
__call__(event, client=None, *args)[source]
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

pyrobale.filters.at_state(state=None)[source]

Checks if the event User is at specified state.

Parameters:

state (Optional[str]) – state condition

Returns:

A function that checks if the event User is at specified state.

Return type:

Callable

pyrobale.filters.func(function)[source]
Parameters:

function (Callable)

pyrobale.filters.channel[source]
pyrobale.filters.group[source]
pyrobale.filters.digit[source]
pyrobale.filters.reply[source]
pyrobale.filters.forward[source]
pyrobale.filters.gif[source]
pyrobale.filters.text[source]
pyrobale.filters.photo[source]
pyrobale.filters.video[source]
pyrobale.filters.audio[source]
pyrobale.filters.voice[source]
pyrobale.filters.contact[source]
pyrobale.filters.location[source]