1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00
Commit Graph

273 Commits

Author SHA1 Message Date
Alexander
0a2216a22b Bot API 5.0 pinning-unpinning logic update
+ add unpin_all_chat_messages() (former unpin_chat_message())
* update unpin_chat_message() (add message_id arg)
2020-11-29 14:47:53 +03:00
Badiboy
5824d47590 added only_if_banned to unban_chat_member 2020-11-18 02:22:52 +03:00
Badiboy
bd27645965 set_webhook bugfinx
set_webhook does not reset allowed_updates for empty list (to default)
2020-11-11 00:32:34 +03:00
Badiboy
03e1aef70e long_polling_timeout update 1 2020-11-07 14:02:11 +03:00
Badiboy
7a3fd30f6a Long polling updates and combo content types 2020-11-07 12:52:51 +03:00
Badiboy
bab9b4077d Bot API support checked/updated up to 4.2 2020-08-25 18:18:51 +03:00
Badiboy
513a85cad9 Merge remote-tracking branch 'upstream/master' 2020-08-24 13:00:30 +03:00
Florent Gallaire
5e19965b0c Fix 'NoneType' object assignment error from #892 and #954 2020-08-22 16:11:52 +02:00
Badiboy
17f48916ad Merge remote-tracking branch 'upstream/master' 2020-08-21 17:40:56 +03:00
Badiboy
73487f96c4 Custom exception handler for poll mode
Initial beta of custom exception handler for poll mode.

Use ExceptionHandler class and bot.exception_handler to proceed unhandled exceptions in poll mode.
2020-08-21 17:36:08 +03:00
rf0x1d
cab33ad0d9 fixed thumb processing 2020-08-21 14:09:38 +03:00
rf0x1d
8b50dc488b added missing thumb params and more 2020-08-21 11:09:43 +03:00
Mr. Dog
ce6a21cd09
Merge branch 'master' into patch-4 2020-08-04 19:49:55 +05:00
Badiboy
a5fd407eb6 Bugfix and DISABLE_KEYLEN_ERROR
Bugfix and DISABLE_KEYLEN_ERROR to supress keyboard length errors.
2020-08-04 12:29:56 +03:00
Mr. Dog
1bb98483c2
Update apihelper.py 2020-08-04 05:34:13 +05:00
Mr. Dog
c17a2379ba
Exceptions classes redesign followup 2020-08-03 06:39:12 +05:00
mrpes
97aa9637cb
Update apihelper.py 2020-07-31 10:45:58 +05:00
mrpes
67536d4eec
Fixing backward compatibility issue
Just realized that renaming ApiException to BaseApiException will cause backward compatibility issue
2020-07-31 03:30:03 +05:00
mrpes
a14424704e
Exception classes redesign
Replacing 1 exception class with 3 more specific classes: 
HTTP Exception (server returned http code != 200), 
Invalid JSON Exception (server returned invalid json),
Telegram Expection (telegram returned ok != true)

All 3 classes extend BaseApiException so we can handle all API exceptions at the same time
2020-07-31 03:10:34 +05:00
mrpes
0ac64469b0
Retry on requests error
Added RETRY_ON_ERROR var. If its value is true, we'll try to get proper result MAX_RETRIES times, with RETRY_TIMEOUT delay between requests. Last request will be called outside of the try block, so it will throw an exception on failure

