Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ The following wonderful people contributed directly or indirectly to this projec
- `Noam Meltzer <https://github.com/tsnoam>`_
- `Oleg Shlyazhko <https://github.com/ollmer>`_
- `Oleg Sushchenko <https://github.com/feuillemorte>`_
- `Or Bin <https://github.com/OrBin>`_
- `overquota <https://github.com/overquota>`_
- `Patrick Hofmann <https://github.com/PH89>`_
- `Paul Larsen <https://github.com/PaulSonOfLars>`_
Expand Down
9 changes: 9 additions & 0 deletions telegram/ext/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,15 @@ def filter(self, message):
voice = _Voice()
""":obj:`Filter`: Messages that contain :class:`telegram.Voice`."""

class _VideoNote(BaseFilter):
name = 'Filters.video_note'

def filter(self, message):
return bool(message.video_note)

video_note = _VideoNote()
""":obj:`Filter`: Messages that contain :class:`telegram.VideoNote`."""

class _Contact(BaseFilter):
name = 'Filters.contact'

Expand Down
5 changes: 5 additions & 0 deletions tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ def test_filters_voice(self, message):
message.voice = 'test'
assert Filters.voice(message)

def test_filters_video_note(self, message):
assert not Filters.video_note(message)
message.video_note = 'test'
assert Filters.video_note(message)

def test_filters_contact(self, message):
assert not Filters.contact(message)
message.contact = 'test'
Expand Down