Commit graph

776 commits

Author SHA1 Message Date
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
Jacob Bom
da01601ff9 Add equality rich comparision operators to telegram objects (#604)
fixes #587
2017-05-15 00:29:31 +03:00
Evgen
752b64769d Fix for #601 (#603) 2017-05-12 17:42:02 +02:00
Evgen
f3b75d95c4 Implemented undocumented 'deleteMessage' method (#602)
* Implemented `Bot.delete_message()` and `Message.delete()` methods

* Added tests for `Bot.delete_message()` and `Messsage.delete()`

* Added myself to `AUTHORS.rst`

* Using `assertRaisesRegexp` instead of `assertRaisesRegex` in tests

Now tests can run on Python 2.7 without raising 'AttributeError'

* Fix docstring

Added a warning to the docstring describing that this method is undocumented and not guaranteed to work
2017-05-12 17:40:57 +02:00
Eldinnie
f3aca42e69 pass errormessage to Unauthorized (#597) 2017-05-12 17:38:36 +02:00
Rahiel Kasim
9f3afa5fa2 prefer snake_case for telegram.Bot methods 2017-05-07 16:09:58 +02:00
Joscha Götzer
cdf36a20b7 Fixed deprecation warning (#586) 2017-04-29 19:56:27 +02:00
manorom
c5598b96bc Fix Bug #571 (second try) (#574)
* Fix Bug #571
ConversationHandler will not process CallbackQuery if per_chat=True and
the CallbackQuery has no message attached to it (as is the case with
buttons on inline results)

* Adds test case for CallbackQuery without Chat
2017-04-29 15:51:48 +02:00
Noam Meltzer
ca4351079f Merge pull request #542 from python-telegram-bot/urllib3-vendor-beta
Vendor (embed) urllib3 with our package.
2017-04-29 16:38:44 +03:00
Jannes Höke
c7dbdce3dc Allow CallbackQueryHandler in ConversationHandler with per_mess… (#561)
* 🐛 Allow CallbackQueryHandler in ConversationHandler with per_message=False

but show a warning #556

*  warning logs instead of ValueErrors

 #556
2017-04-29 15:15:17 +03:00
Noam Meltzer
fe5ae8ed84 request.py: Fix warning on stderr irrelevant for most users
Attempting to import urllib3.contrib.socks may fail if PySocks is not
installed. Most users won't care for that.
Only import that module if the user requested to use a socks proxy.
2017-04-29 14:42:36 +03:00
Noam Meltzer
a6b28b022a Merge remote-tracking branch 'origin/master' into urllib3-vendor-beta 2017-04-29 14:09:45 +03:00
John Yong
1d905d567c GAE support via urllib3.contrib.appengine module #334 2017-04-27 16:59:35 +08:00
Jannes Höke
4541476143 enforce urllib3==1.20 (#580)
* 🚑 enforce urllib3==1.20

 #579

* 🚑 Bump version to v5.3.1

 #579
2017-04-25 17:26:54 +02:00
Dickson Tan
11a3de67ea Remove deprecated code #408 part 1 (#564)
* Remove non-pep8 dispatcher methods

* callbackqueryhandler: Remove non-pep8 compliant methods

* commandhandler: Remove non-pep8 compliant methods

* handler: Remove non-pep8 compliant methods

* messagehandler: Remove non-pep8 compliant methods

* stringcommandhandler: Remove non-pep8 compliant methods

* stringregexhandler: Remove non-pep8 compliant methods

* test_updater: fix usage of deprecated methods

* dispatcher: fix accidental misalignment of comments by pre-commit hook

* Add myself to list of contributors
2017-04-25 10:39:02 +02:00
Eldinnie
90bf26c09b Issue 566 (#577)
* stripping token of whitespaces before starting bot

* Line feed

* - Case insensitivity for commandhandler
- Ignore pylint case on windows.
2017-04-25 10:37:06 +02: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
Iulian Onofrei
44d7bad11c Update constants.py (#553)
Add maximum inline query results constant
2017-03-29 17:31:26 +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
Jannes Höke
8fe6e13ff2 Update handlers (#532)
* 🔨 Refactor `Update.extract_` methods to `Update.effective_` properties
 #507

*  Update RegexHandler to work with edited messages and channel posts

* 🔨 messagehandler.py: refactor channel_posts_updates -> channel_post_updates

* 🔨 handler.py: use effective_ properties
2017-03-26 14:36:45 +02:00
Jannes Höke
ff39e2436e Refactor Update.extract_ methods to Update.effective_ properties (#531)
* 🔨 Refactor `Update.extract_` methods to `Update.effective_` properties
 #507

* 🔨 handler.py: use effective_ properties
2017-03-26 14:36:34 +02:00
Alex Hirschfeld
5b14b134dc Added user defined function for updater's signalHandler (#512)
* Added user defined function for updater's signalHandler

* Added test_userSignal to test_updater

* Added test_userSignal to test_updater
Fixing paren
2017-03-26 14:36:13 +02:00
Jannes Höke
5897affa07 add missing allowed_updates to start_webhook (#549)
* 🐛 add missing allowed_updates to start_webhook
 #548

* 🔨 fix webhook-related tests
 #548
2017-03-25 12:46:37 +01:00
Jannes Höke
9982f3c908 🐛 fix message date parsing for messages without a timestamp (#550)
#546
2017-03-25 12:15:37 +01:00
thodnev
22142e7cbd Introduce MessageQueue (#537)
* Introduce MessageQueue

* minor documentation and terminology fixes according to the review

* minor documentation and terminology fixes according to the review

* minor documentation and terminology fixes according to the review

* pep8 fix
2017-03-15 17:35:33 +01:00
Noam Meltzer
4c8d1c9a5e Fix Bot.sendDocument 2017-03-11 23:55:26 +02:00
Noam Meltzer
2b930c221d Sane default for sending files timeout 2017-03-11 16:23:43 +02:00
Jannes Höke
2a1d40bd28 🚧 manipulate sys.path to prefer vendor urllib3
#533
2017-03-09 23:29:15 +01:00
Jannes Höke
1d4464ddbd add git submodule to vendor urllib3
#533
2017-03-09 23:16:58 +01:00
Jose Luis Salazar Gonzalez
e78d11a99b Add filters to commandHandler (#536)
* Add filters to commandHandler

* Add commandHandler tests with filters

* Add myself to authors
2017-02-28 15:44:55 +01:00
Jannes Höke
cc73469dab Issue 502 (#530)
* conversationhandler.py: add per_chat, per_user and per_message

* test_conversationhandler.py: test case per_user=False

* test_conversationhandler.py: add test for callbackqueryhandlers

* ✏️ Fix accidental typo in logging format
2017-02-27 17:52:58 +01:00
Jannes Höke
853d823964 🚨 promise.py: remove pylint warning
#529
2017-02-27 16:23:04 +01:00
Jannes Höke
6b7144bbab 🚨 fix yapf 2017-02-27 14:53:28 +01:00
Jannes Höke
f8b13440c1 🔀 Merge thodnev/ptb into ptb/promises-with-exceptions
#529
2017-02-27 14:45:12 +01:00
Jannes Höke
a1ade408b0 🔀 Merge master into dec04
#483
2017-02-27 14:39:18 +01:00
Jannes Höke
2954ca2bad 🔀 Merge master into fix-460
#494
2017-02-27 14:33:58 +01:00
Eldinnie
34ebb7fe5a Issue 520 (#521)
* stripping token of whitespaces before starting bot

* Line feed

* fixed chat parameter all_members_are_administrators
2017-02-27 14:27:06 +01:00
Eldinnie
78094b796d Fix commandhandler (#515)
* stripping token of whitespaces before starting bot

* Line feed

* CommandHandler checks if message is for this bot

* CommandHandler checks if message is for this bot
- Added tests

* Fixed tests in test_conversationHandler to work with new commandhandler structure

* type in conversationhandler test
2017-02-27 14:26:53 +01:00
thodnev
fb378775a4 Changed promises to handle exceptions 2017-02-26 23:27:03 +02:00
Noam Meltzer
d714da4b36 Merge pull request #500 from python-telegram-bot/bug470
Fix bad formatting of BadRequest exception message

Fixes #470
2017-02-25 22:40:49 +02:00
代码家
e39afad321 Add support for Socks5 proxy. (#518) 2017-02-25 20:47:56 +02:00
Joscha Götzer
ac59f2f37c Added methods to generate the original markdown/html string from entities contained in Message (#507)
* Added methods to generate the original markdown/html formatted string from the entities contained in an update

* Added

* Moved the html/markdown parsing methods to `Message`

* Moved extract_* methods from helpers to the appropriate location

* Refactored text_markdown and text_html

* Refactored text_markdown and text_html for efficiency

* Fixed method call in conversationhandler

* Fixed method call in handler

* Fixed `make test` command on windows systems

* Improved method documentation
2017-01-20 20:13:58 +01:00
Jannes Höke
cd38bdbed5 bot.py: add delete_webhook alias 2017-01-16 00:28:26 +01:00
Jannes Höke
975d193441 Merge branch 'master' into dec04 2017-01-16 00:15:09 +01:00
Jannes Höke
728ffa432d updater.py: add allowed_updates parameter to start_polling 2017-01-16 00:07:46 +01:00
Jannes Höke
c2c93f5d51 webhookinfo.py: add new parameters 2017-01-16 00:00:54 +01:00
Jannes Höke
fc9f36d4db use deleteWebhook in Updater._bootstrap 2017-01-16 00:00:27 +01:00
Jacob Bom
e69e99ce23 Make everything default to None
This effectively removes most type checking from all optional variables... I'm not really sure that's what we want...
2017-01-11 19:41:39 +01:00
Jacob Bom
27b2fd64b7 More IDE friendliness 2017-01-09 19:29:05 +01:00
Jacob Bom
4dee785fba Last of the classes I think 2017-01-09 19:16:28 +01:00