From 6678af08aa57e5eab9f60b837b2f943ef314f2a3 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 17 Mar 2021 13:18:16 +0100 Subject: [PATCH] Add filters.dice to filter Dice messages --- pyrogram/filters.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pyrogram/filters.py b/pyrogram/filters.py index a77e0581..a91508b2 100644 --- a/pyrogram/filters.py +++ b/pyrogram/filters.py @@ -405,7 +405,7 @@ venue = create(venue_filter) # region web_page_filter async def web_page_filter(_, __, m: Message): - return m.web_page + return bool(m.web_page) web_page = create(web_page_filter) @@ -416,13 +416,24 @@ web_page = create(web_page_filter) # region poll_filter async def poll_filter(_, __, m: Message): - return m.poll + return bool(m.poll) poll = create(poll_filter) """Filter messages that contain :obj:`~pyrogram.types.Poll` objects.""" +# endregion + +# region dice_filter +async def dice_filter(_, __, m: Message): + return bool(m.dice) + + +dice = create(dice_filter) +"""Filter messages that contain :obj:`~pyrogram.types.Dice` objects.""" + + # endregion # region private_filter