Jannes Höke
1c4c228cf1
add support for User.language_code ( #624 )
...
* add support for User.language_code
* Add language filter
Useful is you wanna do something like restrict your shop to a single or a few locales or something like that.
2017-05-21 14:00:53 +02:00
Jacob Bom
1b7f83625c
Update copyright notice to include 2017
...
Not strictly needed, but it helps show that the project is being actively
developed which I find important.
2017-05-15 00:36:49 +03:00
Eldinnie
b5b09884b1
Group filters ( #575 )
...
* stripping token of whitespaces before starting bot
* Line feed
* show exception that's caused (fixes flake8 failing)
* Add private/group filters
Add filters:
- Filters.private (for messages in private chats)
- Filters.group (for messages in group chats)
* use constants
2017-04-23 23:22:05 +02:00
Jacob Bom
ad5f009ce7
Add the ability to invert (not) filters ( #552 )
...
* Add InvertedFilter and use it from __invert__
* Add docstrings and __str__ for inverting filters
* Tests for inverted filters
2017-03-28 18:38:44 +02:00
Jeong Arm
c5f9e53d44
Add "reply" filter ( #465 )
...
* Add "reply" filter
This filter will filter messages that reply to other's message.
* Add test for "reply" filter
* Add "Kjwon15" to AUTHORS.rst
2016-12-11 22:45:51 +01:00
Jacob Bom
960862ccb1
Merge branch 'master' into october3
...
# Conflicts:
# telegram/bot.py
# telegram/callbackquery.py
# telegram/chat.py
# telegram/ext/messagehandler.py
# telegram/inlinekeyboardbutton.py
# telegram/inlinequeryresultcachedaudio.py
# telegram/message.py
# tests/test_filters.py
2016-10-19 12:35:50 +02:00
Jacob Bom
c626044a30
Add "all" filter
...
Since and empty list cannot (in the future, currently only deprecated) be used.
2016-10-15 22:58:55 +02:00
Jacob Bom
ca5e3146c6
Fix docstring according to Jannes' commentns.
2016-10-14 10:32:12 +02:00
Jacob Bom
79e065a730
Add __str__ and __repr__ to MergedFilter.
2016-09-25 16:31:06 +02:00
Jacob Bom
3244417f61
Add docs for filters.
2016-09-25 00:30:04 +02:00
Jacob Bom
61596400e1
__call__ should return the result
...
Also add tests with both & and |.
2016-09-24 18:56:54 +02:00
Jacob Bom
be0f5bc519
Merge branch 'master' into bitwise-filters
...
# Conflicts:
# telegram/ext/messagehandler.py
# tests/test_filters.py
2016-09-24 18:30:58 +02:00
Jacob Bom
2161681131
Use filter method instead of __call__
...
__call__ is scary looking for users wanted to create their own filters.
Also allows us to put additional logic in __call__ if we want in the future.
2016-09-24 18:20:32 +02:00
Jacob Bom
71e74da0a2
Make filters and/or-able using bitwise operators.
...
See associated PR for more info.
2016-09-14 19:29:15 +02:00
Noam Meltzer
3f28633e79
MessageHandler / filters: refactor
...
filters are now functions instead of enum like objects.
their definitions were moved to messagehandler.py
2016-04-26 17:47:37 +03:00
Jannes Höke
0d0ad1334c
add documentation and minor stuff
2016-04-16 16:36:12 +02:00
Jannes Höke
1e19084a0d
initial commit for dispatcher rework. deleted updatequeue.py as it is not needed. added handler base class, messagehandler, commandhandler, regexhandler. adjusted dispatcher for new system
2016-04-14 23:57:40 +02:00