mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 20:59:29 +00:00
Add reply_keyboard and inline_keyboard filters
This commit is contained in:
parent
8074ef1368
commit
6404862b87
@ -19,6 +19,7 @@
|
||||
import re
|
||||
|
||||
from .filter import Filter
|
||||
from ..types.reply_markup import InlineKeyboardMarkup, ReplyKeyboardMarkup
|
||||
|
||||
|
||||
def build(name: str, func: callable, **kwargs) -> type:
|
||||
@ -131,7 +132,11 @@ class Filters:
|
||||
pinned_message = build("PinnedMessage", lambda _, m: bool(m.pinned_message))
|
||||
"""Filter service messages for pinned messages."""
|
||||
|
||||
# TODO: Add filters for reply markups
|
||||
reply_keyboard = build("ReplyKeyboard", lambda _, m: isinstance(m.reply_markup, ReplyKeyboardMarkup))
|
||||
"""Filter messages containing reply keyboard markups"""
|
||||
|
||||
inline_keyboard = build("InlineKeyboard", lambda _, m: isinstance(m.reply_markup, InlineKeyboardMarkup))
|
||||
"""Filter messages containing inline keyboard markups"""
|
||||
|
||||
@staticmethod
|
||||
def command(command: str or list,
|
||||
|
Loading…
Reference in New Issue
Block a user