P.S.
I'm actually not sure if there are better ways to solve this problem, but this was my way of solving it
2020-07-30 09:34:51 +05:00
Badiboy
ce3c91b619
Merge pull request #919 from Badiboy/master
Minor updates in code
2020-07-21 01:27:32 +03:00
Badiboy
dbe9ce49df Minor updates in code 2020-07-21 01:20:01 +03:00
Aragroth
7c94eee3a2
Update apihelper.py 2020-07-11 20:09:48 +03:00
Aragroth
f4d978cd98
Update apihelper.py 2020-07-02 17:51:34 +03:00
Aragroth
f83f69ed50
Update apihelper.py 2020-07-02 17:50:14 +03:00
Aragroth
4afde9f557
Update apihelper.py 2020-07-02 17:46:41 +03:00
Kwisatz Haderach
99de5490a0
Added thumb parameter to send_video 2020-06-23 20:17:21 +02:00
Kwisatz Haderach
4f4c0891d9
Added thumb support to send_audio 2020-06-23 20:10:12 +02:00
Badiboy
5facf7de92
Merge pull request #808 from pikss86/master
Add possibility to create and use custom session, for examle - torpy
2020-05-29 12:17:58 +03:00
Badiboy
32dc03ec44 send_chat_permissions fix 2020-05-20 11:57:41 +03:00
Badiboy
2368421332 Correct processing of bool parameters. Some timeouts added. 2020-05-16 17:34:56 +03:00
Anthony Byuraev
a60253bf60 UPG: Add ChatPermissions, set_chat_permissions 2020-05-11 16:38:09 +03:00
Anthony Byuraev
a80927baf9 UPG: add setChatAdministratorCustomTitle 2020-05-09 23:23:08 +03:00
Badiboy
2849e67029 Fix to_dic->to_dict refactoring 2020-05-09 00:51:18 +03:00
Anthony Byuraev
a56fb8cc54 UPG: Add BotCommand, setMyCommands 2020-05-08 21:06:39 +03:00
Badiboy
e2d70da694 Fix poll options serialization 2020-05-02 13:27:39 +03:00
Badiboy
6e1cf24946 send_poll revised to standart signature 2020-05-02 13:09:52 +03:00
dr_forse
99c63e9eba add emoji field for dice 2020-04-27 06:30:05 +01:00
Badiboy
bb4f6a7190 Polls are updated to the latest API state.
Polls are updated to the latest API state.

Minor code refactoring.
2020-04-25 22:22:08 +03:00
Pavel Ermolaev
197dd2a582 add requests session for use torpy 2020-04-24 23:30:10 +05:00
no_ideaw
b1b2726ef6
Update apihelper.py
added can_invite_users parameter to restrict_chat_member function
2020-04-24 00:21:05 +04:30
dr_forse
51b1fb7695 added Dice and send_dice 2020-04-15 06:10:05 +01:00
Badiboy
ec86182f62 Possibility to use alternative serializer
With apihelper.CUSTOM_SERIALIZER you can replace pickle with other "dumper" like dill.
2020-04-11 13:42:34 +03:00
bedilbek
932ac9477b Add ENABLE_MIDDLEWARE=False in apihelpers to keep backward compatibility 2020-04-11 13:02:50 +05:00
Badiboy
59810b5e2a
Merge pull request #620 from nev3rfail/send_animation
Added reduced version of sendAnimation (no width/height/thumb).
2020-01-03 17:12:29 +03:00
Badiboy
2efb33fc29
Merge branch 'master' into patch-1 2020-01-03 16:45:43 +03:00
Badiboy
e3b126807e
Merge pull request #713 from dtalkachou/patch-1
Correct work with empty base_url in make_request
2020-01-03 01:33:27 +03:00
Badiboy
86644c05f7
Merge pull request #539 from Badiboy/master
"timeout" parameter for send_message
Fix kick_chat_member return type
HTML symbols not replaced
2020-01-03 00:50:24 +03:00
Dzianis Talkachou
68db599790
Delete duplicate string 2019-11-23 21:25:29 +03:00
Dmitry Sokolov
a749acde15
Update apihelper.py #2
Merge Fixes # 684
2019-11-05 17:37:53 +03:00
FrankWang
575fb9da7f
Merge branch 'master' into patch-1 2019-10-30 21:24:43 +08:00
Innokentiy Min
1a30a9a249 Fixed #578 2019-10-30 14:02:00 +03:00
Dmitry Sokolov
6fb9e18385
Update apihelper.py
Hi, to indicate a third-party api-url (reverse proxy) added conditions.
Perhaps not the most elegant solution, but this functionality is very lacking.


