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

680 Commits

Author SHA1 Message Date
Badiboy
fdf2838669 Minor update to copyMessage 2021-01-19 01:27:39 +03:00
Badiboy
74fb8258b6
Merge pull request #1067 from Aazerra/copyMessage_method
Added copyMessage method
2021-01-19 01:16:09 +03:00
Badiboy
003a92f466
Merge pull request #1080 from Badiboy/master
Release v.3.7.6
2021-01-18 01:02:45 +03:00
Badiboy
d57aa04bfb Release v.3.7.6 2021-01-18 01:02:19 +03:00
Robin Modisch
3109e35bb4
show bot id 2021-01-17 01:26:38 +01:00
Robin Modisch
ea51b1e95e
hide token from debug logs
prevent leaks of the bot token by hiding it from the log
2021-01-17 01:06:47 +01:00
Badiboy
ec8714ad3a Short live sessions u1 2021-01-17 00:43:52 +03:00
Badiboy
bc54a5379c Added short live sessions 2021-01-16 23:50:25 +03:00
Badiboy
e9ba2fd8bb Polling timeout fix 2021-01-16 02:14:29 +03:00
Badiboy
2e5250ec98 Version update to previous commit 2021-01-14 15:48:30 +03:00
Badiboy
f56da17741 Fix restrict_chat_member until_date bug 2021-01-14 15:45:47 +03:00
Badiboy
82838e1d26 Infinity polling fall down fixed 2021-01-14 03:44:37 +03:00
Alireza
b561e35330
Update __init__.py 2021-01-12 11:19:57 +03:30
Alireza
b684c4f60d Fix Things on copyMessage 2021-01-12 11:17:53 +03:30
Alireza
58281f0a10 Added copyMessage method 2021-01-11 02:50:17 +03:30
Badiboy
52ebb5a1a7 drop_pending_updates in set_webhook 2021-01-09 21:22:49 +03:00
Badiboy
0900acfae9 Release version 3.7.5 2021-01-07 20:46:50 +03:00
Badiboy
c6cf615722
Merge pull request #1062 from Badiboy/master
Added timeout to xxx_webhook
2021-01-07 02:38:26 +03:00
Badiboy
5dc008a762 Added timeout to xxx_webhook 2021-01-07 00:13:44 +03:00
Taras
6b0484b9db
Modify RedisHandlerBackend, add argument "password=None" to __init__()
With argument "password=None" in method __init__(), and argument "password" in "self.redis = Redis(host, port, db, password)", will be able to use Redis with password protection, if password is set .
2021-01-05 13:06:14 +02:00
Badiboy
6559f431b7 Bot API update
Bot API conformance up to 4.4

