pyrobale.filters

Attributes

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.

Package Contents

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.TEXT = 'text'[source]
pyrobale.filters.PHOTO = 'photo'[source]
pyrobale.filters.VIDEO = 'video'[source]
pyrobale.filters.AUDIO = 'audio'[source]
pyrobale.filters.VOICE = 'voice'[source]
pyrobale.filters.CONTACT = 'contact'[source]
pyrobale.filters.LOCATION = 'location'[source]
pyrobale.filters.channel[source]
pyrobale.filters.group[source]
pyrobale.filters.digit[source]