mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 15:34:52 +00:00
Add reply_keyboard and inline_keyboard filters
This commit is contained in:
parent
8074ef1368
commit
6404862b87
1 changed files with 6 additions and 1 deletions
|
|
@ -19,6 +19,7 @@
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from .filter import Filter
|
from .filter import Filter
|
||||||
|
from ..types.reply_markup import InlineKeyboardMarkup, ReplyKeyboardMarkup
|
||||||
|
|
||||||
|
|
||||||
def build(name: str, func: callable, **kwargs) -> type:
|
def build(name: str, func: callable, **kwargs) -> type:
|
||||||
|
|
@ -131,7 +132,11 @@ class Filters:
|
||||||
pinned_message = build("PinnedMessage", lambda _, m: bool(m.pinned_message))
|
pinned_message = build("PinnedMessage", lambda _, m: bool(m.pinned_message))
|
||||||
"""Filter service messages for pinned messages."""
|
"""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
|
@staticmethod
|
||||||
def command(command: str or list,
|
def command(command: str or list,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue