Pieter Schutz
d9f77d6ee1
Bump to v10.0.1
2018-03-05 12:46:19 +01:00
Eldinnie
698a91427a
Fix conversationhandler timeout ( #1032 )
...
* Fix conversationhandler
As found by @nmlorg and described in #1031
closes #1031
* adding another test and definitely finish conversationhandler
It seems another problem was when the job executed the timeout, it wasn;t removed from `self.conversation_timeouts` which made it still fail because job would be present in the handler dict, although it was already disabled.
This should fix it properly.
2018-03-05 12:18:40 +01:00
Jannes Höke
5956aae235
Add missing docs utils ( #912 )
...
* add documentation for telegram.utils.promise and .request
* improve documentation for telegram.utils.promise and .request
* add missing 's' to new_chat_member(s) in all docstrings
* fix docs for `set_chat_photo`
[CI skip]
2018-03-05 12:17:56 +01:00
Noam Meltzer
0811f566a2
Bump version to v10.0.0
...
[ci skip]
2018-03-03 01:23:08 +02:00
Noam Meltzer
a6bf456645
Updater improvements ( #1018 )
...
- Refactor bootstrap phase to be resilient for network errors
- Retry bootstrap phase indefinitely (by default) on network errors
- Improved logs
- Improved unitests for polling updater
fixes #605
2018-03-02 23:11:16 +02:00
Evgen
811369d1a0
Added conversation timeout in ConversationHandler ( #895 )
2018-03-01 11:34:47 +02:00
Paul Larsen
b67ea7a691
CommandHandler - ignore strings in entities and "/" followed by whitespace ( #1020 )
2018-03-01 10:11:16 +02:00
Noam Meltzer
f6332d45a8
Improved File.download ( #1019 )
...
- File.download_as_bytearray - new method to get a d/led file as bytearray
This is much more convenient and straight forward than using a file
object.
- File.download(): Now returns a meaningful return value
- File.download*(): New and/or better unitests
2018-03-01 10:10:04 +02:00
Eldinnie
b275031a16
Add Message caption html/markdown methods ( #1013 )
...
Closes #1010
2018-02-22 17:38:54 +02:00
Noam Meltzer
3762792cca
Remove deprecated code ( #1012 )
...
* JobQueue: Remove deprecated prevent_autostart & put()
* Bot, Updater: Remove deprecated network_delay
* Remove deprecated Message.new_chat_member
closes #795
2018-02-22 14:17:06 +02:00
Noam Meltzer
baec1bb554
flake8 revamp
...
- Use pre-commit v1.2.0 flake8
- Make sure we're running flake8 on examples and tests
- Fix what had to be fixed
2018-02-19 12:41:38 +02:00
Noam Meltzer
746ae0caf3
Get jobs by name ( #1011 )
2018-02-19 10:36:40 +02:00
Eldinnie
0bed087542
remove unnecessary to_dict() ( #834 )
...
We have some objects that have exactly the same to_dict() method, only specifying that `from_user` should be `from` in the `data`-dict. I refractored this logic to `TelegramObject` and removed those to_dicts() from the code.
2018-02-19 10:31:38 +02:00
Unknown
efea0361c5
Fix attribute order error
2018-02-18 18:12:08 +01:00
Noam Meltzer
91ae35e26c
updater.py: Better handling of timeouts during getUpdates ( #1007 )
...
TimedOut exception is an expected an normal event. To reduce noise and
make things more "fluent" we now:
- Make sure that we don't sleep after the timeout but rather retry
immediately.
- Log debug instead of error level.
Fixes #802
2018-02-18 17:50:38 +02:00
Jacob Bom
ebcc40ae92
More instance methods ( #963 )
...
* Bot.get_file now allows passing a file in addition to file_id
* Add .get_file() to Audio, Document, PhotoSize, Sticker, Video, VideoNote and Voice
* Add .send_*() methods to User and Chat
2018-02-18 17:49:52 +02:00
Jannik
c152d6583e
Support v3.6 API ( #1006 )
...
* Added support for new field `telegram.Message.connected_message`
* Added support for new field `telegram.Message.connected_message`
* Added support for parse_mode in captions
* Added parse_mode parameter for captions in InlineQueryResult*
* Added supports_streaming parameter in telegram.Bot.send_video and telegram.InputMediaVideo
Fixed Docstrings for parse_mode in captions
* pypy3.5 unitests are now running with a new version due internal errors on travis.
closes #1005
2018-02-18 17:11:04 +02:00
Joscha Götzer
9338dc4697
Added utils.helpers.effective_message_type ( #826 )
2018-02-15 11:21:19 +02:00
Daniel Reed
063704c0b9
Explicitly check update.effective_chat in ConversationHandler.check_update ( #959 )
...
Fixes #927
2018-02-12 16:09:51 +02:00
Oleg
62e76f1fba
bot.py: Add shortcut method reply_media_group ( #994 )
...
fixes #936
2018-02-12 15:51:18 +02:00
Joscha Götzer
f0dfdfb203
bot.py: Add shortcut methods reply_{markdown,html} ( #827 )
2018-02-12 15:39:46 +02:00
Eldinnie
d5c9212f2e
Add two arguments to send_invoice ( #986 )
...
Telegram silently added `send_phone_number_to_provider` and `send_email_to_provider` to the send_invoice method.
2018-02-10 17:54:09 +02:00
Noam Meltzer
8690ba256e
webhookhandler: Fix exception thrown during error handling ( #985 )
...
BaseServer.handle_error() default behaviour is to print to stdout or
stderr (depends on the python version). In case that the file descriptor
is closed an additional exception will be raised, causing the webhook
thread to quit.
Fixes #970
2018-01-25 10:42:48 +02:00
Noam Meltzer
ddf3a1fcad
jobqueue: Thread safety fixes ( #977 )
...
- Fix JobQueue.jobs to obtain a lock on the internal queue object prior
to iterating over it.
- Rename JobQueue.queue to JobQueue._queue. This shouldn't be
accessible by the user directly, but rather only with sanitized
thread safe methods.
- JobQueue.interval_seconds - access self.interval only once to avoid
race conditions.
Fixes #968
2018-01-20 15:27:01 +02:00
Mischa Krüger
eb67c039f1
Updater: Issue INFO log upon received signal ( #951 )
...
Fixes #946
2018-01-09 17:54:07 +02:00
Jacob Bom
2ca7ff82ef
Update headers to 2018 ( #962 )
...
Also add two missing headers.
[ci skip]
2018-01-04 17:16:06 +02:00
Noam Meltzer
a2c04313d3
Fix documentation & coding style of User.name & User.full_name ( #956 )
...
- Use string `format` instead of dict comprehension.
- Better documentation to signify the semantics difference between
`name` and `full_name`.
- Use string `format` instead of dict comprehension.
- Better documentation to signify the semantics difference between
`name` and `full_name`.
* Removed the NOTE and mentinoed the "@" prefix.
2017-12-30 22:58:32 +02:00
graynk
d347c0d45e
User.full_name convinience property ( #949 )
...
Fixes #943
2017-12-30 15:13:06 +02:00
Daniel Reed
5c8470e552
Store bot in PreCheckoutQuery ( #953 )
...
Fixes #937
2017-12-30 14:48:38 +02:00
Eldin
3d4e0500bf
Bump to 9.0.0 + changelog
2017-12-08 23:08:42 +01:00
Eldinnie
042d4bb2a4
add support for 3.5 api ( #920 )
...
* add support for 3.5 api
* removed "unused" import by accident
* Hardcoded values
Appearantly TG decided to change the size of a send image (again)
* test_official
* Improve coverage
* Finishing up
* spelling error
* pytest fixed tot < than 3.3 for python 3.3 support
* flake8
* rollback requirements
* as per CR
* object for provider_data
Make it possible to send an object that will be json-serialized for send_invoice + tests
* shorten error message
* using string_types
2017-12-08 22:38:59 +01:00
Erjan Kalybek
a5c8e98ee7
Fix sendPhoto method description ( #919 )
2017-12-06 13:24:34 +01:00
Noam Meltzer
4b3315db6f
Fix race condition in dispatcher start/stop ( #887 )
...
fixes #881
2017-10-21 14:40:24 +03:00
Jannes Höke
3ed05991ad
log error trace if there is no error handler registered ( #694 )
2017-10-21 12:35:11 +03:00
Simon Schürrle
bb5357a815
Fix typo in the docstring ( #878 )
...
Changed `Filters.status_update.new_chat_member` to `Filters.status_update.new_chat_members`
Thanks to @ajbvn for pointing it out.
[ci skip]
2017-10-18 22:00:17 +03:00
Jacob Bom
8df35fd53b
Fix for crashes on 8.1 ( #873 )
...
* Make Commandhandler not crash on single char messages
* Bump release and update CHANGES.rst for 8.1.1
* No error on single / and test
2017-10-15 16:59:10 +02:00
Noam Meltzer
23774383dc
Bump version & update CHANGES.rst for 8.1.0 release
2017-10-15 00:04:35 +03:00
Eldinnie
28680ac1d5
edited_updates also for channel_posts ( #832 )
2017-10-14 23:48:06 +03:00
Jannes Höke
ec9b16ac7b
Fix command not recognized if it is directly followed by a newline ( #869 )
...
fixes #868
2017-10-14 21:04:02 +03:00
Eldinnie
bfad2fa1f3
support 3.4 API ( #865 )
2017-10-14 21:03:02 +03:00
Noam Meltzer
8a8b1215c8
Fix documentation of Request object initialization (for advanced users) ( #866 )
...
fixes #676
2017-10-12 00:39:09 +03:00
Eldinnie
2aa456d637
remove Bot._message_wrapper ( #822 )
...
Moved tho code to the @message decorator instead
fixes #752
2017-10-11 23:38:00 +03:00
Eldinnie
d75e0f6014
Stabilize Coverage ( #846 )
...
* test_error added
* ignore unstables for coverage
2017-09-25 20:58:10 +02:00
Jeff
dbb3b16edc
Add Job Class to docs ( #845 )
...
* fix job class missing from docs
* fix typo
2017-09-25 20:57:53 +02:00
Jeff
5614af1847
Docstring Fix for ext/filters.py ( #830 )
2017-09-15 23:56:16 +02:00
Marco Túlio Zuquim
e362a5b59d
Small documentation fix in user.py ( #829 )
2017-09-15 23:55:35 +02:00
Yii Kuo Chong
e39b6abe61
Small documentation fix ( #815 )
...
Fixes #799
2017-09-07 22:55:06 +03:00
Pieter Schutz
6012fa65c1
Bump to version 8.0
2017-09-01 10:38:15 +02:00
Pieter Schutz
ef9dbacf7e
Fix last issues for new release
2017-09-01 10:38:04 +02:00
Jannes Höke
1f5311b473
catch exceptions in error handlerfor errors that happen during polling (2) ( #810 )
...
* catch exceptions in error handlerfor errors that happen during polling
* add tests for error handlers that raise exceptions
2017-09-01 08:46:21 +02:00
Eldinnie
eae139d3e9
remove de_json() ( #789 )
...
* remove de_json()
* Remove or rename obsolete tests
* fixes according to rc
2017-09-01 08:45:22 +02:00
Eldinnie
160ffed5ad
Remove Botan ( #776 )
2017-09-01 08:45:01 +02:00
Noam Meltzer
e018445513
Documentation update to PEP ( #797 )
2017-09-01 08:43:08 +02:00
Eldinnie
4601eedf0f
Show status_updates in docs ( #798 )
...
* Show status_updates in docs
* Show status_updates in docs
2017-09-01 08:41:15 +02:00
Jeff
b6a0853896
Add Bot API 3.3 ( #806 )
...
* Bot API 3.3
* simpler helper methods (accept only custom names now)
attempt to fix circular import (not sure if its the correct way tho)
added helper methods into User object
* fix User objects in tests to contain is_bot required value
* fix User objects in tests to contain is_bot required value
* delete extra line that caused flake8 error
* fix swapped arguments
2017-09-01 08:40:05 +02:00
Noam Meltzer
16a49ec659
Remove DispatcherHandlerContinue + more unitests for dispatcher ( #792 )
...
The idea was nice, but it really complicated things for us and for the
user.
If a user wants to run more than one handler on an update, he can put
the handlers in different groups or he can have a single handler.
If a user wants to have multiple handlers in the same group which only
one of them should run on the update, he should use check_update().
Since we haven't released this code yet, there's no problem with
backward compatability.
2017-08-12 18:57:12 +03:00
Noam Meltzer
ee34d57521
Warn on small con_pool_size during custom initalization of Updater ( #793 )
...
fixes #787
2017-08-12 16:45:38 +03:00
Jacob Bom
5d7c6ad541
Switch to pytest + required fixes to code ( #788 )
...
Required fixes:
- CallbackQuery is now comparable.
- Message.effective_attachment, Message.photo,
Message.new_chat_members, Message.new_chat_photo &
Game.text_entitties semantic fixes - when they are not defined,
return an empty list.
- Docstring fix to Update class.
2017-08-12 00:58:41 +03:00
Noam Meltzer
915cd64140
Effective attachment ( #766 )
...
fixes #746
2017-08-08 00:25:19 +03:00
Eldinnie
56f7d18853
bot.py semantic fixes ( #774 )
...
offset for get_user_profile_photo can be zero.
edit_message_caption should raise ValueError in compliance with other methods. Also changed to snake_case
edit_message_reply_markup was even weirder
2017-08-08 00:13:32 +03:00
Eldinnie
b04869f36a
docstring correction ( #775 )
...
[ci skip]
2017-08-08 00:11:44 +03:00
Eldinnie
70057a67c5
Regression fix for text_html & text_markdown ( #777 )
...
`text_html` & `text_markdown` reverted to the old semantics - URLs are not converted to hyperlinks.
To get the new behaviour there are matching `text_html_urled` & `text_markdown_urled` properties.
fixes #773
2017-08-08 00:10:48 +03:00
Eldinnie
8d4b484f7b
Fix Game.to_dict() ( #767 )
...
`Game.to_dict()` fails if the `optional` parameter `test_entities` has it's default value `None`
This fixes that.
2017-08-05 00:02:51 +03:00
Jacob Bom
073bed3a01
Fix get_game_high_scores ( #771 )
2017-08-04 20:41:27 +03:00
Noam Meltzer
5ceb6f8f36
Docs fixes ( #765 )
...
* Clean warnings during build_sphinx
* fix documentation types
2017-08-02 05:56:07 +03:00
Jacob Bom
b3069348ca
Add rich comparison to CallbackQuery ( #764 )
...
We currently have no tests for it. Noted for #756 and #757 .
2017-08-01 23:07:12 +03:00
Eldinnie
d19ae5084a
Add RESTRICTED as constant to ChatMember ( #761 )
2017-07-31 23:37:00 +03:00
Ihor Polyakov
6aacde189e
Flow control ability in Dispatcher ( #738 )
...
fixes #666
2017-07-29 20:15:43 +03:00
Noam Meltzer
5d3f5575ab
Sane defaults for tcp socket options on linux ( #754 )
...
Currently only for linux as most of our userbase is there.
fixes #535
2017-07-29 14:30:27 +03:00
Noam Meltzer
13ab6d43d3
CHANGES.rst: Added 7.0.1 release notes.
...
[ci skip]
2017-07-28 21:22:48 +03:00
Eldinnie
2ba7505eaf
Fix TypeError exception in RegexHandler ( #751 )
...
fixes #750
2017-07-28 20:47:42 +03:00
Eldinnie
5ed06df840
callback query docstring ( #749 )
...
showed from instead of from_user and was missing the informational note about it.
[ci skip]
2017-07-28 17:41:25 +03:00
Noam Meltzer
796583323d
Bump version to v7.0.0
2017-07-25 22:53:20 +03:00
Noam Meltzer
46d9240f36
Update vendored urllib3 gitmodule to the proper git revision
...
Refs #720
2017-07-25 22:37:58 +03:00
Ali Mirlou
e5b0795916
Typo fixed for docs ( #747 )
...
[ci skip]
2017-07-25 21:32:20 +03:00
Eldinnie
8d1d38cc4c
send_* now accepts tg-objects ( #742 )
...
Fixes #731
2017-07-25 01:35:22 +03:00
Eldinnie
2d1028acb6
Add kwargs to data dict ( #744 )
...
Add kwargs to data dict for all bot-methods that are not decorated with `@message`
Fixes #733
2017-07-25 01:19:09 +03:00
Noam Meltzer
2aa31c6faa
Remove urllib3 from reported packages for creating new github issues
...
[ci skip]
2017-07-25 00:22:03 +03:00
Eldinnie
b3b94240a5
Docs update ( #728 )
...
Amazing new documentation.
2017-07-23 23:33:08 +03:00
Rahiel Kasim
19ce9e4512
Delete deprecated code ( #693 )
...
* remove Botan import from utils
* remove telegram.Emoji
* remove ReplyKeyboardHide
* remove edit_message argument of bot.set_game_score
2017-07-23 22:58:20 +03:00
Jelle Besseling
8320227b2a
ConvesationHandler - check if a user exist before using it ( #699 )
...
Fixes #695
2017-07-23 22:29:52 +03:00
Ihor Polyakov
08d298eb60
TelegramObject.de_json became classmethod ( #737 )
...
Fixes #734
2017-07-23 22:14:38 +03:00
Jacob Bom
5a37af6f89
Bot api 3.2 ( #732 )
...
NOTE: Currently not testing StickerSet in terms of bot methods (interaction with telegrams servers) as there's no delete operations.
2017-07-22 14:34:51 +03:00
thodnev
f72f4090c6
Fixed args dispatching in messagequeue decorator ( #705 )
2017-07-08 07:18:10 +03:00
Jacob Bom
94ed4cb38d
Bot api 3.1 ( #698 ) + minor improvements
...
- Added all the new and shiny features from API 3.1.
- Not API 3.1 changes:
- Use future.utils.string_types for string isinstance checks.
- Stall between retries of test_set_webhook_get_webhook_info() &
test_delete_webhook().
2017-07-01 18:08:45 +03:00
Jacob Bom
cbafdc289f
Fix Message.text_*
...
Didn't work with URL type MessageEntities
(when you type a url in a tg client and tg converts it to a link for you)
2017-06-24 11:12:35 +03:00
Noam Meltzer
ebb2556176
Fix download of URLs with UTF-8 chars in path
...
refs #650
2017-06-24 11:10:43 +03:00
Noam Meltzer
56949bcad6
Merge pull request #674 from python-telegram-bot/restructure-internal
...
Move a lot of files
2017-06-22 21:26:47 +03:00
Noam Meltzer
470ee86497
Merge pull request #677 from evgfilim1/new-filters
...
New filters for handling messages from specific chat/user id
2017-06-22 21:25:39 +03:00
evgfilim1
7e81a1510d
Added ability to process list of ids/usernames
2017-06-22 15:19:49 +05:00
evgfilim1
ca9068f2b5
Simplified if statement, fixed docs
2017-06-22 13:39:41 +05:00
Noam Meltzer
45d4ea083d
Merge pull request #671 from alateas/master
...
Make error output more clear for too big uploads.
2017-06-22 10:33:25 +03:00
Noam Meltzer
7a89dcb911
Properly try to parse server message before raising errors
2017-06-21 23:34:35 +03:00
Noam Meltzer
4b3b0cb4cd
Merge pull request #668 from python-telegram-bot/official-test
...
Add an "official test"
2017-06-21 23:14:10 +03:00
Noam Meltzer
3ea16cb1c7
Merge pull request #675 from python-telegram-bot/name-filters
...
Allow filters to have a name.
2017-06-21 23:11:26 +03:00
Jacob Bom
04acbc4117
Remove the need for calling super() in filters
2017-06-21 13:46:03 +02:00
Jacob Bom
4b53ed1c65
Fix videonote import
2017-06-20 22:41:02 +02:00
Jacob Bom
1e4248136c
Merge branch 'master' into restructure-internal
2017-06-20 22:28:14 +02:00
Jacob Bom
0afe83ac30
Merge branch 'master' into official-test
2017-06-20 21:42:33 +02:00
Jacob Bom
6cc84b2c32
Only write repr as str will invoke it implicitly
2017-06-20 21:41:23 +02:00
evgfilim1
9bccbdab2a
Added ability to filter by username
2017-06-20 12:43:07 +05:00
Jacob Bom
a964b7bfd0
Okay, so not even *args followed by a kwarg is allowed on py2...
...
So just remove it for now. Better than doing annoying stuff with parsing a **kwargs dict in my opinion. It didn't even *really* need to be kwarg only anyways I guess...
2017-06-19 21:46:34 +02:00
evgfilim1
5a62255675
Added new filters for handling specific chat id and user id
2017-06-19 22:50:44 +05:00
Jacob Bom
2b871e6f93
* for keyword only arguments isn't supported on py2 it seems...
2017-06-18 16:22:59 +02:00
Jacob Bom
788b9dab0c
Fill in super() calls
2017-06-18 16:03:32 +02:00
Jacob Bom
4c41f3870c
Allow filters to have a name.
...
So their string representation is user friendly.
2017-06-18 15:28:48 +02:00
Jannes Höke
d5583190b8
Bump version to v6.1.0
2017-06-18 12:35:16 +02:00
Jacob Bom
5c2893111a
Move a lot of files
2017-06-18 12:35:00 +02:00
Jacob Bom
faddb92395
Clean up Bot code a bit ( #673 )
...
* Clean up Bot code a bit
- Move decorators to module. It really wasn't clear how decorators inside classes work, and why they didn't have a self parameter, but still wasn't static. This also makes them effectively private without having to underscore them, which I think we should have done long time ago atm. Note that this might break backwards compatibility slightly (only if people are daft enough to have used the decorators themselves)
- Don't call _message_wrapper directly. Ever. Instead always use the message decorator, since it's what it's there for. Closes #627
- Don't use the message decorator if the method isn't supposed to return a message. The decorator could handle values like True (which is often the return value), but to someone reading the code, it seems like it's a message returning method even when it wasn't.
- Always document timeout and **kwargs
- Log all methods
* Add test to make sure timeout propagates properly despite decorators
2017-06-18 12:14:24 +02:00
saschalalala
9b5e014a0a
Simplification of boolean checks ( #662 )
...
* Simplification of boolean checks
* Cast ok to bool for Telegram API json encoding
2017-06-18 12:09:32 +02:00
Jannes Höke
845312da59
Merge branch 'master' of github.com:python-telegram-bot/python-telegram-bot
2017-06-16 04:16:45 +02:00
Alateas
6ffd75e421
Try to process response data after checking errors, not before. Add 413 File too large http error message.
2017-06-15 18:44:39 +03:00
Jacob Bom
9b84a558fb
Fix width+height in sendVideo + game in Message
...
First errors found by the official test thingy
2017-06-14 13:48:45 +02:00
saschalalala
3863b4f371
Rename shortcut functions to snake_case ( #661 )
...
* Rename shortcut functions to snake_case
* More function renaming
* Example function rewrite
* Add myself to authors.rst
* More function renaming
* Rename mockbot test functions
* Break comment line for flake max line length
2017-06-14 00:07:03 +02:00
alateas
6877886f7d
Change hard-coded 20. to timeout parameter ( #663 )
...
* Change hard-coded 20. to timeout paramter
Passing timeout parameter to _message_wrapper in send_audio instead of hard-coded 20 seconds
* add myself to contributors
2017-06-14 00:01:38 +02:00
Jeff
a68e0ad044
bugfixes on error in answer_shipping_query and answer_precheckout_query
2017-06-11 03:45:48 +08:00
Jannes Höke
179fc141bb
Merge branch 'master' of github.com:python-telegram-bot/python-telegram-bot
2017-06-10 21:24:28 +02:00
Noam Meltzer
da8a3cee44
Merge pull request #631 from jeffffc/paymenthandlers
...
Add both handlers for queries from new Payment API
2017-06-09 18:23:29 +03:00
Eldin
bc3669fa4b
make commandhandler case insensitive
2017-06-09 17:45:15 +03:00
Jeff
4247dc0e21
tiny changes upon PR review
2017-06-08 09:47:19 +08:00
Jacob Bom
896392d01e
Merge branch 'master' into fix-docs
2017-06-07 13:12:32 +02:00
Jacob Bom
61c5d6ff08
Remove more warnings
2017-06-07 13:07:45 +02:00
Jacob Bom
aa1c4e0e02
Fix most of "more than one target found for cross-reference" warnings
2017-06-07 12:53:02 +02:00
Noam Meltzer
0fb00c4c8b
When Promise running throws an uncaught exception - log it
2017-06-03 16:34:03 +03:00
Noam Meltzer
2680740316
Merge pull request #641 from azogue/fixes
...
fix setting default mimetype of inputfile
2017-06-03 00:22:32 +03:00
Jeff
eaf765dcbc
Remove duplicated/useless codes, added Filters.invoice test
2017-06-03 01:48:30 +08:00
Jeff
e9d08c6f7a
Merge branch 'master' into paymenthandlers-new
...
# Conflicts:
# telegram/bot.py
# telegram/message.py
# telegram/precheckoutquery.py
# telegram/shippingquery.py
2017-06-03 01:09:17 +08:00
Noam Meltzer
137ffe2e73
Merge remote-tracking branch 'origin/master' into payment
2017-06-01 22:01:04 +03:00
Noam Meltzer
c4b78673a3
payment: cr fixes
2017-06-01 21:52:47 +03:00
evgfilim1
5b1252ac2d
Perfomance optimizations
...
Using `or` instead of `|`
2017-06-01 16:36:32 +05:00
evgfilim1
d98b18d1e3
Added new status_update
filters
2017-06-01 07:09:30 +05:00
Jannes Höke
9d6c394b02
Bump version to v6.0.3
2017-05-29 22:55:15 +02:00
Jannes Höke
1951d6fdcd
Bump version to v6.0.2
2017-05-29 21:24:12 +02:00
azogue
b46bdf5304
fix setting default mimetype of inputfile
2017-05-29 08:30:29 +02:00
Noam Meltzer
cd24bb4ba5
payment: Small fixes
...
- Semantic fixes bot.py (if XXX is not None: ...).
- Documentation fixes (arguments which are optional).
2017-05-26 20:02:18 +03:00
Noam Meltzer
ae33d33580
Merge pull request #625 from python-telegram-bot/videonote
...
Add VideoNote
2017-05-26 19:34:13 +03:00
Noam Meltzer
706f79fa99
Fix setup.py with urllib3 vendoring
...
fixes #635
2017-05-26 19:24:54 +03:00
Noam Meltzer
a5bfc52326
videonote: Semantic fix according to CR
2017-05-26 18:36:21 +03:00
Noam Meltzer
858684ab64
Merge pull request #628 from python-telegram-bot/may18minor
...
May 18 minor changes
2017-05-26 18:23:31 +03:00
Jacob Bom
f4c6197c5f
Update filters to new_chat_members instead of new_chat_member
2017-05-25 14:45:47 +02:00
Jacob Bom
a7044562af
Fix stuff as per @tsnoam's comments
2017-05-25 14:16:53 +02:00
Jacob Bom
27a4fa8dba
Move *_duration attributes as to keep backwardscompat
2017-05-25 14:05:08 +02:00
Jacob Bom
a41ee3b040
Actually deprecate new_chat_member to help users switch
2017-05-25 14:02:41 +02:00
Jacob Bom
8499dcc33c
Better deprecation warnings
...
Actually shows where in the users code the error happened, not just where the warning came from in our internal code
2017-05-25 13:53:35 +02:00
Noam Meltzer
ff897ce9ef
Avoid confusion with user's urllib3 by renaming vendored urllib3
2017-05-24 13:14:33 +03:00
Jeff
f314915954
fix typo again
2017-05-23 16:26:04 +08:00
Jeff
1bf0078573
add missing "need_email" in sendInvoice, fix pep8/flake
2017-05-23 16:21:45 +08:00
Jeff
96171112bf
fix crucial typo in filters
2017-05-22 23:42:09 +08:00
Jeff
27238c52e2
add successful_payment filter under message
2017-05-22 23:39:28 +08:00
Jeff
43f4128b31
fix answer* methods not sending api requests
2017-05-22 22:55:19 +08:00
Jeff
1142953108
add checks for answer* methods
2017-05-22 22:47:35 +08:00
Jeff
1e250f2415
add kwargs to answer* methods
2017-05-22 21:37:15 +08:00
Jeff
8f2f29c7d4
fix typo, add bot and kwargs to class init
2017-05-22 21:32:42 +08:00
Jeff
3767d26fc8
Add both handlers for queries from new Payment API ( #630 )
...
* add handlers for new payment API
* fix typo
* fix docstring mistakes
* added missing 'from_user'
2017-05-22 14:07:53 +02:00
Jacob Bom
630b63ec10
Add payment filters
2017-05-22 12:13:00 +02:00
Jacob Bom
01430a24a5
Import order fix
2017-05-21 15:51:01 +02:00
Jacob Bom
acda19b7e7
Merge branch 'may18minor' into beta
2017-05-21 15:45:40 +02:00
Jacob Bom
48fa3d975b
Merge branch 'videonote' into beta
...
# Conflicts:
# telegram/__init__.py
# telegram/message.py
2017-05-21 15:45:20 +02:00
Jacob Bom
d220ff4e38
Merge branch 'payment' into beta
2017-05-21 15:42:24 +02:00
Jacob Bom
5a15d1b5d6
Add mpeg4_duration and gif_duration to inline gif and mpeg4gif
2017-05-21 14:38:12 +02:00
Jacob Bom
ad347b5c02
new_chat_member -> new_chat_members
...
Keep old for now... we can remove it in the future when telegram stops parsing it along.
Also: TODO: write proper Message tests
2017-05-21 14:32:36 +02:00
Jannes Höke
ba6c4fd517
Bump version to v6.0.1
2017-05-21 14:25:40 +02:00
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
2e89e21261
Fix text_markdown and text_html ( #623 )
...
* Fix text_markdown and text_html
* Missed a few narrow build checks
* Added tests for emoji-first strings and emojis in url
2017-05-21 14:00:07 +02:00
Jacob Bom
2dd5290ec2
Add reply_video_note in line with other reply_*
2017-05-21 13:51:27 +02:00
Jacob Bom
41299244b7
Allow InputFile to handle video notes
2017-05-21 13:50:52 +02:00
Jacob Bom
0e2bcf28a6
Export VideoNote
2017-05-21 13:50:15 +02:00
Jacob Bom
2746ab77e5
Add sendVideoNote to Bot
2017-05-20 19:35:55 +02:00
Jacob Bom
ae39c902ed
Add video_note to Message
2017-05-20 19:30:07 +02:00
Jacob Bom
65929a0813
VideoNote chatactions
2017-05-20 19:26:26 +02:00
Jacob Bom
4426eb0c61
Add VideoNote
2017-05-20 19:25:24 +02:00
Jacob Bom
d4f2f2e077
Getting instead of popping
...
I really think we should be popping and I'm unable to see why it makes our tests fail, but for now.. rolling back.
2017-05-20 19:02:01 +02:00
Jacob Bom
76db279624
We have to send and array... that's new...
2017-05-20 18:46:39 +02:00
Jacob Bom
a97da5cb20
Sooo apparently python 2 doesn't like ‘ (\xe2)
2017-05-20 17:36:10 +02:00
Jacob Bom
5f96c507b9
Payment ids should be unique... probably
2017-05-20 17:31:46 +02:00
Jacob Bom
402e1381bb
OrderInfo can be completely empty
...
In which case it should still be an OrderInfo not None
2017-05-20 17:31:46 +02:00
Jacob Bom
b276b06b31
Pop instead of get if our name doesn't match telegrams (user/from_user)
2017-05-20 17:31:46 +02:00
Jacob Bom
b69ecc3015
Fix import order
2017-05-20 17:31:46 +02:00
Jannes Höke
6479e15578
Bump version to v6.0.0
2017-05-19 21:49:01 +02:00
Jannes Höke
5dd3a660e3
forgot some escaping
2017-05-19 20:57:52 +02:00
Eldinnie
e2a651afc8
Allow edited as seperate input ( #608 )
...
* Allow edited as seperate input
In short made it possible to tune messagehandler more to your wishes. and choose exactly what updates to receive. messages, edited_message or channel_post or a combination.
- Added the edited_updates argument to MessageHandler
- Added DepricationWarning when using allow_edited
- replaced _is_allowed_message and _is_allowed_channel_post with _is_allowed_update
- Modified tests to reflect new way
* oops
Spelled deprecation wrong
made an error in the _is_allowed_update.
* Python 2 does not have assertWarns.
* remove unneeded statements
2017-05-19 20:26:10 +02:00
Jacob Bom
834c1ab3c5
Merge branch 'master' into payment
2017-05-19 20:25:46 +02:00
Evgen
33512ffd2e
Improved CommandHandler ( #613 )
...
* Improved CommandHandler
Now you can pass list of commands instead of one command
* Added tests for list of commands
* Return backward compatibility
Renamed `commands` to `command` in CommandHandler
* Added test for a command not in the list
* Fixed py2 unicode command support in `CommandHandler`
2017-05-19 20:21:37 +02:00
Evgen
c2c5452829
Updated docstring in deleteMessage methods ( #618 )
...
* Removed "undocumented" notice
* Updated docstring according to Bot API documentation
* Removed extra line
2017-05-19 20:21:20 +02:00
Jacob Bom
c78d697b0e
Add invoice and successful_payment to Message
2017-05-19 20:06:58 +02:00
Jacob Bom
2929c76248
Fix docstring for Message
2017-05-19 20:04:24 +02:00
Jacob Bom
034bcf0895
Add pay inlinekeyboardbutton type
2017-05-19 19:49:31 +02:00
Jacob Bom
8be57198b4
New payment bot methods
...
sendInvoice, answerShippingQuery, and answerPreCheckoutQuery
2017-05-19 19:46:42 +02:00
Jacob Bom
8e62b02ff6
Add new payment classes
...
Invoice, LabeledPrice, OrderInfo, PreCheckoutQuery, ShippingAddress, ShippingOption, ShippingQuery and SuccessfulPayment
2017-05-19 19:41:06 +02:00
Jannes Höke
9aa5522694
sanitize html and markdown in Message.text_html and text_markdown ( #621 )
...
* sanitize html and markdown in Message.text_html and text_markdown
* add import for escape_html
2017-05-19 19:11:40 +02:00
evgfilim1
578627feca
Fixed and added some type hints in docstrings
2017-05-17 21:41:08 +05: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
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
Noam Meltzer
1bb5dd224b
Fix bad formatting of BadRequest exception message
...
fixes #470
2017-01-07 23:09:06 +02:00
Noam Meltzer
bd96771a7a
Fix typo
2017-01-07 23:05:58 +02:00
Noam Meltzer
58dddfd9c3
Control the read timeout from telegram servers
...
refs #495
refs #364
2017-01-07 20:13:08 +02:00
Noam Meltzer
68a7d9fa1b
Make sure to hint Telegram servers that we reuse connections
...
refs #495
refs #364
2017-01-07 20:13:08 +02:00
Jacob Bom
38f2064639
Tricky empty string in __init__
2016-12-30 14:03:49 +01:00
Jacob Bom
232a0b0286
Fix instances of empty strings in __init__
...
Should partially fix #460
2016-12-30 13:57:59 +01:00
Anton Tagunov
48bcc3129a
set timeout for post message with file object ( #486 )
2016-12-29 12:01:58 +02:00
Joscha Götzer
6a01164897
ConversationHandler breaks when bot is also used in Channels ( #487 )
...
* ConversationHandler now ignores channel posts
2016-12-25 22:36:01 +02:00
Noam Meltzer
7f6b017ce2
Merge pull request #484 from python-telegram-bot/jobqueue-absolute-simple
...
JobQueue: Simpler API for adding jobs
2016-12-21 00:04:01 +02:00
Jannes Höke
09cb33f52d
rename Job.is_removed to removed
2016-12-20 22:37:36 +01:00
Noam Meltzer
423251f66c
Change Job.is_removed to be a property instead of a method
2016-12-20 00:14:03 +02:00
Hugo Hakim Damer
a8fecc527d
Prevented modifications to the request object's original data ( #454 )
...
fixes #357
2016-12-20 00:07:35 +02:00
Yan
c3984e1bf1
Download changed ( #459 )
...
* DownBytes added
* File.downbyte changed
* Changed file.download();Remove downbyte()
* Fixed typo
* add docstring, make custom_path and out mutually exclusive, rename downbytes to retrieve
* remove trailing whitespace
* run pre-commit hooks
2016-12-18 03:05:00 +01:00
Noam Meltzer
93bf21a0a4
jobqueue.py: stability improvments
...
- Job.job_queue is now weakref.proxy reducing the risk of cyclic
pointers preventing Job object from being deleted.
- JobQueue._put(): raise if both next_t and job.interval are None
- Don't put repeating job back to queue if user had disabled it was
disabled during the time of execution.
- New method: Job.is_removed() - promising a consistent API (instead of
access to private member Job._remove)
- Documentation fixes.
2016-12-15 00:17:57 +02:00
Jannes Höke
cbf93e1046
switch to run_x naming scheme
2016-12-14 18:01:44 +01:00
Jannes Höke
a1a8628c75
bot.py: fix argument order, setWebhook: make 'url' and 'webhook_url' mutually exclusive
2016-12-14 17:38:06 +01:00
Jannes Höke
d5ce32c672
removed Job.run_immediately and related code
2016-12-14 17:15:52 +01:00
Jannes Höke
09ddc1b1a8
DAAAANGER ZOOOONE
2016-12-14 16:27:45 +01:00
Jannes Höke
c7cd379016
jobqueue.py: move the check for job.interval types into Job.__init__
2016-12-14 06:30:18 +01:00
Jannes Höke
92dc9b81ce
bot.py: implement changes of december 04 (bot api 2.3.1)
2016-12-14 00:50:34 +01:00
Jannes Höke
8ead72e3ef
jobqueue: add support for specifying next_t in datetime.datetime or datetime.time
2016-12-13 23:38:13 +01:00
Jannes Höke
71530f404d
Bump version to v5.3.0
2016-12-11 23:51:51 +01: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
Noam Meltzer
acf1541395
Botapi2.3 ( #471 )
...
* New fields channel_post and edited_channel_post for Update
refs #468
* setGameScore() changes
- Changed behaviour: messages with high scores will be update with new
high scores by default. (documentation fix)
- Use (new) disable_edit_message in setGameScore to disable the above new
behaviour.
- The edit_message parameter from setGameScore is no longer in use. For
backward compatibility, it will be taken into account for a while,
unless disable_edit_message is passed explicitly.
refs #468
* New field forward_from_message_id for Message.
refs #468
* New parameter cache_time for answerCallbackQuery
refs #468
* replykeyboardhide renamed to replykeyboardremove
refs #468
* Unitests for updated setGameScore semantics
refs #468
* Backward compatibility for ReplyKeyboardHide
refs #468
* Fix docstrings of wrapper methods in Message
* Unitest new field forward_from_message_id of Message
refs #468
* Fix testMaxCaptionLength
Telegram servers changed their behaviour - now they truncate a long
caption instead of returning an error.
* MessageHandler: Added support for channel posts
* Fix flake8 complaints in a manner which yapf will like it too.
* fix rst markup
2016-12-11 22:44:52 +01:00
Jacob Bom
906a1b8d7d
message.edit_reply_markup now correctly edits reply_markup ( #473 )
2016-12-08 13:23:51 +01:00
lisitsky
a2fddbe85c
Fix telegram API change, returning '404 Not found' ( #461 )
...
* Fix telegram API change, returning '404 Not found' with raising own TelegramError rather native exception
* Change exception to InvalidToken in test and request util
* Added myself to AUTHORS. Thx for appreciation :)
2016-11-09 14:36:42 +01:00
Wesley Gahr
68e87db909
Job queue time units ( #452 )
...
* Adding timeunit and day support to the jobqueue
* Adding tests
* Changed the file permission back to 644.
* Changed AssertEqual argument order to (actual, expectd).
* Removed the TimeUnit enum and unit param, instead use datetime.time for interval.
* Removing the TimeUnits enum and unit param in favour of optionally using a datetime.time as the interval.
* Removing the TimeUnits enumeration, forgot the remove it in the last one.
* Removed some old docstrings refering to the TimeUnits enum.
* Removed the old TimeUnits import.
* Adding some error handling for the 'days' argument (only a 'tuple' with 'Days')
* Writing the error message directly in the exception.
* Moving a debug statement wrongfully saying a job would be running on days it wouldn't.
* Writing error messages directly in the exceptions instead of making an extra variable.
* Replacing datetime.time in favour of datetime.timedelta because of the get_seconds() method.
* Adding error handling for the method .
* Splitting the tests up in multiple ones, no float test because I haven't found a reliable way to test it.
* Excluding .exrc file.
* Removing \ at EOF of ValueError.
* Replacing Enums with plain new-style classes.
* Using numbers.number to check for ints/floats instead of seperate int/float checks.
* Fixing typo, number -> Number.
* Changed lower_case Days attributes to UPPER_CASE.
* Different formatting for Days class, removed the get_days function in favour of a tuple.
* Removed redundant function get_days.
* Edited the docstring for next_t to also take datetime.timedelta.
* Removed for-loop in favour of any().
* Changed docstring for interval.
* Removed debug print.
* Changing some docstrings.
* Changing some docstrings (again).
2016-11-08 23:39:25 +01:00
Jannes Höke
65061f8a99
[ci skip] docs: add all missing classes
2016-11-01 09:01:36 +01:00
Jannes Höke
aa3ca38837
Sphinx restructuring: Now builds PDF and better HTML docs ( #449 )
...
* update sphinx source files to properly build latexpdf and improve html build
* fix docstrings and sphinx sources to get rid of warnings
* add telegram.contrib.rst
2016-11-01 06:53:51 +01:00
Jannes Höke
2786252a51
Bump version to v5.2.0
2016-10-25 20:10:36 +02:00
neutronnnate
761547e71d
Issue 422: Fixed start_polling with clean=True can cause 'Too Many Requests' error from Telegram. ( #437 )
2016-10-25 19:30:05 +02:00
Jannes Höke
10bdf8212c
Add pass_user_data and pass_chat_data to Handler ( #436 )
...
* initial commit for user_data
* add chat_data and use defaultdict
* fix chat_data copy-paste error
* add test for user_data and chat_data
* fix case where chat is None
* remove braces from import line
2016-10-25 19:28:34 +02:00
Kristofer Kirss
45936c9982
Remove deprecated argument from Updater docstring ( #444 )
...
Argument (job_queue_tick_interval) was removed with commit 3aedd78
but the docstring in updater.py wasn't.
2016-10-23 00:31:44 +03: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
4e5f4582dd
Merge pull request #411 from python-telegram-bot/bitwise-filters
...
Make filters and/or-able using bitwise operators.
2016-10-19 11:40:35 +02:00
Jacob Bom
225bc24c2a
Merge pull request #442 from python-telegram-bot/explicit-kwargs
...
Use explicit kwargs and change/add a bunch of documentation.
2016-10-19 11:36:19 +02:00
Noam Meltzer
a5f9aa3171
more documentation
2016-10-17 23:44:40 +03:00
Noam Meltzer
78088f4f6a
Fix grammer: 'a object' -> 'an object'
2016-10-17 01:22:40 +03:00
Noam Meltzer
59fa717023
Documentation improvements + small style fixes
2016-10-17 01:11:20 +03:00
Noam Meltzer
31cab0d1b4
editMessageCaption & editMessageReplyMarkup: more validation on input
2016-10-17 01:09:44 +03:00
Jacob Bom
e367b8519d
Use explicit kwargs for all class inits in pure api.
...
While not stickily necessary for most classes (since user isn't directly creating them) it still unifies our approach.
However for some like ReplyKeyboardHide where users are making the classes themselves it should improve IDE autocomplete support.
2016-10-16 16:24:13 +02:00
Jacob Bom
b610316667
Use explicit kwargs for all bot methods.
...
This improves support for many IDEs' autocompletion.
2016-10-16 15:54:48 +02:00
Jacob Bom
62dd3a33e6
Better kwargs defaults.
2016-10-16 12:41:12 +02:00
Jacob Bom
3754cdafb2
send_game has differnt kwargs.
2016-10-16 12:41:12 +02:00
Jacob Bom
305ff93018
set_game_score might return True
2016-10-16 12:41:12 +02:00
Jacob Bom
a5671a8fb1
Merge pull request #423 from python-telegram-bot/edit-class-method
...
Add edit_* class methods
2016-10-15 23:03:43 +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
Noam Meltzer
a68cf8d464
Respect RetryAfter with polling Updater
2016-10-15 23:39:50 +03:00
Jacob Bom
ca5e3146c6
Fix docstring according to Jannes' commentns.
2016-10-14 10:32:12 +02:00
Noam Meltzer
53a574bbbb
Improve unitests coverage
2016-10-13 22:52:53 +03:00
Noam Meltzer
5b8efe0c14
upgrade yapf to ver 0.12.2
2016-10-12 23:56:57 +03:00
Noam Meltzer
32a78722ae
yapf fixes
2016-10-12 23:33:52 +03:00
Patrick Hofmann
8dc10fc7b2
fixes broken test cases with PhotoSize, Game and Animation classes ( #435 )
...
* fixes broken test with PhotoSize, Game and Animation
However:
testSendGame and test_set_game_score both produces *BadRequest: u'Wrong file identifier/HTTP URL specified'*.
* fixes test_set_game_score
* adds to_dict method to Game to prevent extra collection type checks in base.TelegramObject
2016-10-10 11:44:40 +02:00
Jacob Bom
b7c7612b3f
Add game filter
2016-10-07 22:37:29 +02:00
Patrick Hofmann
8cab735342
small fix for game related parts
...
* bot.py fix copy paste error in url
* callbackquery.py make data field optional
* message.py introduce optional game field
2016-10-06 17:52:53 +02:00
Noam Meltzer
01a5a1c5b3
small documentation fix
2016-10-05 23:22:55 +03:00
Noam Meltzer
1f9d3163dd
Game: use explicit keyword args + added docmentation
2016-10-04 02:17:12 +03:00
Noam Meltzer
837e9d2964
Animation: use explicit keyword args + added documentation
2016-10-04 02:16:33 +03:00
Noam Meltzer
fab97df58a
GameHighScore: added attributes documentation
2016-10-04 02:06:22 +03:00
Noam Meltzer
d70fc48e94
getGameHighScores(): added documentation + fixed copy-paste errors
2016-10-04 01:57:19 +03:00
Noam Meltzer
36192912c2
setGameScore: fixes
...
- fix copy/paste errors
- return Message object
2016-10-04 01:56:05 +03:00
Noam Meltzer
34748ec228
callbackgame: small documentation fix
2016-10-04 01:50:34 +03:00
Noam Meltzer
d5567cd9cd
sendGame(): mall fixes
2016-10-04 01:37:44 +03:00
Noam Meltzer
2463b4b9c8
New exception: RetryAfter
...
Also, small fix to the description text of ChatMigrated
2016-10-04 01:27:45 +03:00
Noam Meltzer
7cf5009517
small documentation fixes
2016-10-04 01:10:30 +03:00
Noam Meltzer
9b74625d4a
answerCallbackQuery: fix copy/paste: show_alert -> url
2016-10-04 00:55:29 +03:00
Noam Meltzer
4180c069b3
InputFile: use self instead of explicit class name
2016-10-04 00:25:32 +03:00
Noam Meltzer
3a0f219783
inputfile: define the file types as constant and use iterator
2016-10-04 00:25:05 +03:00
Noam Meltzer
3c889655c1
Allow http url as a file_id
...
N.B. test_send_video_mp4_file_url() is still failing, probably because
of telegram servers bug. Will contact telegram bot support about that.
2016-10-04 00:20:17 +03:00
Jacob Bom
5e2d96b47d
Make tests actually run at all
2016-10-03 21:07:41 +02:00
Jacob Bom
551f6c556c
Add game parameters in various places
...
Also chat_instance in CallbackQuery which will break a lot of tests probably
2016-10-03 21:01:38 +02:00
Jacob Bom
ae17eb3272
Add InlineQueryResultGame
2016-10-03 20:55:21 +02:00
Jacob Bom
358dd795c7
Add the rest of game_ methods to bot.
2016-10-03 20:43:02 +02:00
Jacob Bom
151a441af7
Add send_game
2016-10-03 20:40:17 +02:00
Noam Meltzer
1f67623615
Fix import order
2016-10-03 21:34:08 +03:00
Noam Meltzer
8737b5de63
fix syntax error by some weird char
2016-10-03 21:17:04 +03:00
Jacob Bom
f3b8a3a5e9
Merge remote-tracking branch 'origin/october3' into october3
2016-10-03 20:10:14 +02:00
Jacob Bom
9e9309eb90
Add all new Game related classes
...
Missing docstrings for now though, wanna add everything first
2016-10-03 20:09:57 +02:00
Noam Meltzer
e8a34d8eef
cosmetic fixes and documentation for getWebhookInfo
2016-10-03 20:43:10 +03:00
Jacob Bom
34c62a633b
Add url to answerCallbackQuery
2016-10-03 15:25:07 +02:00
Jacob Bom
868d9217bc
Add WebhookInfo and getWebhookInfo
...
Still needs tests though
2016-10-03 15:16:43 +02:00
Jacob Bom
f7ede4baea
Add caption fields to voice and audio
...
Or at least the methods/classes for sending.
2016-10-03 15:05:49 +02:00
Jacob Bom
c3e07b1056
Add switch_inline_query_current_chat
2016-10-03 14:52:58 +02:00
Jacob Bom
79bdfe4c5d
Allow filters to be passed without list.
...
Also deprecates actually using a list.
2016-09-29 19:10:22 +02:00
Michael Elovskikh
46657afa95
Start additional threads only when necessary ( #415 )
...
* Start all additional threads only when necessary.
* Deprecate prevent_autostart in the c'tor of JobQueue.
2016-09-27 10:21:35 +03:00
Jacob Bom
79e065a730
Add __str__ and __repr__ to MergedFilter.
2016-09-25 16:31:06 +02:00
Jacob Bom
0e2c3666c0
Add edit_* family of methods to CallbackQuery.
...
Either edits the message attribute, or the message associated with the inline_message_id.
2016-09-25 16:03:06 +02:00
Jacob Bom
a996e8873f
Add edit_* family of methods to Message.
2016-09-25 15:50:58 +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
Jannes Höke
c49058dbb4
Bump version to v5.1
2016-09-24 15:29:23 +02:00
Jacob Bom
1b99caa2f9
Merge remote-tracking branch 'origin/master' into entities-filter
2016-09-24 13:46:55 +02:00
Jacob Bom
e16c1da6b1
Change entities filter to be singular.
...
Also remove the faulty example completely since it should be no longer needed.
2016-09-24 13:38:56 +02:00
Jannes Höke
e1242b3b4a
message.py: add quote keyword argument to reply_x methods ( #420 )
2016-09-23 17:44:09 +02:00
Eli Gao
a91fe5f8f6
Properly split and handle arguments in CommandHandler ( #414 )
...
* Properly split and handle arguments in CommandHandler
* Update the docstring for pass_args in CommandHandler
* Properly split and handle arguments in StringCommandHandler
2016-09-20 06:38:49 +02:00
Jannes Höke
5116a77221
Class methods ( #362 )
...
* bot.py: add create_references method
* create bot reference in webhook handler, use create_references on new updates
* message.py: implement reply_text
* echobot2.py: use Message.reply_text
* fix create_references in webhook handler
* add some more instance methods
* Chat.kick_member and unban_member
* bot.py: Create bot references in outgoing messages
* add tests for everything testable
* test_updater.py: add create_references method to MockBot
* remove Bot.create_references and refactor TelegramObject.de_json to take the additional parameter bot
* List bot as named kwarg where used
* file.py: Use Bot.request property instead of Bot._request attr
2016-09-20 06:36:55 +02:00
Jannes Höke
1efd330e59
ConversationHandler: Fix #373
2016-09-20 05:00:39 +02:00
Jannes Höke
af3e8c6440
Merge branch 'master' of https://github.com/LiaungYip/python-telegram-bot into LiaungYip-master
2016-09-20 04:10:39 +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
Jacob Bom
97bb04cd38
Faulty example was faulty.
2016-09-13 20:50:25 +02:00
Jacob Bom
f7b497c1b4
Fix in keyword ordering
...
We're testing for a string in list, not the other way around :P
2016-09-13 20:45:42 +02:00
Jacob Bom
4e60008086
Add entities filter
...
Should ideally superseed #375 .
2016-09-13 20:09:46 +02:00
Rahiel Kasim
5285f63e4a
Merge pull request #388 from python-telegram-bot/emoji
...
deprecate telegram.Emoji
2016-09-13 19:25:58 +02:00
Jacob Bom
6647ae3c25
Add methods to parse entities in Message
...
Should close #400 .
* Add parse_entity
* Add parse_entities
* Add MessageEntity types as constants to MessageEntity.
* Add MAX_MESSAGE_ENTITIES to constants.py
Note: the value has been found by experimentation as opposed to extracted from the api docs.
* Add tests for parse_entity and parse_entities
2016-09-07 08:49:09 +02:00
Noam Meltzer
e4a132c0e4
Reusable dispatcher ( #402 )
...
* Create a Request class which maintains its own connection pool
* When creating a Bot instance a new Request instance will be created if one wasn't supplied.
* Updater is responsible for creating a Request instance if a Bot instance wasn't provided.
* Dispatcher: add method to run async functions without decorator
* Dispatcher can now run as a singleton (allowing run_async decorator to work) as it always did and as multiple instances (where run_async decorator will raise RuntimeError)
2016-09-06 16:38:07 +03:00
Rahiel Kasim
da87d4ba78
fix yapf
2016-08-26 11:17:05 +02:00
Rahiel Kasim
fcda567f8c
use ujson as JSON en/decoder if available
2016-08-26 09:40:46 +02:00
Jacob Bom
ffff0938f4
Add forwarded filter ( #392 )
2016-08-23 16:55:50 +02:00
Li-aung 'Lewis' Yip
ab2d6eb494
Fix "key not found" exception if the very first message handler in a ConversationHandler returns the state ConversationHandler.END.
2016-08-22 05:49:37 +08:00
Rahiel Kasim
5d27059631
deprecate telegram.Emoji
2016-08-21 11:50:22 +02:00
Rahiel Kasim
00bba73673
drop Python 2.6 support ( closes #245 ) ( #386 )
...
* drop Python 2.6 support (closes #245 )
* fix NullHandler import
* README: explicitly mention Py3 and PyPy compatibility
2016-08-20 22:01:07 +02:00
Jannes Höke
5134f71380
Merge branch 'more-regex-handlers' of https://github.com/bomjacob/python-telegram-bot into bomjacob-more-regex-handlers
2016-08-06 14:32:05 +02:00
Jacob Bom
32268597d9
Wrap long lines
2016-08-06 14:19:41 +02:00
Jacob Bom
cd2f956e56
Also fix linebreak ^^
2016-08-06 13:35:58 +02:00
Jacob Bom
18fdb5ed13
Fix weird indent.
2016-08-06 13:35:06 +02:00
Jacob Bom
8c698caa12
Add Regex handling to CallbackQueryHandler and InlineQueryHandler.
...
Mostly a copy-paste from RegexHandler.
Not fully tested! Also needs yapf - sorry.
2016-08-06 13:33:38 +02:00
Jannes Höke
587908457e
move version string to telegram/version.py ( #361 )
2016-07-29 15:40:11 +00:00
overquota
f1ee54fa73
ChatMigrated exception ( #353 )
...
* ChatMigrated exception
2016-07-25 21:50:33 +03:00
Jannes Höke
834bf192b9
Bump version to v5.0.0
2016-07-15 01:48:11 +02:00
Jannes Höke
ad3eec2af8
ConversationHandler ( #331 )
...
* initial commit for conversationhandler and example
* implement simple Promise for run_async/conversationhandler
* refactor Promise._done to done
* add handling for timed out Promises
* correctly handle promises with None results
* fix handling tuple states
* update comments on example
* Added a first test on the ConversationHandler.
* Fixed a small typo.
* Yapf'd.
* add sphinx doc for conversation handler
* fix title for callbackqueryhandler sphinx docs
2016-07-15 01:30:54 +02:00
Rahiel Kasim
04a871aff5
introduce constants module ( #342 )
2016-07-14 21:48:31 +02:00
Jannes Höke
81a755a7d8
Merge branch 'urllib3_fix_proxy_auth'
2016-07-13 15:09:23 +02:00
Noam Meltzer
6016aca0ba
Bump version to v4.3.4
2016-07-12 23:34:49 +03:00
Noam Meltzer
7c908db901
urllib3: can now connect through proxies which require auth
...
fixes #343
2016-07-12 23:31:38 +03:00
Noam Meltzer
d192b385ea
dispatcher: add comment to describe the reason for conpool size
2016-07-12 21:58:27 +03:00
Jannes Höke
f0b2028e3f
Merge pull request #344 from python-telegram-bot/silence-webhook-logging
...
Move webhook handler logs to logging at DEBUG level
2016-07-12 14:35:14 +02:00
Mikki Weesenaar
f443003408
Small change in the documentation.
2016-07-12 13:45:37 +02:00
Jannes Höke
afc36a235b
move webhook handler logs to logging at DEBUG level
2016-07-11 23:44:40 +02:00
Noam Meltzer
b76337de87
__main__.py: assist with creating issues on github
...
usage:
python -m telegram
and copy/paste the output
2016-07-09 14:40:53 +03:00
Noam Meltzer
6afee6e0bd
Merge pull request #340 from python-telegram-bot/v4.3.x
...
urllib3: now supports proxy
2016-07-08 23:53:56 +03:00
Jannes Höke
27e57bbf58
Bump version to v4.3.3
2016-07-08 22:13:46 +02:00
Noam Meltzer
b3e42c3e20
urllib3: now supports proxy
...
fixes #336
2016-07-08 22:33:37 +03:00
Jannes Höke
c2cce40299
Merge branch 'use-timeout'
2016-07-04 21:56:26 +02:00
Jannes Höke
a2ed7b26f1
Bump version to v4.3.2
2016-07-04 21:52:00 +02:00
Jannes Höke
89a3dc8372
use urlopen timeout
2016-07-04 21:40:31 +02:00
Jannes Höke
9fd298a393
Merge pull request #307 from python-telegram-bot/jobqueue-rework
...
Make job queue API similar to the dispatcher, add new functionality
2016-06-29 16:20:43 +02:00
Jannes Höke
ecbc268781
Bump version to v4.3.1
2016-06-29 15:53:52 +02:00
Jannes Höke
57efde5e0f
Bump version to v4.3
2016-06-28 13:35:42 +02:00
Jannes Höke
31073101a3
yapf
2016-06-24 19:22:49 +02:00
Noam Meltzer
1e0ebe89f3
JobQueue: minimize the amount of places changing self.__tick state
...
- start the jobqueue (by default) during __init__() instead of during
put()
- protect self._next_peek and self.__tick with a Lock
- rename self._start() to self._main_loop()
- stop() is now blocking until the event loop thread exits
2016-06-24 19:35:54 +03:00
Noam Meltzer
f65b6911ea
JobQueue: use class name for the logger name
2016-06-24 19:13:40 +03:00
Noam Meltzer
02af1ea803
jobqueue: cosmetic fixes
2016-06-24 19:13:40 +03:00
Jannes Höke
c4a8ee5175
Merge branch 'master' into jobqueue-rework
...
Conflicts:
tests/test_jobqueue.py
2016-06-20 05:32:15 +02:00
Jannes Höke
738e3213a7
Merge branch 'master' into jobqueue-rework
2016-06-20 00:49:01 +02:00
leandrotoledo
b41f7e3e79
Code style with latest yapf
2016-06-19 17:50:02 -04:00
Jannes Höke
7635bc0eec
comments, lock thread pool, while 1 and snake_case everywhere
2016-06-19 23:46:34 +02:00
Jannes Höke
703bece155
set loglevel of urllib3 to WARNING by default
2016-06-19 23:40:34 +02:00
Noam Meltzer
5b91194cc7
new yapf version, new cosmetic fixes
2016-06-18 20:05:10 +03:00
Noam Meltzer
494a7ec1e4
ypaf fixes
2016-06-18 19:57:11 +03:00
Noam Meltzer
fc05d3a626
switch back to PoolManager
...
telegram servers might send a reponse with HTTP 302 (redirect) to
another hostname. in such case HTTPSConnectionPool will fail to do the
job
2016-06-18 19:50:18 +03:00
Noam Meltzer
a814e9de6b
make sure to stop conpool between sensitive unitests
2016-06-18 00:50:44 +03:00
Noam Meltzer
e479c7f25e
type hinting (cosmetic fix)
2016-06-17 23:59:32 +03:00
Noam Meltzer
a30411c9fa
make sure to remove the stopped dispatcher threads from ASYNC_THREADS
2016-06-17 23:58:22 +03:00
Noam Meltzer
881d1d0e25
fix/hack Updater.stop() not working on extreme cases
...
during test_bootstrap_retries_fail() there is an exception raised (by
design): TelegramError('test')
For a reason I haven't managed to pinpoint the above exception in its
precise timing caused the Updater to be left in a state which is
'self.running == False', but the dispatcher threads already initialized.
This patch identifies this extreme case and makes sure to go over the
stop procedure.
2016-06-17 23:53:18 +03:00
Noam Meltzer
cb6ddfded5
Merge remote-tracking branch 'origin/master' into urllib3
2016-06-17 17:54:04 +03:00
Noam Meltzer
bda0244ed8
updater: fix print in log
2016-06-17 16:52:25 +03:00
leandrotoledo
897f9615f0
Bump version to v4.2.1
2016-06-10 09:44:17 -04:00
leandrotoledo
bbbc622517
Adds @message decorator to editMessageText #320
2016-06-03 13:28:29 -04:00
Noam Meltzer
1f5601dae2
fix SyntaxWarning
2016-06-01 22:38:08 +03:00
Noam Meltzer
3608c2bbe5
dispatcher: if connection pool is already initialized raise exception
...
this will better protect the user from wrong usage
2016-06-01 22:30:34 +03:00
Noam Meltzer
c28763c5be
dispatcher: cosmetic fix
2016-06-01 22:30:33 +03:00
Noam Meltzer
dd8b6219b9
dispatcher: a little performance improvment
2016-06-01 22:30:33 +03:00
Noam Meltzer
78f9bdcac9
dispatcher: pep8 style fix
...
globals are supposed to be upper case
2016-06-01 22:30:09 +03:00
Jannes Höke
b08d41d0ff
formatting
2016-05-31 15:35:40 +02:00
Jannes Höke
de2d732135
Merge branch 'master' into jobqueue-rework
...
Conflicts:
README.rst
telegram/ext/commandhandler.py
telegram/ext/messagehandler.py
2016-05-31 15:34:36 +02:00
Jannes Höke
1ff348adbb
issue warning if connection pool was initialized before Dispatcher
2016-05-31 13:47:43 +02:00
Jannes Höke
6b457bada5
use keepalive for connection pool
2016-05-31 13:45:43 +02:00
Jannes Höke
74283bd414
use HTTPSConnectionPool instead of PoolManager
2016-05-30 17:12:50 +02:00
Jannes Höke
41f6591ac6
more sensible logging
2016-05-30 17:12:27 +02:00
Juan Madurga
073d7949dc
fix callbackquery to_dict
2016-05-30 15:59:45 +02:00
Jannes Höke
dd91ce1f39
use single queue for thread pool, initialize connection pool with n+3
2016-05-30 13:09:23 +02:00
Jannes Höke
57759d8e6d
[drunk] use actual thread pool and queue new functions into the pool instead of starting new threads every time
2016-05-30 03:16:33 +02:00
Noam Meltzer
574fc8cddf
urllib3: validate https certificate
2016-05-30 01:05:19 +03:00
Noam Meltzer
3076dfc086
use urllib3 instead of urllib(2)
2016-05-30 01:05:19 +03:00
Jannes Höke
41432f5b02
bump version to v4.2.0
2016-05-28 22:49:15 +02:00
Rahiel Kasim
f31bd91673
Merge pull request #305 from python-telegram-bot/move-botan
...
move botan from utils to contrib
2016-05-28 21:32:07 +02:00
Noam Meltzer
7e7acdeb23
set default network_delay to 5 seconds
...
fixes #309
2016-05-28 19:34:16 +03:00
Jannes Höke
25bcfa9b35
add constants for Chat.type and ChatMember.status
2016-05-28 16:51:44 +02:00
Jannes Höke
ff00e211d7
include in warning that Py2.7 will still be supported
2016-05-28 16:44:39 +02:00
Jannes Höke
d40f0a8309
update update_queue and job_queue docstrings on all handlers
2016-05-28 16:04:19 +02:00
Jannes Höke
783f9c375c
move job_queue kwarg to end
2016-05-28 14:21:39 +02:00
Jannes Höke
406303d6bb
refactor: running -> _running, next_peek -> _next_peek
2016-05-28 13:48:30 +02:00
Jannes Höke
2534e0df9b
allow jobs to be ran outside of jobqueue
2016-05-28 13:41:23 +02:00
Rahiel Kasim
b06983a94a
let python 2 find the contrib module
2016-05-28 09:27:17 +02:00
Rahiel Kasim
c8497424b7
move botan to contrib
2016-05-28 09:12:10 +02:00
Jannes Höke
a0bb5730c6
add allow_edited parameter to MessageHandler and CommandHandler
2016-05-27 11:07:06 +02:00
Leandro Toledo
9a13de4a96
Merge remote-tracking branch 'origin/master' into bot2.1
...
Conflicts:
telegram/bot.py
tests/test_bot.py
2016-05-26 16:15:50 -03:00
Noam Meltzer
561f1c3f02
bot: validate token does not contain white spaces ( #306 )
...
in addition move validation code from validate.py into bot.py and delete
the former file
2016-05-26 22:09:14 +03:00
Leandro Toledo
3907e64966
Adds telegram.utils.botan back using deprecate
2016-05-26 14:13:27 -03:00
Rahiel Kasim
1abbca3324
bot.py: fix snake_case alias
2016-05-26 15:32:02 +02:00
Jannes Höke
bb165b6acf
add pass_job_queue parameter to all handler classes
2016-05-26 14:39:11 +02:00
Jannes Höke
41daccce07
minor comments and formatting
2016-05-26 14:02:52 +02:00
Jannes Höke
786216305c
Add context parameter in Job class #281
2016-05-26 13:55:56 +02:00
Leandro Toledo
663fa0013d
merge master
2016-05-25 22:09:18 -03:00
Leandro Toledo
37c7af2e14
Add docstrings #302
2016-05-25 21:41:12 -03:00
Leandro Toledo
e70625772c
Keeps backwards compatibility to BadRequest #302
2016-05-25 21:24:29 -03:00
Leandro Toledo
1e398821a0
Introducing telegram.error.BadRequest and testLeaveChat testcase #302
2016-05-25 21:15:17 -03:00
Jannes Höke
b3142d2974
yapf
2016-05-25 23:57:29 +02:00
Jannes Höke
3aedd78e29
make job queue API similar to the dispatcher, add new functionality
2016-05-25 23:36:41 +02:00
Rahiel Kasim
c4d5eff9f3
move botan from utils to ext
2016-05-24 23:40:09 +02:00
Leandro Toledo
0b2fd120d8
Due kwargs I had to change the factory class in favor of InputLocationMessageContent #302
2016-05-23 21:09:07 -03:00
Leandro Toledo
ab2f6e13c9
Add kwargs to API calls #302
2016-05-23 20:43:17 -03:00
Leandro Toledo
108e4264fc
Add user to MessageEntity #302
2016-05-23 20:31:36 -03:00
Leandro Toledo
68b5562c49
Add edit_date to Message #302
2016-05-23 20:28:36 -03:00
Leandro Toledo
e50a3622e1
Add edited_message to Update #302
2016-05-23 20:24:43 -03:00
Leandro Toledo
d7e226ec0f
Add new Bot methods and ChatMember class #302
2016-05-23 20:22:31 -03:00
leandrotoledo
c7db9a96cd
Set split_before_logical_operator to True
2016-05-23 17:19:35 -03:00