Added webhook parameters from 5.0
2020-12-29 19:24:41 +03:00
Badiboy
c4e624d999 Avoid dead threads in treaded polling 2020-12-24 23:55:12 +03:00
Badiboy
2534dc5925 Exception if middleware is used but not enabled. 2020-12-24 19:55:24 +03:00
Mikhail Krostelev
96686e5221 fix restrict_chat_member method 2020-12-22 21:38:38 +03:00
Badiboy
4658d2b8da Fix unban_chat_member in async 2020-12-16 01:57:30 +03:00
Badiboy
65c3ca58da Update __init__.py
Allow parse_mode = "" to disable default parse mode.
2020-12-09 01:41:07 +03:00
Badiboy
6cc80f25d7 Bot API 5.0 pinning-unpinning logic post-fix. 2020-11-29 15:33:39 +03:00
Alexander
b9898bbdda Fix 0a2216a22b #2
+ message_id arg of unpin_chat_message() passing to the helper
- removed passing arg to unpin_all_chat_messages()
2020-11-29 15:21:59 +03:00
Alexander
00c9351f83 Hotfix 0a2216a22b
* message_id made optional as API declares
2020-11-29 15:12:14 +03:00
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
640f398262 Version 3.7.4 release 2020-11-20 23:49:55 +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
00d125a298 long_polling_timeout update 3 2020-11-07 14:59:45 +03:00
Badiboy
a548374a4d long_polling_timeout update 2 2020-11-07 14:43:17 +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
fa3ca84d24 Animation content_type
"When you send gif telegram gives you animation and document at same time in update and when you parse that first if is animation and second is document because of this the content_type set document not animation"
2020-11-03 17:46:19 +03:00
andvch
36a3ce62c4
Fix broken text_mention html formatting 2020-10-14 12:06:49 +03:00
Badiboy
00c2e9b51c Piece death fix 2020-09-22 01:41:51 +03:00
Badiboy
29711e2425 Merge remote-tracking branch 'upstream/master' 2020-09-22 01:34:55 +03:00
Badiboy
75a5dd1492 Minor bugfix 2020-09-22 01:34:49 +03:00
meoww-bot
9ab906e60c
fix: simplify code
json.loads(button.to_json()) equals to button.to_dict()
2020-09-02 18:09:14 +08:00
meoww-bot
a803edd09b
fix: button in markup should be obj, not json text 2020-09-02 09:25:23 +08:00
meoww-bot
32a9e65ecc
fix: reply_markup does not change content_type 2020-09-02 09:12:49 +08:00
meoww-bot
decad450d0
feat: make InlineKeyboardMarkup JsonDeserializable
feat: make InlineKeyboardMarkup JsonDeserializable, add de_json func to InlineKeyboardMarkup object
2020-09-01 18:13:22 +08:00
meoww-bot
630a9a5b2c
feat: make InlineKeyboardButton JsonDeserializable
feat: make InlineKeyboardButton JsonDeserializable, add de_json func to InlineKeyboardButton Object
2020-09-01 18:07:45 +08:00
meoww-bot
cdae65116b
feat: make LoginUrl JsonDeserializable
feat: make LoginUrl JsonDeserializable, add de_json func
2020-09-01 18:03:21 +08:00
meoww-bot
6832c33733 feat: Added the field reply_markup to the Message
Added the field `reply_markup` to the Message object
2020-08-31 12:00:56 +00:00
Artem Frantsiian
81100f249c
Fix an error with the is_pil_image function
When I've tried to send_photo as shown in detailed_example, I got an error: "AttributeError: module 'PIL' has no attribute 'Image'". 
This error was described well here: https://stackoverflow.com/a/11911536/9092263. So in accordance to prescriptions, I've made changes and It works fine for me.

Steps to reproduce:
1. initiate bot via TeleBot constructor
2. call function bot.send_photo(call.message.chat.id, open("some_image.jpg", "rb"))

P.S.
Error Environment: 
- python==3.8.5
- pyTelegramBotAPI==3.7.3
- PIL==7.2.0
2020-08-29 21:57:41 +03:00
meoww-bot
e811163b5f
UPG: Added the field file_unique_id
Added the field file_unique_id to the objects Animation, Audio, Document, PassportFile, PhotoSize, Sticker, Video, VideoNote, Voice, File and the fields small_file_unique_id and big_file_unique_id to the object ChatPhoto. (Bot API 4.5)
2020-08-29 04:29:02 +08:00
Badiboy
2bc5c1a500
Merge pull request #960 from CrafterKolyan/patch-1
Add last_update_id parameter for constructor
2020-08-25 21:58:33 +03:00
Nikolay Korolev
5120650774
Move parameter to the end of list 2020-08-25 21:45:30 +03:00
Nikolay Korolev
c13f9a7f98
Add last_update_id parameter for constructor 2020-08-25 21:26:28 +03:00
Badiboy
bab9b4077d Bot API support checked/updated up to 4.2 2020-08-25 18:18:51 +03:00
Badiboy
cdd48c7aed Empty list optimization, Py2 arteacts removed,
Empty list optimization: None instead of [].