apihelper.API_URL = "http://reverseproxy.example.com/bot{0}/{1}"
2019-08-12 17:09:52 +03:00
Tiger 1
9624b45314 add Poll, sendPoll, stopPoll 2019-06-06 21:47:08 +03:00
Victor Koropetskyi
1a58731fb7 Add 'method' parameter to methods that edit message 2019-02-23 16:15:20 +02:00
Artem M
99df992a66 Added the method sendAnimation, which can be used instead of sendDocument to send animations, specifying their duration. 2019-02-15 18:46:18 +00:00
Badiboy
ad4be5c0ae Merge branch 'master' of https://github.com/eternnoir/pyTelegramBotAPI 2018-10-19 13:40:14 +03:00
Ramzan Bekbulatov
8636b282d7
Merge branch 'master' into analyzer-fixes 2018-09-07 18:07:37 +03:00
uburuntu
bab9f7bbb9 enh: reset requests.Session feature
Need for proxy changing and other reconnection stuff
2018-09-06 12:48:08 +03:00
uburuntu
feec1dde56 fix: little style fixes 2018-08-17 12:49:37 +03:00
uburuntu
cf69a06ab8 enh: make code better and enhance test case 2018-08-10 16:48:09 +03:00
uburuntu
8ac6e664c5 new: InputMediaAnimation, InputMediaAudio, InputMediaDocument, editMessageMedia
Added support for editing the media content of messages: added the method editMessageMedia and new types InputMediaAnimation, InputMediaAudio, and InputMediaDocument.
2018-08-09 19:16:38 +03:00
Badiboy
27d442fabf timeout for send_message
Add optional "timeout" parameter to send_message (the same as exists in all other send_*).

Equal rights for all send functions! :)
2018-07-24 00:33:13 +03:00
eternnoir
8f55460924 Fix cache time is zero. 2018-04-26 09:53:55 +08:00
khabibr
99ff104a3f
Update apihelper.py
Correct files downloading when proxy used.
2018-04-24 16:48:39 +06:00
Benny
5dd88f8223
fix issue #403: UnicodeEncodeError when sending a non-ASCII file in Python 2.7 2018-04-18 15:00:05 +08:00
sviat9440
e761e1e1d9
Update apihelper.py 2018-03-25 14:54:28 +03:00
sviat9440
ff3cbaf45b
Update apihelper.py 2018-03-25 13:21:55 +03:00
heyyyoyy
518c49f23a fixing formatting of caption in the method send_document 2018-02-16 18:29:29 +03:00
heyyyoyy
903b1dfd50 added parse_mode in edit_message_caption 2018-02-16 14:19:35 +00:00
heyyyoyy
2e199a5684 Bot Api 3.6 2018-02-14 20:27:55 +00:00
heyyyoyy
2637e29dbe Updated sendMediaGroup method 2018-01-15 16:08:50 +03:00
JekaFST
8aa8fa5986
Fix for SendLocation with live period
Fix for payload['live_perion'] typo -> payload['live_period']
2017-12-05 00:21:05 +03:00
eternnoir
b2f376a906 Remove debug message. Add content_type 2017-11-30 23:34:07 +08:00
eternnoir
2493b200a4 Add provider_data to sendInvoice. 2017-11-29 13:53:39 +08:00
eternnoir
e1a3ccadb7 Add sendMediaGroup method. 2017-11-29 13:45:25 +08:00
eternnoir
46c803bf55 Fix shipping_options bug. #414
Update version.
2017-11-13 10:14:10 +08:00
Evgeny Petrov
5f8d99664e Bot API 3.4: new methods for live locations, new objects. 2017-10-22 19:50:51 +03:00
eternnoir
dcddedcd24 Fix file dic. 2017-08-06 15:35:43 +08:00
eternnoir
2e743b4b86 Add v3.2 method. 2017-08-06 15:22:23 +08:00
eternnoir
af70313721 New method for v3.2 2017-08-06 14:25:25 +08:00
the31k
96569cbdac Fix typo 2017-07-19 15:44:10 +03:00
the31k
feec19b7f4 Use per-thread requests sessions
Reason is requests.Session is not thread-safe
See: https://github.com/requests/requests/issues/2766
2017-07-19 01:50:12 +03:00
eternnoir
4979589faf Fix not require args. #369 2017-07-02 21:08:36 +08:00
eternnoir
5f8ed347a1 Add missing arg until_date for kickChatMember. 2017-07-01 11:11:25 +08:00
eternnoir
514880fe22 Merge remote-tracking branch 'origin/proxySupport' 2017-07-01 11:06:05 +08:00
Evgeny Petrov
662a834138 Added missing arguments to restrict_chat_member method 2017-06-30 20:16:51 +03:00
Evgeny Petrov
25a37db2bb Bot API v3.1 2017-06-30 19:47:09 +03:00
eternnoir
6af3067a12 Add proxy to readme. 2017-06-28 17:44:07 +08:00
Ihor Polyakov
3713b093b6 json.dumps(allowed_updates) before sending request 2017-06-22 10:35:13 +07:00
eternnoir
a8e60b28e0 Fix requirement params. 2017-05-25 11:14:08 +08:00
eternnoir
cf287af549 Add payment method. PEP8. Refactor. 2017-05-25 10:56:58 +08:00
Kylmakalle
3a10c90799 Payments methods 2017-05-24 01:23:52 +03:00
eternnoir
5ed333492b All payment type done. 2017-05-21 21:45:12 +08:00
Kylmakalle
443d81d4db FIX: Can't edit file bytes 2017-05-19 18:08:07 +03:00
Kylmakalle
6cda8d052c VideoNote support
Send and recieve round video messages.
Support for send_video_note metod and video_note content type.
2017-05-19 17:19:15 +03:00
Kylmakalle
f7cfb98b60 Added option to delete messages.
Added option to delete messages.

