mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Add Filters.game and Filters.game_score. Also fix Filters.animation name
This commit is contained in:
parent
d5303285d6
commit
50e5692eae
@ -100,9 +100,12 @@ class Filters:
|
|||||||
sticker = create("Sticker", lambda _, m: bool(m.sticker))
|
sticker = create("Sticker", lambda _, m: bool(m.sticker))
|
||||||
"""Filter messages that contain :obj:`Sticker <pyrogram.Sticker>` objects."""
|
"""Filter messages that contain :obj:`Sticker <pyrogram.Sticker>` objects."""
|
||||||
|
|
||||||
animation = create("GIF", lambda _, m: bool(m.animation))
|
animation = create("Animation", lambda _, m: bool(m.animation))
|
||||||
"""Filter messages that contain :obj:`Animation <pyrogram.Animation>` objects."""
|
"""Filter messages that contain :obj:`Animation <pyrogram.Animation>` objects."""
|
||||||
|
|
||||||
|
game = create("Game", lambda _, m: bool(m.game))
|
||||||
|
"""Filter messages that contain :obj:`Game <pyrogram.Game>` objects."""
|
||||||
|
|
||||||
video = create("Video", lambda _, m: bool(m.video))
|
video = create("Video", lambda _, m: bool(m.video))
|
||||||
"""Filter messages that contain :obj:`Video <pyrogram.Video>` objects."""
|
"""Filter messages that contain :obj:`Video <pyrogram.Video>` objects."""
|
||||||
|
|
||||||
@ -169,6 +172,9 @@ class Filters:
|
|||||||
pinned_message = create("PinnedMessage", lambda _, m: bool(m.pinned_message))
|
pinned_message = create("PinnedMessage", lambda _, m: bool(m.pinned_message))
|
||||||
"""Filter service messages for pinned messages."""
|
"""Filter service messages for pinned messages."""
|
||||||
|
|
||||||
|
game_score = create("GameScore", lambda _, m: bool(m.game_score))
|
||||||
|
"""Filter service messages for game scores."""
|
||||||
|
|
||||||
reply_keyboard = create("ReplyKeyboard", lambda _, m: isinstance(m.reply_markup, ReplyKeyboardMarkup))
|
reply_keyboard = create("ReplyKeyboard", lambda _, m: isinstance(m.reply_markup, ReplyKeyboardMarkup))
|
||||||
"""Filter messages containing reply keyboard markups"""
|
"""Filter messages containing reply keyboard markups"""
|
||||||
|
|
||||||
@ -193,7 +199,8 @@ class Filters:
|
|||||||
- channel_chat_created
|
- channel_chat_created
|
||||||
- migrate_to_chat_id
|
- migrate_to_chat_id
|
||||||
- migrate_from_chat_id
|
- migrate_from_chat_id
|
||||||
- pinned_message"""
|
- pinned_message
|
||||||
|
- game_score"""
|
||||||
|
|
||||||
media = create("Media", lambda _, m: bool(m.media))
|
media = create("Media", lambda _, m: bool(m.media))
|
||||||
"""Filter media messages. A media message contains any of the following fields set
|
"""Filter media messages. A media message contains any of the following fields set
|
||||||
@ -208,7 +215,8 @@ class Filters:
|
|||||||
- video_note
|
- video_note
|
||||||
- contact
|
- contact
|
||||||
- location
|
- location
|
||||||
- venue"""
|
- venue
|
||||||
|
- poll"""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def command(command: str or list,
|
def command(command: str or list,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user