Commit graph

313 commits

Author SHA1 Message Date
Eldinnie
ac60d057a5 All api 4.2 and 4.3 changes (#1418) 2019-08-23 22:20:41 +03:00
Jasmin Bom
26ce9bb343
Documentation fixes (#1348)
* Clarify InlineKeyboardButton callback-data docstring

Fixes #1267

* Improve documentation slightly

- Prettier changelog
- Link to examples on frontpage
- Link to wiki on frontpage
- Put telegram.ext in own sidebar thingy

* Improve ext.Filters documentation

Superseeds #1089

- Remove `:obj:Filter` as it's pretty obvious that it's a filter since it's in this module. It also made the html output about 1/3 times longer to scroll through.
- Add an __all__ to reorder so Filter is at the top instead of BaseFilter
- Add a proper docstring for document that documents the attributes (this is the #1089 part)
- Also fix a couple of grammar errors.

* Fix indentation in telegram.rst

* Add `git describe --long --tags` to the `python -m telegram` output

* Use admonition for examples to make them *pop* better

* Remove automodule telegram

Sphinx was whining a lot and it doesn't actually seem to be needed in any way?

* Fix Filters.document docstring per CR

Co-Authored-By: jsmnbom <jsmnbom@gmail.com>

* Fix spelling error in docs index

Co-Authored-By: jsmnbom <jsmnbom@gmail.com>

* Setting needs_sphinx to 1.7.9

so we don't have more issues with incongruent versions

* Fixed last warnings

* Make pre-commit happy
2019-02-18 20:04:52 +01:00
Jasmin Bom
446c54cf8d Bump to version 12.0.0b1 2019-02-13 13:41:04 +01:00
Jasmin Bom
e75615cbf6 Revert "Revert "CommandHandler overhaul and PrefixHandler added (#1114)""
This reverts commit 9e2357b
2018-09-21 08:57:43 +02:00
Jasmin Bom
cf95027308 Revert "Revert "Context based callbacks (#1100)""
This reverts commit f8a17cd
2018-09-21 08:57:01 +02:00
Eldinnie
439790375e Persistence (#1017)
* BasePersistence

* basic construct

* Keep working

* Continue work

Add tests for Basepersistence

* Finish up BasePersistence and implementation

* PickelPersistence and start tests

* Finishing up

* Oops, left in some typings

* Compatibilty issues regarding py2 solved

For Py2 compatibility

* increasing coverage

* Small changes due to CR

* All persistence tests in one file

* add DictPersistence

* Last changes per CR

* forgot change

* changes per CR

* call update_* only with relevant data

As discussed with @jsmnbom

* Add conversationbot Example

* should not have committed API-key
2018-09-20 22:50:40 +02:00
Jasmin Bom
259a1faedc Releasing v11.1 2018-09-01 17:27:35 +02:00
Jasmin Bom
4473d620de Prepare for 11.0.0 release 2018-08-29 15:21:02 +02:00
Eldinnie
4689a80c2e Bot API 4.0 (#1168)
Telegram Passport (#1174):

- Add full support for telegram passport.
    - New types: PassportData, PassportFile, EncryptedPassportElement, EncryptedCredentials, PassportElementError, PassportElementErrorDataField, PassportElementErrorFrontSide, PassportElementErrorReverseSide, PassportElementErrorSelfie, PassportElementErrorFile and PassportElementErrorFiles.
    - New bot method: set_passport_data_errors
    - New filter: Filters.passport_data
    - Field passport_data field on Message
    - PassportData is automagically decrypted when you specify your private key when creating Updater or Bot.
    - PassportFiles is also automagically decrypted as you download/retrieve them.
- See new passportbot.py example for details on how to use, or go to our telegram passport wiki page for more info
- NOTE: Passport decryption requires new dependency `cryptography`.

Inputfile rework (#1184):

- Change how Inputfile is handled internally
- This allows support for specifying the thumbnails of photos and videos using the thumb= argument in the different send_ methods.
- Also allows Bot.send_media_group to actually finally send more than one media.
- Add thumb to Audio, Video and Videonote
- Add Bot.edit_message_media together with InputMediaAnimation, InputMediaAudio, and inputMediaDocument.

Other Bot API 4.0 changes:

- Add forusquare_type to Venue, InlineQueryResultVenue, InputVenueMessageContent, and Bot.send_venue. (#1170)
- Add vCard support by adding vcard field to Contact, InlineQueryResultContact, InputContactMessageContent, and Bot.send_contact. (#1166)
- Support new message entities: CASHTAG and PHONE_NUMBER. (#1179)
    - Cashtag seems to be things like $USD and $GBP, but it seems telegram doesn't currently send them to bots.
    - Phone number also seems to have limited support for now
- Add Bot.send_animation, add width, height, and duration to Animation, and add Filters.animation. (#1172)


Co-authored-by: Jasmin Bom <jsmnbom@gmail.com>
Co-authored-by: code1mountain <32801117+code1mountain@users.noreply.github.com>
Co-authored-by: Eldinnie <pieter.schutz+github@gmail.com>
Co-authored-by: mathefreak1 <mathefreak@hi2.in>
2018-08-29 14:18:58 +02:00
Jacob Bom
f8a17cddcb Revert "Context based callbacks (#1100)"
This reverts commit 247577b2e2.
2018-05-31 14:22:57 +02:00
Eldinnie
9e2357bc33 Revert "CommandHandler overhaul and PrefixHandler added (#1114)"
This reverts commit 87afd98e02.
2018-05-31 14:22:43 +02:00
Eldinnie
87afd98e02
CommandHandler overhaul and PrefixHandler added (#1114)
* Commandhandler reworked

* Make CommandHandler strict

Only register valid botcommands, else raise ValueError

* Add PrefixHandler

* declare encoding on test_commandhandler

* Fix some tests dependend on CommandHandler

* CR changes

* small docfix.

* Test all possibilities for PrefixHandler
2018-05-22 21:44:20 +02:00
Jacob Bom
247577b2e2
Context based callbacks (#1100)
See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-11.0 under Context based callbacks and Filters in handlers for a good guide on the changes in this commit.

* Change handlers so context is supported

* Attempt to make parameter "guessing" work on py < 3.5

* Document use_context in all handlers

* Add Context to docs

* Minor fixes to context handling

* Add tests for context stuff

* Allow the signature check to work on py<3.5 with methods

* Fix order of operations

* Address most issues raised in CR

* Make CommandHandler no longer support filter lists

* Fix indent

(pycharm can be an arse sometimes)

* Improve readability in conversationhandler

* Make context have Match instead of groups & groupdict

* Remove filter list support from messagehandler too

* Small fix to StringCommandHandler

* More small fixes to handlers

* Amend CHANGES

* Fix tests and fix bugs raised by tests

* Don't allow users to ignore errors without messing with the warning filters themselves

* Ignore our own deprecation warnings when testing

* Skipping deprecationwarning test on py2

* Forgot some changes

* Handler: Improved documentation and text of deprecation warnings

* HandlerContext: Keep only dispatcher and use properties; improved doc

* Complete fixing the documentation.

 - Fixes per Eldinnie's comments.
 - Fixes per warnings when running sphinx.

* Some small doc fixes (interlinks and optionals)

* Change add_error_handler to use HandlerContext too

* More context based changes

Context Based Handlers -> Context Based Callbacks

No longer use_context args on every single Handler

Instead set dispatcher/updater .use_context=True to use

Works with
- Handler callbacks
- Error handler callbacks
- Job callbacks

Change examples to context based callbacks so new users are not confused

Rename and move the context object from Handlers.HandlerContext to CallbackContext, since it doesn't only apply to handlers anymore.

Fix tests by adding a new fixture `cpd` which is a dispatcher with use_context=True

* Forgot about conversationhandler

* Forgot jobqueue

* Add tests for callbackcontext & for context based callback job

* Fix as per review :)
2018-05-21 15:00:47 +02:00
Noam Meltzer
32afc007aa
Bump version to v10.1.0 2018-05-05 00:37:13 +03:00
Eldinnie
3bef2fa752
Updating sphinx to py3 (#1096)
* Use python 3 on read the docs

This has multiple improvements on the inspection of classes. Mainly that method signatures propely display the arguments for the method.

* Add note to telegram.Bot about camelCase

Switching to py3 means that the camelCase method descriptors will no longer be displayed in the docs. Adding a note to Bot to clarify they exist.

* Add Alias links for all camelCase
2018-05-03 15:34:50 +02:00
Pieter Schutz
6d453b7fa2 Bump to v10.0.2 2018-04-17 09:07:19 +02:00
Pieter Schutz
d9f77d6ee1 Bump to v10.0.1 2018-03-05 12:46:19 +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
69acd2b3bd Fix documentation build to include CHANGES.rst
Use forward slashes instead of the Windows backward slashes.
2018-03-03 01:23:08 +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
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
Eldinnie
1e22d570a3
Drop 3.3 from support (#930)
* Remove 3.3 from testsuite and setup.py

* add changelog to the docs

[CI skip]
2017-12-08 22:38:23 +01: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
Jeff
dbb3b16edc Add Job Class to docs (#845)
* fix job class missing from docs

* fix typo
2017-09-25 20:57:53 +02:00
Eldinnie
8754980448 add utils.helpers to docs (#828) 2017-09-25 20:56:28 +02: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
Noam Meltzer
5ceb6f8f36 Docs fixes (#765)
* Clean warnings during build_sphinx

* fix documentation types
2017-08-02 05:56:07 +03:00
Noam Meltzer
13ab6d43d3 CHANGES.rst: Added 7.0.1 release notes.
[ci skip]
2017-07-28 21:22:48 +03:00
Noam Meltzer
796583323d Bump version to v7.0.0 2017-07-25 22:53:20 +03:00
Eldinnie
b3b94240a5 Docs update (#728)
Amazing new documentation.
2017-07-23 23:33:08 +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
Rahiel Kasim
881da40978 Read the Docs configuration (#729)
[ci skip]
2017-07-22 14:13:49 +03:00
Jannes Höke
d5583190b8 Bump version to v6.1.0 2017-06-18 12:35:16 +02: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
Jacob Bom
92183a5bbc Some objects don't have a module 2017-06-07 12:52:36 +02:00
Jacob Bom
87b096c7f9 Only document functions/methods that are 100% lowercase + use favicon
In bot.py we did stuff like sendAudio = send_audio, which made sphinx document both, which led to clutter in our docs.
2017-06-07 12:40:09 +02:00
Jacob Bom
3329d15691 Add orange favicon
Do we need a blue one too?
2017-06-07 12:37:29 +02: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
Jannes Höke
ba6c4fd517 Bump version to v6.0.1 2017-05-21 14:25:40 +02:00
Jannes Höke
6479e15578 Bump version to v6.0.0 2017-05-19 21:49:01 +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
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
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
Jannes Höke
71530f404d Bump version to v5.3.0 2016-12-11 23:51: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
Jannes Höke
e76ee6bb57 [ci skip] docs: add even more missing classes (wtf) 2016-11-01 09:37:03 +01:00
Jannes Höke
65061f8a99 [ci skip] docs: add all missing classes 2016-11-01 09:01:36 +01:00
Jannes Höke
dabbbcafcb [ci skip] docs: remove superfluous text in index.rst 2016-11-01 08:15:51 +01:00
Jannes Höke
1eb4b40dbf [ci skip] docs: add logo to html and pdf builds 2016-11-01 08:09:25 +01:00
Jannes Höke
7167936692 [ci skip] pdf docs: use a4paper, update motto 2016-11-01 07:54:04 +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
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
Jannes Höke
a1495956aa temporary fix for documentation builds on readthedocs 2016-10-10 12:51:12 +02:00
Jacob Bom
3244417f61 Add docs for filters. 2016-09-25 00:30:04 +02:00
Rahiel Kasim
5d27059631 deprecate telegram.Emoji 2016-08-21 11:50:22 +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
Valentijn
f5f95ef8c9 Documentation (#350)
* Small fixes to documentation and add myself to AUTHORS.

* Rework CONTRIBUTIONS.rst

Use code-blocks instead of literals, change headings for portability and use a relative link to AUTHORS instead of linking to a specific copy.
2016-07-14 16:56:05 -03:00
Rahiel Kasim
04a871aff5 introduce constants module (#342) 2016-07-14 21:48:31 +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
Rahiel Kasim
2f408ab767 generate docs for botan 2016-05-28 09:18:36 +02:00
Leandro Toledo
d90b0f495d End the madness when bumping versions [ci skip] 2016-05-24 19:43:24 -03:00
Jannes Höke
dc27ff41ef bump version to 4.1.2 2016-05-22 13:01:14 +02:00
Jannes Höke
d028d4edd0 bump to 4.1.1 2016-05-16 16:05:02 +02:00
leandrotoledo
ac55ba007e Bumping version to v4.1 [ci skip] 2016-05-15 20:05:38 -03:00
Jannes Höke
10a98211f8 bump version to 4.0.3 2016-05-01 22:13:27 +02:00
Jannes Höke
62c651d167 bump version to 4.0.2 2016-04-29 19:31:45 +02:00
Jannes Höke
865bba3f3e bump version to 4.0.1 2016-04-27 01:17:47 +02:00
Jannes Höke
fd15e51e28 bump version to 4.0.0, update CHANGES 2016-04-27 01:02:57 +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
7daf26198e bump version to 4.0rc1 2016-04-22 16:24:32 +02:00
Jannes Höke
8c0de59d46 fix rst syntax 2016-04-22 16:13:24 +02:00
Jannes Höke
d46d9a711d Merge branch 'bot-api-2.0' into dispatcher-rework
Conflicts:
	docs/source/telegram.ext.jobqueue.rst
	docs/source/telegram.rst
2016-04-22 16:12:45 +02:00
Leandro Toledo
b444cd7bce Adding new modules to docs #232 2016-04-22 11:07:44 -03:00
Jannes Höke
cfdfdeb4fc Merge branch 'bot-api-2.0' into dispatcher-rework 2016-04-21 17:20:05 +02:00
Leandro Toledo
fc277d7393 Refactor of telegram.Bot class and docstrings #232 2016-04-19 09:04:25 -03:00
Jannes Höke
b6fceefc80 documentation 2016-04-18 18:13:54 +02:00
Jannes Höke
808945b623 prepare release of v3.4 2016-03-22 03:02:13 +01:00
Jannes Höke
150914cf25 Adjust sphinx docs to telegram.ext submodule 2016-03-19 13:26:38 +01:00
Jannes Höke
218e22631c Prepare to release v3.3 2016-02-28 02:33:49 +01:00
Jannes Höke
5fd7a4fe0d release v3.3b1 2016-01-09 15:50:19 +01:00
Jannes Höke
c69cdfd184 Initial commit for inline bot support 2016-01-09 15:09:48 +01:00
Jannes Höke
aa8966832b release 3.2 and update copyright notice to 2015-2016 2016-01-05 14:12:03 +01:00
Jannes Höke
95e2aad9bd fix sphinx build 2016-01-04 02:36:27 +01:00
Jannes Höke
2ff6fe9901 initial commit for JobQueue by @franciscod 2015-12-31 14:56:48 +01:00
Jannes Höke
fc9456e1a8 release v3.1.2 2015-12-29 14:46:00 +01:00
Jannes Höke
ea7c54ba07 Release v3.1.1, change author email everywhere 2015-12-21 21:18:53 +01:00
Jannes Höke
0e78606d37 Release v3.1 2015-12-16 16:25:14 +01:00
Jannes Höke
cb0736fb3d update sphinx docs 2015-12-16 16:23:18 +01:00
Jannes Höke
bcadfc5398 Release version 3.0.0 2015-12-07 23:49:19 +01:00
Leandro Toledo
16349ac69a Releasing v2.9.2 2015-11-11 11:31:20 -02:00
leandrotoledo
206802cf4d Minor fix on docs 2015-11-10 20:33:14 -02:00
Jannes Höke
dd498ded00 Update to version 2.9.1 2015-11-10 20:22:58 +01:00
Leandro Toledo
c6533a2d69 Releasing v2.9 2015-11-10 12:21:04 -02:00
Leandro Toledo
688d6af541 Releasing v2.8.7 2015-10-08 11:31:48 -03:00
Leandro Toledo
f2b0cb46a2 Releasing v2.8.6 2015-10-08 10:23:12 -03:00
Leandro Toledo
5738dc553f Releasing v2.8.5 2015-09-24 09:29:23 -03:00
Leandro Toledo
75e338d5df Releasing v2.8.4 2015-09-20 12:52:40 -03:00
Leandro Toledo
a1f35355f6 Keep bleeding edge features on testing branch 2015-09-20 12:43:32 -03:00
Leandro Toledo
f623db06ea Revert "Feature/requests" 2015-09-16 00:21:45 -03:00
Leandro Toledo
cbdeacd22d Releasing v2.8.3 2015-09-10 21:00:05 -03:00
leandrotoledo
7f790c3cb2 Releasing v2.8.2 2015-09-04 23:23:41 -03:00
leandrotoledo
82f1d18f4b Releasing v2.8.1 2015-09-04 19:00:54 -03:00
leandrotoledo
bb84113272 Releasing 2.8 2015-09-04 18:19:05 -03:00
Leandro Toledo
a86fc6c2ac Improving the design of existing Telegram classes 2015-08-28 17:45:44 -03:00
Leandro Toledo
0f924508f7 Fix tests and minor changes 2015-08-28 13:02:02 -03:00
Leandro Toledo
d4870148c7 Add telegram.voice to docs and minor docstring fixes #39 2015-08-17 11:40:21 -03:00
Leandro Toledo
e1fd65048a Adding docs 2015-08-11 16:17:38 -03:00