Commit graph

222 commits

Author SHA1 Message Date
Noam Meltzer
c758c19ef4
bot.py: Remove an inaccurate note from docstring 2018-05-05 00:22:23 +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
Igor Strebezhev
5ff34fc0ba Fix send_sticker() timeout=20 (#1088)
Documentation was correct. Code wasn't.
2018-05-01 22:48:31 +03: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
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
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
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
Jacob Bom
2ca7ff82ef Update headers to 2018 (#962)
Also add two missing headers.
[ci skip]
2018-01-04 17:16:06 +02: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
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
Yii Kuo Chong
e39b6abe61 Small documentation fix (#815)
Fixes #799
2017-09-07 22:55:06 +03: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
Noam Meltzer
e018445513 Documentation update to PEP (#797) 2017-09-01 08:43:08 +02: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
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
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
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
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
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
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
0afe83ac30 Merge branch 'master' into official-test 2017-06-20 21:42:33 +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
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
Jeff
4247dc0e21 tiny changes upon PR review 2017-06-08 09:47:19 +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
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
a5bfc52326 videonote: Semantic fix according to CR 2017-05-26 18:36:21 +03:00
Jacob Bom
a7044562af Fix stuff as per @tsnoam's comments 2017-05-25 14:16:53 +02: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
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
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
2746ab77e5 Add sendVideoNote to Bot 2017-05-20 19:35:55 +02:00
Jacob Bom
76db279624 We have to send and array... that's new... 2017-05-20 18:46:39 +02:00