Some bots do not support this method now, waiting for an official api
release.
2017-05-07 17:37:03 +03:00
Ihor Polyakov
662c69e09c RecursionError fix during sending files 2017-04-02 14:56:53 +07:00
Alex Kuznitsin
f7fc538bd8 Non-ASCII chars for filename. Telegram doesn't accept rfc2231 styled filename. Using utf-8 directly. 2017-01-30 17:40:18 +03:00
Nicholas Guriev
9fe8565d53 Use session to ensure persistent connection to api.telegram.org 2016-12-17 09:03:00 +03:00
eternnoir
a06551daaf Add delete webhook. 2016-12-06 11:52:16 +08:00
eternnoir
eadff07f79 Add allowed_updates to get_updates. 2016-12-06 11:44:30 +08:00
eternnoir
b5e27d0fea Add max_connections and allowed_updates to set_webhook. 2016-12-06 11:42:15 +08:00
Evgeny Petrov
c99bb16619 Updated set_game_score
• New field `force`
• Changed `edit_message` to `disable_edit_message`
2016-11-21 09:28:32 +03:00
Evgeny Petrov
856af72599 Added cache_time to answer_callback_query 2016-11-21 09:19:59 +03:00
Evgeny Petrov
6f8ebbae89 Added setGameScore and getGameHighScores
1. https://core.telegram.org/bots/api#setgamescore
2. https://core.telegram.org/bots/api#getgamehighscores
2016-10-26 16:19:04 +03:00
eternnoir
d1498979d4 Merge branch 'JrooTJunior-master' into feature-20161003update 2016-10-20 20:09:07 +08:00
Alex Root Junior
702763edd6 Get webhook info
https://core.telegram.org/bots/api#getwebhookinfo
2016-10-20 10:52:38 +03:00
Evgeny Petrov
7e94810ece Added Caption field to sendAudio & sendVoice 2016-10-11 22:51:20 +03:00
eternnoir
740d7f44cf Add url param in answer inline query. 2016-10-08 21:55:28 +08:00
eternnoir
b8e5c43598 Add send game method. 2016-10-08 20:36:48 +08:00
eternnoir
d2e7f4d8f2 Add 2.1 new method. 2016-06-07 19:00:44 +08:00
eternnoir
ce24aa25f2 Fix #179. 2016-06-02 13:25:50 +08:00
Diego Muñoz Callejo
3413669a23 Added optional connection (aka sending) timeouts to methods that may upload big chunks of data: send_audio, send_voice, send_document, send_sticker and send_video. 2016-05-22 18:35:20 +02:00
eternnoir
84257b6ba9 Fix typo. 2016-04-23 01:21:45 +08:00
eternnoir
16d4c64b00 Remove duplicated method. 2016-04-19 08:13:37 +08:00
eternnoir
e913635755 fix next_offset is empty will not set bug. 2016-04-17 23:28:47 +08:00
eternnoir
7490f63f25 Add send_contact 2016-04-16 15:07:52 +08:00
eternnoir
22ab50989e Add answer_callback_query. 2016-04-16 14:53:41 +08:00
eternnoir
228683aeda Add new param for anser inline query. 2016-04-14 15:32:08 +08:00
eternnoir
4fe4061a0f All Updating messages methods done. 2016-04-14 15:17:53 +08:00
eternnoir
f873658aac Fix edit message error. 2016-04-14 15:06:46 +08:00
eternnoir
13327c371a Add editMessageText. 2016-04-14 15:03:07 +08:00
eternnoir
4dc7af71a0 Add bot2.0 new methods. 2016-04-14 14:48:26 +08:00
eternnoir
209764a5d7 Add connect timeout. Fix #108 2016-04-14 14:34:37 +08:00
eternnoir
c1247249c7 Add send venu method. 2016-04-14 13:55:28 +08:00
eternnoir
292191038f Add disable_notification 2016-02-27 11:17:35 +08:00
Igor Starikov
e851f37712 answer_inline_query made POST
The default GET produces `414 Request-URI Too Large` response.
2016-02-14 00:08:37 +05:00
eternnoir
94f1bbd402 Almost done. 2016-01-05 14:07:47 +08:00
ivan tkachenko
413f081b19 style unification for method_url in apihelper.py. 2015-11-08 10:30:09 +08:00
Pieter
1e6361dd57 Fix #83
Added a `encode('utf8')` statement to support non-ASCII symbols in error log messages.
2015-10-06 22:36:57 +02:00
pieter
941b8ac5d0 Added webhooks support with set_webhook and remove_webhook in the TeleBot class 2015-09-30 18:19:31 +02:00
pieter
1038d4fafa Added download_file 2015-09-18 20:53:10 +02:00
pieter
fd1f16598b Added File & getFile, including testing 2015-09-18 20:31:29 +02:00
eternnoir
e7b4e95fbc Merge remote-tracking branch 'origin/master' into develop 2015-09-09 09:34:13 +08:00
pieter
99f6829ede Fix failing test case in Py2.6 because of using {} instead of {0..9} 2015-09-08 22:34:55 +02:00
pieter
89288b166e Implement parse_mode 2015-09-08 21:51:45 +02:00
pieter
710fc273d6 Better log messages 2015-09-08 19:47:55 +02:00
pieter
3c8faa155f Created util.py to clean up __init__.py and apihelper.py and updated README accordingly
Fixed failing send_document_by_id and send_photo_by_id
2015-08-31 11:49:03 +02:00
97Pedrito
596df2ef2c Extended error descriptions
They should provide more information about the origin of the failure.
2015-08-19 21:30:44 +02:00
eternnoir
c3300af656 New audio,voice supported. 2015-08-19 18:08:01 +08:00
eternnoir
821a63e3a7 Support new sendVideo API method. 2015-08-01 10:12:15 +08:00
pieter
20e3f731f7 Added split_string to apihelper.py
Added a warning to send_message to not exceed 5000 characters per message.
Changed send_message to use HTTP POST instead of GET, to stretch the maximum character limit a little more.
2015-07-25 21:31:58 +02:00
pieter
b468e8c943 Moved extract_command and is_command to apihelper.py. 2015-07-24 13:09:27 +02:00
eternnoir
99b82b6219 Add logger. 2015-07-20 09:56:17 +08:00
eternnoir
621b191e8d Fix python3 can not send file by string bug.
bug #40
2015-07-17 09:38:28 +08:00
eternnoir
c1bb900d91 send file, photo ...etc. by ID support. #35 2015-07-14 13:24:32 +08:00
pieter
111ebf5c16 Extended the message_handler decorator.
TeleBot now makes use of the API's getUpdates timeout optional parameter instead of time.sleep. This yields quicker response times.
2015-07-02 22:32:18 +02:00
pieter
86500fc9fa Added some documentation. 2015-07-02 13:43:49 +02:00
pieter
13133ac5c6 Implemented command decorator. 2015-07-02 04:17:36 +02:00