Py2 arteacts removed: no more six moudle used.
2020-08-24 16:02:35 +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
5b70980bda Resolve conflicts 2020-08-21 17:38:54 +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
9ca3c78c84 back version to 3.7.2 2020-08-21 11:22:24 +03:00
rf0x1d
0ab4046a4f Create version.py 2020-08-21 11:09:53 +03:00
rf0x1d
8b50dc488b added missing thumb params and more 2020-08-21 11:09:43 +03:00
Badiboy
18eb8eb605 Two None checks 2020-08-19 23:57:48 +03:00
Mr. Dog
ec79d1dc1e
Keyboard bugfix 2020-08-04 23:45:33 +05:00
Badiboy
c6f51f6c55 CopyPaste bugfix 2020-08-04 18:28:35 +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
Badiboy
cc36207992 Minor keyboard update followup 2020-08-02 18:58:22 +03:00
Mr. Dog
1ba093cb02
Change logger level to warning 2020-08-02 20:30:58 +05:00
Mr. Dog
4e5fb59fc0
Replace exceptions with warnings
Also further PIL support added
2020-08-02 20:20:33 +05:00
mrpes
317a490cf0
Type checking moved to utils 2020-08-01 01:30:38 +05:00
mrpes
5823ca5613
Minor keyboard code redesign 2020-08-01 01:28:56 +05:00
mrpes
97aa9637cb
Update apihelper.py 2020-07-31 10:45:58 +05:00
mrpes
0ab908705b
Support for PIL images as photo argument
Added autoconversion of PIL image to file-like object. PIL module is optional
2020-07-31 10:39:04 +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
EskiSlav
c533a52e39 Restored necessary comment 2020-07-18 00:25:00 +03:00
EskiSlav
b50eb1bafb Added nested entities from Bot API 4.5 2020-07-17 13:43:45 +03:00
Badiboy
b38ceaaec8
Merge pull request #913 from Aragroth/master
Added ability to specify params of width and height for video
2020-07-11 22:30:53 +03:00
Aragroth
7c94eee3a2
Update apihelper.py 2020-07-11 20:09:48 +03:00
Purya Jafari
49398f5c61
Update types.py
Sending stickers everytime have different file_id, so for detecting special stickers we need a unique parameter.
2020-07-07 01:31:33 +04:30
daveusa31
0304e6507f Append default parse_mode 2020-07-04 21:07:42 +03:00
daveusa31
0f387db8d2 Fix tabs 2020-07-04 20:45: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
a69a358ebd
Update __init__.py 2020-07-02 17:47:38 +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
53ccef5e5e
added thumb parameter to send_video 2020-06-23 20:14:52 +02:00
Kwisatz Haderach
29b432e65a
Added thumb to send_audio 2020-06-23 20:12:46 +02:00
Kwisatz Haderach
4f4c0891d9
Added thumb support to send_audio 2020-06-23 20:10:12 +02:00
Kwisatz Haderach
44872ce87d
Complete User Class
Added following fields:
can_join_groups
can_read_all_group_messages
supports_inline_queries
2020-06-22 13:18:13 +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
oleg
592dcbfedf Add PollAnswer type;
Add poll_answer_handler
2020-05-18 12:05:30 +05:00
oleg
03b02561a5 Add request_poll attribute to KeyboardButton;
Add KeyboardButtonPollType object
2020-05-18 11:48:54 +05:00
Badiboy
2368421332 Correct processing of bool parameters. Some timeouts added. 2020-05-16 17:34:56 +03:00
dr_forse
75a018e18b add PollAnswer, poll_answer_handler; make User Serializable and Dictionaryble; some pep fixes 2020-05-12 01:09:34 +01:00
Anthony Byuraev
ee00d0458d Fix some bugs 2020-05-11 22:26:03 +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
Anthony Byuraev
8be9bcc8ed UPG: Add custom_title, slow_mode_delay 2020-05-09 20:28:29 +03:00
Anthony Byuraev
1824637617 UPG: Refactoring InlineKeyboardMarkup 2020-05-09 20:06:33 +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
Badiboy
ef81868ebc Fix Deprecation warning due to invalid escape sequences 2020-05-01 11:25:51 +03:00
bedilbek
24deb8a51d Change class from new-style class to object class 2020-04-28 00:34:52 +05:00
bedilbek
601b570b85 Fix python2.7 compatibility for class inheritance 2020-04-28 00:22:05 +05:00
bedilbek
bcc3a1afb4 Remove Type Hinting 2020-04-27 23:43:39 +05: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
Badiboy
aac9ce45a3 Merge remote-tracking branch 'upstream/master' 2020-04-24 18:19:55 +03:00
Badiboy
24e984adf8 Minor code refactoring (naming) 2020-04-24 18:19:30 +03:00
Badiboy
1ed3bc2a53
Merge pull request #803 from noideaw/patch-2
added can_invite_users parameter to restrict_chat_member function param description
2020-04-24 18:16:25 +03:00
no_ideaw
8c7c7b31b2
Update __init__.py
added can_invite_users parameter to restrict_chat_member function
2020-04-24 19:38:23 +04:30
no_ideaw
b1b2726ef6
Update apihelper.py
added can_invite_users parameter to restrict_chat_member function
2020-04-24 00:21:05 +04:30
no_ideaw
da924dbaeb
Update __init__.py
added can_invite_users parameter to restrict_chat_member function
2020-04-23 23:59:04 +04:30
bedilbek
aab560b4ee Fix all the time invocations on typed_middleware handlers even if update did not have that update_type message 2020-04-20 11:30:03 +05:00
Badiboy
646bbb8330
Merge pull request #794 from drforse/master
Add Dice and send_dice
2020-04-16 15:56:46 +03:00
dr_forse
51b1fb7695 added Dice and send_dice 2020-04-15 06:10:05 +01:00
bedilbek
3aec66bc0d Remove class static variable 2020-04-15 01:11:43 +05:00
bedilbek
003c5db37f Add filename checking 2020-04-15 01:11:43 +05:00
bedilbek
286188f380 Add Step/Reply Handler Backend Mechanism
Implement Memory, File, Redis Backends
2020-04-15 01:11:43 +05:00
Badiboy
dab80d421b Refactoring update 2 2020-04-11 17:38:47 +03:00
Badiboy
247fe6e947 Refactoring bugfix 2020-04-11 17:06:14 +03:00
Badiboy
995814d846 Refactoring and API conformance
Refactoring.

new_chat_member is out of support.

Bugfix in html_text.

Started Bot API conformance checking.
2020-04-11 16:54:25 +03: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
bedilbek
1e242f2263 Add Middleware support 2020-04-08 23:13:19 +05:00
Alexander Tkachev
d2f9c51a5a Handle Poll update 2020-03-09 17:25:54 +07:00
Alexander Tkachev
12547efa08 Fix order for consistency in process_new_updates 2020-03-09 17:25:37 +07:00
Quantum
dfac26706e
Add is_anonymous flag to Poll type 2020-02-07 12:53:31 +03:00
Badiboy
aa02ddb573 TAB fix
TAB fix
2020-01-08 20:17:25 +03:00
Badiboy
760ea5a2f0 Design updates from #711
Significant design updated from
https://github.com/eternnoir/pyTelegramBotAPI/pull/711
2020-01-08 20:06:40 +03:00
Badiboy
7adec8bd90
Merge pull request #673 from TahaPY/master
Added Animation and is_animated for stickers
2020-01-03 17:51:53 +03:00
Badiboy
0603a0df4c
Update types.py
Animation is moved before document to save backward compatibility. content_type = 'document' should override content_type = 'animation' to save previous behaviour.
2020-01-03 17:51:05 +03: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