Compare commits

...

1784 Commits

Author SHA1 Message Date
_run e10517e088
Merge pull request #2017 from Artin-GH/patch-1
Fix backslash (\) issue in escape_markdown
2023-07-30 23:19:57 +05:00
Artin GH 1946393c36
Fix backslash (\) issue in escape_markdown 2023-07-14 16:39:50 +03:30
Badiboy 0f52ca688f
Merge pull request #2015 from Badiboy/master
Fix aioredis version check for regular redis
2023-07-14 13:00:03 +03:00
Badiboy b18bcd494a Fix aioredis version check for regular redis 2023-07-12 19:48:22 +03:00
Badiboy 8f41df0ee4
Merge pull request #2012 from Kourva/master
Update README.md
2023-07-10 19:01:09 +03:00
Kourva cb7f6a8c99
Update README.md 2023-07-10 03:05:34 +03:30
_run 3960115ec7
Merge pull request #2009 from coder2020official/fileupload
Fixes #1944: uploading file from memory
2023-07-09 00:06:02 +05:00
_run 916569cdc5
Fixes #1944: uploading file from memory 2023-07-08 23:42:47 +05:00
_run 75d3fa2eba
Merge pull request #2008 from coder2020official/middleware
Fix issue with post_process in async not receiving the error
2023-07-08 23:25:05 +05:00
_run 67e3774e8e
Fix issue with post_process in async not receiving the error 2023-07-08 23:23:23 +05:00
_run f799157314
Merge pull request #2007 from coder2020official/master
Updated all russian docstrings, currently without translation.
2023-07-08 23:15:05 +05:00
coder2020official af3a98057f Updated all russian docstrings, currently without translation. 2023-07-08 23:10:41 +05:00
_run 447fc1d461
Merge pull request #2006 from coder2020official/master
Fixed deprecation warning for readthedocs.org
2023-07-08 23:01:57 +05:00
_run fb98df3dfe
Fixed deprecation warning for readthedocs.org 2023-07-08 22:57:13 +05:00
Badiboy 0b34da3900
Merge pull request #1996 from artemetra/master
Fix typo in docs
2023-06-18 23:19:00 +03:00
Artem Lukin 5ea1abaadd
fix typo in docs 2023-06-18 01:57:08 +02:00
Badiboy 5a81353420
Merge pull request #1991 from eternnoir/dependabot/pip/requests-2.31.0
Bump requests from 2.20.0 to 2.31.0
2023-05-28 22:27:49 +03:00
dependabot[bot] eaf90cce7f
Bump requests from 2.20.0 to 2.31.0
Bumps [requests](https://github.com/psf/requests) from 2.20.0 to 2.31.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.20.0...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-22 21:33:40 +00:00
Badiboy b219218c8d
Merge pull request #1988 from Badiboy/master
Bump version to 4.12.0
2023-05-18 18:09:13 +03:00
Badiboy 2dac17aa75 Bump version to 4.12.0 2023-05-18 18:07:09 +03:00
Badiboy 48377ac905
Merge pull request #1947 from alex75311/edit_antiflood_method
redesigned the antiflood method for guaranteed message delivery
2023-05-08 09:10:28 +03:00
Alexey Isaev 14294d1aa3 redesigned the antiflood method for guaranteed message delivery 2023-05-04 23:08:10 +03:00
_run ea3c159044
Merge pull request #1975 from engAmirEng/feature/async-func-filter
bring back the async func message_filter
2023-05-02 20:43:48 +04:00
AmirW 58d53e1a54 bring back the async func message_filter
-fixes #1974
- related commits: c84896391e f69a2ba044
2023-04-28 16:12:23 +03:30
Badiboy abec3dc60e
Merge pull request #1969 from coder2020official/botapi6.7
Bot API 6.7 - Not much to do, just minor improvements
2023-04-24 09:38:21 +03:00
coder2020official ecb5d9b4f6 Added tests for __html_text, fixed the bug, added custom_emoji for entities 2023-04-22 22:53:57 +04:00
coder2020official 26575dc5e7 Added support for launching Web Apps from inline query results by replacing the parameters switch_pm_text and switch_pm_parameter of the method answerInlineQuery with the parameter button of type InlineQueryResultsButton. 2023-04-22 20:51:08 +04:00
coder2020official be69feb252 * Added a test for message entity __html_text function. #1971 should be fixed and then todo can be done. 2023-04-22 20:38:05 +04:00
coder2020official 1d62adc262 Added the ability to get the current bot name in the given language as the class BotName using the method getMyName. 2023-04-22 18:30:46 +04:00
coder2020official 77e1928628 Added the ability to set different bot names for different user languages using the method setMyName. 2023-04-22 18:25:24 +04:00
coder2020official d6f4987197 Added the field via_chat_folder_invite_link to the class ChatMemberUpdated. 2023-04-21 22:30:32 +04:00
coder2020official 966b451869 Added the field switch_inline_query_chosen_chat of the type SwitchInlineQueryChosenChat to the class InlineKeyboardButton, which allows bots to switch to inline mode in a chosen chat of the given type. 2023-04-21 22:28:20 +04:00
coder2020official d1417e5616 Added the field web_app_name to the class WriteAccessAllowed. 2023-04-21 22:14:16 +04:00
_run a7cafd1f24
Update README.md 2023-04-21 21:27:08 +04:00
Badiboy 92907ced30
Merge pull request #1966 from Badiboy/master
Bump version to 4.11.0
2023-04-15 22:40:59 +03:00
Badiboy 1b2ed0e2f7 Bump version to 4.11.0 2023-04-15 22:39:14 +03:00
_run 370f0370c7
Merge pull request #1964 from Cub11k/add_state_list
Add state_list to StatesGroup
2023-04-15 01:53:00 +05:00
Cub11k e4bddd91cb Define state_list in __init_subclass__ 2023-04-14 22:11:08 +03:00
Cub11k d466da3542 Add state_list to StatesGroup 2023-04-14 22:00:42 +03:00
Badiboy e64c06b7bc
Merge pull request #1951 from mikelei8291/doc-fix
Fix documentation for `InlineKeyboardMarkup` and `quick_markup`
2023-04-03 19:10:10 +03:00
Badiboy 7d168ebbd8
Merge pull request #1961 from fcoagz/patch-2
Update README.md
2023-04-03 18:56:38 +03:00
Francisco Griman c5689f383b
edit 2023-04-03 11:49:21 -04:00
Francisco Griman 8796168efb
Update README.md 2023-04-03 11:27:15 -04:00
_run 100659fecd
Merge pull request #1958 from coder2020official/master
Fix storage not saving data sometimes
2023-04-03 01:01:11 +05:00
_run 7bf87a306a
Update redis_storage.py 2023-04-03 01:00:48 +05:00
_run 351d021e01
Update redis_storage.py 2023-04-03 01:00:29 +05:00
Badiboy 4ffe0f8833
Merge pull request #1952 from Badiboy/master
More changes from review of bot api 6.6
2023-03-27 23:17:24 +03:00
Badiboy 3f07dc4ce8
thumb
Co-authored-by: _run <khumogo1@gmail.com>
2023-03-26 20:04:29 +03:00
Badiboy 2e589ab6e1 Thumb type spec 2023-03-26 18:00:35 +03:00
Badiboy 8b63f6a6ef Merge branch 'master' of https://github.com/Badiboy/pyTelegramBotAPI 2023-03-26 17:41:25 +03:00
Badiboy dc98aca173 Merge remote-tracking branch 'upstream/master' 2023-03-26 17:40:55 +03:00
Badiboy 39360e0640
send_video thumbnail hint
Co-authored-by: _run <khumogo1@gmail.com>
2023-03-25 16:38:16 +03:00
Badiboy b1c172c421
send_document thumbnail hint
Co-authored-by: _run <khumogo1@gmail.com>
2023-03-25 16:38:05 +03:00
Badiboy 6b5c263ee8
send_animtion thumbnail hint
Co-authored-by: _run <khumogo1@gmail.com>
2023-03-25 16:37:46 +03:00
Badiboy 46100edd97
send_video_note thumbnail hint
Co-authored-by: _run <khumogo1@gmail.com>
2023-03-25 16:37:22 +03:00
Badiboy 018b89cdc0
send_document thumbnail
Co-authored-by: _run <khumogo1@gmail.com>
2023-03-25 16:37:03 +03:00
Badiboy f3486b3730
send_document thumbnail
Co-authored-by: _run <khumogo1@gmail.com>
2023-03-25 16:36:36 +03:00
Badiboy b0e64d828c
send_video thumbnail hint
Co-authored-by: _run <khumogo1@gmail.com>
2023-03-25 16:36:10 +03:00
Badiboy 14434b398e
send_animation thumbnail hint
Co-authored-by: _run <khumogo1@gmail.com>
2023-03-25 16:34:08 +03:00
_run 1d62bf2ac8
Merge pull request #1949 from codebyzen/master
I added CalendarIT Telegram bot (with link to bot), can post acquainted with what is happening today, tomorrow or what happened 20 years ago to channel.
2023-03-25 16:40:46 +04:00
Badiboy fe2e9a7a30 thumb_url etc. converted to properties 2023-03-25 15:22:30 +03:00
Badiboy c9ef0d71f0 Deprecation warnings equalisation 2023-03-25 15:17:29 +03:00
Badiboy b0740a920a Set "thumb" as property in types 2023-03-25 15:08:40 +03:00
Badiboy 6a9c25cf80 Fix set_sticker_set_thumb and set_sticker_set_thumbnail 2023-03-25 14:56:31 +03:00
Badiboy e56c60ac00 thumb deprecation typo and thumb->thumbnail param rename 2023-03-25 14:44:50 +03:00
Badiboy 7c7a063fb6 Fix some code hints 2023-03-25 14:38:02 +03:00
Mike Lei bd69492ed4
Fix documentation for `InlineKeyboardMarkup` and `quick_markup` 2023-03-23 18:52:40 +00:00
C̷̱̺͙͓̪͔̹͉͉̯̖̟̀͆́̽̔̈̚͠͝o̶̥̻̻̖̮͚͒̂̒͌̾̇͗͘͝d̸̢̡͈̮̦͈͙̖͔̦̭̩̰͎͉̣̰͆̈́͘͝e̸͖͆̎̏͒̀̈́͛́̍̀̀̿̚͝B̵̨̯̹̝͙͉̲̟̳̟͎̪̫̪̤̒͋̉̑̐̒̅̅̋͜y̵̞͚͕̭̤̱͖̟̫̜̓͐̏̕ͅZ̸͎̫̖͍̪̓̐͆e̶͈͇̽̔͂̉͊̈́ņ̶̣̣͎̤̯͖͉͍̳͇͈̘̳̗͚́̄̊̂̊̏̄͐͐̿̓́̽̃̄̚͝ 37cdb52ed2 Merge branch 'master' of https://github.com/eternnoir/pyTelegramBotAPI 2023-03-19 17:39:29 +03:00
C̷̱̺͙͓̪͔̹͉͉̯̖̟̀͆́̽̔̈̚͠͝o̶̥̻̻̖̮͚͒̂̒͌̾̇͗͘͝d̸̢̡͈̮̦͈͙̖͔̦̭̩̰͎͉̣̰͆̈́͘͝e̸͖͆̎̏͒̀̈́͛́̍̀̀̿̚͝B̵̨̯̹̝͙͉̲̟̳̟͎̪̫̪̤̒͋̉̑̐̒̅̅̋͜y̵̞͚͕̭̤̱͖̟̫̜̓͐̏̕ͅZ̸͎̫̖͍̪̓̐͆e̶͈͇̽̔͂̉͊̈́ņ̶̣̣͎̤̯͖͉͍̳͇͈̘̳̗͚́̄̊̂̊̏̄͐͐̿̓́̽̃̄̚͝ d8569394b0 Update README.md
I added CalendarIT Telegram bot, can post acquainted with what is happening today, tomorrow or what happened 20 years ago to channel.
2023-03-19 17:39:24 +03:00
_run da57174635
Merge pull request #1948 from coder2020official/botapi6.6
Changes from review of bot api 6.6
2023-03-19 18:25:37 +04:00
_run 776ce0a7eb
Merge pull request #1942 from arashnm80/master
add SpotSeekBot
2023-03-19 17:36:48 +04:00
coder2020official 886806135e Merge branch 'botapi6.6' of https://github.com/coder2020official/pyTelegramBotAPI into botapi6.6 2023-03-19 17:31:55 +04:00
coder2020official 1e450ebd15 Bot API 6.6 review changes 2023-03-19 17:31:53 +04:00
_run 41521f5618
Merge pull request #1937 from coder2020official/botapi6.6
I'm back: Bot API 6.6 Update
2023-03-19 13:27:52 +04:00
_run 603a7cf9f2
Update telebot/asyncio_helper.py 2023-03-15 05:48:41 +04:00
_run 535a14ca0c
Update telebot/apihelper.py 2023-03-15 05:48:16 +04:00
_run 67a52b2e98
Apply suggestions from code review 2023-03-15 05:46:03 +04:00
Arash Nemat Zadeh c47c26d2b0
Update README.md 2023-03-14 17:29:51 +03:30
coder2020official 9d2f7c02a4 Fixing tests attempt 1 2023-03-11 23:54:57 +04:00
coder2020official 991679bedc Renamed all necessary thumbs to thumbnails in types.py 2023-03-11 23:53:16 +04:00
coder2020official 3b4e6fed04 Renamed the method setStickerSetThumb to setStickerSetThumbnail and its parameter thumb to thumbnail. 2023-03-11 23:37:32 +04:00
coder2020official 5c6b867582 Renamed the field thumb in the classes Animation, Audio, Document, Sticker, Video, VideoNote, InputMediaAnimation, InputMediaAudio, InputMediaDocument, InputMediaVideo, StickerSet to thumbnail. Renamed the parameter thumb in the methods sendAnimation, sendAudio, sendDocument, sendVideo, sendVideoNote to thumbnail. 2023-03-11 23:34:17 +04:00
coder2020official 715aabaf49 Added the method setStickerMaskPosition for changing the mask position of a mask sticker. 2023-03-11 23:06:57 +04:00
coder2020official 9fa5b91e58 Added the method setStickerKeywords for changing the search keywords assigned to a sticker. 2023-03-11 22:58:41 +04:00
coder2020official de5a32e45c Fixed custom_emoji_ids and added set_sticker_emoji_list, and and fixed some typehints 2023-03-11 22:53:33 +04:00
coder2020official db087427fc Added the method deleteStickerSet for complete deletion of a given sticker set that was created by the bot. 2023-03-11 22:27:37 +04:00
coder2020official 385fc6a6da Added the method setStickerSetTitle for editing the title of sticker sets created by the bot. 2023-03-11 22:24:34 +04:00
coder2020official ac0b386625 Added the method setCustomEmojiStickerSetThumbnail for editing the thumbnail of custom emoji sticker sets created by the bot. 2023-03-11 22:19:49 +04:00
coder2020official ae44b0022d Added support for .WEBP, .TGS, and .WEBM files in uploadStickerFile by replacing the parameter png_sticker in the method uploadStickerFile with the parameters sticker and sticker_format. 2023-03-11 22:15:31 +04:00
coder2020official 73135d6012 Added support for .WEBP files in createNewStickerSet and addStickerToSet. 2023-03-11 22:03:37 +04:00
coder2020official 19dcce0d5b Added support for the creation of sticker sets with multiple initial stickers in createNewStickerSet by replacing the parameters png_sticker, tgs_sticker, webm_sticker, emojis and mask_position with the parameters stickers and sticker_format. 2023-03-11 21:59:22 +04:00
coder2020official f527fc91f6 Replaced the parameters png_sticker, tgs_sticker, webm_sticker, emojis and mask_position in the method addStickerToSet with the parameter sticker of the type InputSticker. 2023-03-11 18:18:07 +04:00
coder2020official c0185dad44 Added the field needs_repainting to the class Sticker. 2023-03-11 16:41:19 +04:00
coder2020official 8a858cac4e Added the parameter needs_repainting to the method createNewStickerSet to automatically change the color of emoji based on context (e.g., use text color in messages, accent color in statuses, etc.). 2023-03-11 16:39:04 +04:00
coder2020official f30457bd75 Added support for the creation of custom emoji sticker sets in createNewStickerSet. 2023-03-11 16:33:02 +04:00
coder2020official 54caf30f69 Added the parameter emoji to the method sendSticker to specify an emoji for just uploaded stickers. 2023-03-11 15:50:09 +04:00
coder2020official 09e4a2a437 Added the ability to get the current bot short description in the given language as the class BotShortDescription using the method getMyShortDescription. 2023-03-11 15:46:35 +04:00
coder2020official 9b81a29a6a Added the ability to set different bot short descriptions for different user languages using the method setMyShortDescription. 2023-03-11 15:40:54 +04:00
coder2020official 65dcd67140 Added the ability to get the current bot description in the given language as the class BotDescription using the method getMyDescription. 2023-03-11 15:35:00 +04:00
coder2020official c84b771e5a Added the ability to set different bot descriptions for different user languages using the method setMyDescription. 2023-03-10 21:36:44 +04:00
_run 2bd81a5f5c
I'm back: Bot API Update too :) 2023-03-10 15:21:07 +04:00
Badiboy 5d9a76b0dd
Merge pull request #1917 from S1RANN/master
Add a function to extract contents of entities from messages
2023-03-03 11:00:03 +03:00
Badiboy 6459f13f25
Merge pull request #1927 from Badiboy/master
New content types added + typo fix
2023-02-22 09:51:22 +03:00
Badiboy c9b6d3f868 New content types added + typo fix 2023-02-22 09:49:29 +03:00
Badiboy 80c1a4798d
Merge pull request #1921 from zeldpol/patch-1
Fix .webm upload
2023-02-18 23:46:03 +03:00
Dmitry 7a67d5f9f9
Fix .webm async upload 2023-02-18 22:36:29 +02:00
zeldpol d12ea91e12
Fix .webm upload
No need to pass file content as a header, it causes the http error "431 Request Header Fields Too Large".
2023-02-17 19:23:11 +02:00
orocane 4f2c89c4a8 Add a function to extract contents of entities from messages 2023-02-15 17:24:39 +08:00
_run fb7d60f09d
Merge pull request #1913 from coder2020official/botapi6.5
Fix #1912
2023-02-09 19:49:17 +04:00
coder2020official 8dc4e77287 Update asyncio_helper.py 2023-02-09 19:27:05 +04:00
Badiboy a999161384
Merge pull request #1911 from Badiboy/master
restrict_chat_member fix
2023-02-09 17:58:28 +03:00
Badiboy b4196f5891 restrict_chat_member fix 2023-02-09 17:56:10 +03:00
Badiboy e55fe962ca
Merge pull request #1906 from Badiboy/master
Bump version to 4.10.0
2023-02-05 13:14:08 +03:00
Badiboy 3d2c5c9590 Bump version to 4.10.0 2023-02-05 13:11:07 +03:00
_run 40567570e8
Merge pull request #1902 from coder2020official/botapi6.5
Bot API 6.5 update 🔥
2023-02-05 13:07:47 +04:00
coder2020official 4179e502c3 Fix description 2023-02-05 11:13:31 +04:00
coder2020official a9b878107c Fix can_send_media_messages param, added warnings 2023-02-04 22:24:26 +04:00
coder2020official 2094120ec7 Added user_chat_id to ChatJoinRequest; And, i corrected typehints 2023-02-04 20:07:01 +04:00
coder2020official d1348606e3 Added use_independent_chat_permissions to setchatpermissions 2023-02-04 20:04:07 +04:00
coder2020official d0d03d0c09 Added use_independent_chat_permissions for restrictchatmember 2023-02-04 19:59:49 +04:00
Badiboy fdd82a5e4b
Merge pull request #1894 from Muhammad-Aadil/master
Added poll_example.py in the examples
2023-02-04 18:46:39 +03:00
coder2020official 9e68f76f5d Replaced the fields can_send_media_messages in the classes ChatMemberRestricted and ChatPermissions with separate fields can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes for different media types. 2023-02-04 18:57:06 +04:00
coder2020official 4000c9fb48 Added chat_shared and chatshared 2023-02-04 16:58:48 +04:00
coder2020official ae42d0b1fe Added usershared and user_shared 2023-02-04 16:54:43 +04:00
coder2020official a3891ff363 Pep 0563 proposed change
https://peps.python.org/pep-0563/
2023-02-04 16:29:48 +04:00
coder2020official 4d7f5310fb Added the class KeyboardButtonRequestChat and the field request_chat to the class KeyboardButton. 2023-02-04 16:24:05 +04:00
_run 3e0d69f7f4
fixed checks x1 2023-02-04 16:16:34 +04:00
coder2020official 2e5fb10430 Added the class KeyboardButtonRequestUser and the field request_user to the class KeyboardButton. 2023-02-04 16:02:18 +04:00
_run c39c050abf
Update README.md 2023-02-04 15:32:55 +04:00
Muhammad Aadil ed6d6cc03f add poll answer handler to poll_example.py to show the example to send next poll or log user answers 2023-02-04 11:22:49 +05:00
Muhammad Aadil 10a80e1cfa add only quiz type poll example to the poll_example.py 2023-02-04 10:27:29 +05:00
Badiboy d99f48f975
Merge pull request #1893 from artyl/master
RuntimeError("cannot join current thread")
2023-01-31 20:52:59 +03:00
_run dae2790c61
Merge pull request #1898 from Badiboy/master
Async allowed_updates fix
2023-01-31 20:59:35 +04:00
Badiboy f5eac56afa Async allowed_updates fix 2023-01-31 11:19:11 +03:00
_run 268c3a9210
Merge pull request #1890 from iamnalinor/master
Fix "invite link must be non-empty" error
2023-01-28 19:35:02 +04:00
Muhammad Aadil ad7e4bbaf7 Added poll_example.py in the examples 2023-01-28 18:20:58 +05:00
Artem Lavrenov b9bedef73f Avoid raise RuntimeError(cannot join current thread) 2023-01-28 12:26:25 +03:00
Badiboy 9fb5f89f18
Merge pull request #1892 from bgelov/patch-1
Update README.md
2023-01-27 09:24:07 +03:00
Oleg Belov 409ff49603
Update README.md
Change _handeler() to _handler() in readme
2023-01-26 22:49:41 -03:00
Albert 5e0da40fcd Fix "invite link must be non-empty" error
`bot.edit_chat_invite_link` method contained a mistake: `invite_link` and `name` were supposed to be vice-versa in `apihelper.edit_chat_invite_link(...)` call. This caused to be invite_link empty or contain invalid value, resulting to get `Bad Request: invite link must be non-empty` error.
This also affected the async version.
2023-01-21 17:00:36 +04:00
Badiboy b743aa5813
Merge pull request #1884 from Cub11k/master
Remove redundant function from util
2023-01-16 16:58:58 +03:00
Cub11k 1797f076dc Remove redundant function 2023-01-16 15:45:59 +02:00
_run 68c1fe8cb5
Merge pull request #1883 from Cub11k/master
Fix type of attribute id of InlineQuery from int to str
2023-01-15 17:22:22 +04:00
Cub11k 1eda7cafd4 Fix type of attribute id of InlineQuery from int to str 2023-01-15 15:04:07 +02:00
Badiboy 291566908b
Merge pull request #1882 from CommanderCRM/patch-1
Added a bot with public source code to the list
2023-01-13 15:58:55 +03:00
Ilya Krivoshein bef29d9318
Added a bot with public source code to the list 2023-01-13 19:14:10 +07:00
Badiboy a5af586a46
Merge pull request #1881 from Cub11k/master
Create method get_media_file_id() in util.py
2023-01-10 20:48:50 +03:00
Cub11k 93dcbbeb02 Create method get_media_file_id()
Method is used to get file id of different types of media
2023-01-10 19:35:36 +02:00
Badiboy bd94d8d91c
Merge pull request #1873 from coder2020official/circular_import_fix
Little code style improvement in service_utils
2023-01-08 09:55:33 +03:00
_run 6b399ab8cd
Being specific with except block 2023-01-08 10:49:27 +04:00
_run 8744402efc
Removed built-in io module from try/except block 2023-01-08 10:48:45 +04:00
Badiboy d5bbaa900e
Merge pull request #1870 from Cub11k/master
Make create_dir() method of StatePickleStorage cross-platform instead of POSIX only.
2023-01-07 13:02:26 +03:00
Konstantin Ostashenko 02ae255701
Revert changes in util.py 2023-01-06 22:39:27 +02:00
Cub11k c27f60b94b Make create_dir() method cross-platform instead of POSIX only.
Fix for issue #1869
2023-01-06 22:36:08 +02:00
Badiboy a781929a2d
Merge pull request #1868 from Cub11k/master
Fix circular import
2023-01-06 22:51:52 +03:00
Cub11k e6f8acadf4 rename _util.py to service_utils.py 2023-01-06 21:41:30 +02:00
Cub11k c298d95d0f Move functions, required in types.py to _util.py
Add __all__ to util.py for sphinx to generate docs properly
2023-01-06 19:27:25 +02:00
Cub11k 8aee5372ee Update README.md - add link to ru docs 2023-01-05 16:25:16 +02:00
_run df105ab1d8
Merge pull request #1867 from Cub11k/master
Translated into russian files: index.po, calldata.po
2023-01-05 18:20:30 +04:00
Cub11k b93ec5d0e0 Translated calldata.po to russian 2023-01-05 16:13:00 +02:00
Cub11k f201df3275 Translated index.po to russian 2023-01-05 16:03:14 +02:00
_run 206e4e024b
Merge pull request #1865 from coder2020official/master
Fix docs issues
2023-01-04 18:08:35 +04:00
coder2020official bd1290592b Fix docs issues 2023-01-04 18:07:29 +04:00
_run 9b9eb775f7
Merge pull request #1863 from Cub11k/master
Finished translations into russian of files: sync_version.po, async_version.po
2023-01-04 17:39:34 +04:00
Konstantin Ostashenko 3cfa24f9c0
Fix msgid for forward_message:5 in async_version.po 2023-01-04 15:35:09 +02:00
Konstantin Ostashenko b540a6c4d4
Fix msgid for forward_message:5 in sync_version.po 2023-01-04 15:33:18 +02:00
Cub11k a0ba5ae9af Finished translations on sync and async versions.
Spelling fixes
2023-01-04 00:43:42 +02:00
Cub11k 651db29cb2 Fix typehints for stop_poll reply markup 2023-01-03 23:45:59 +02:00
Cub11k 490168f3f6 Some translations
Up to lines sync_version.po:4527 and async_version.po:4448
2023-01-03 19:43:36 +02:00
Cub11k bf38071e8f Some translations
Up to lines sync_version.po:3691 and async_version.po:3609
2023-01-03 17:32:31 +02:00
Konstantin Ostashenko e8aaa524fe
Merge branch 'sync_and_async_upd' into master 2023-01-02 17:41:48 +02:00
Konstantin Ostashenko e2e754fdff
Merge pull request #3 from eternnoir/master
Update fork
2023-01-02 17:35:04 +02:00
_run d64f305fd4
Merge pull request #1861 from coder2020official/docs
Updated documentation locales
2023-01-02 19:29:40 +04:00
coder2020official 611bf4235c Updated documentation locales 2023-01-02 19:27:57 +04:00
Konstantin Ostashenko fe0dc6930c
Merge pull request #2 from Cub11k/master
Update branch from master
2023-01-02 17:14:33 +02:00
Konstantin Ostashenko 6d4d3f8005
Merge pull request #1 from eternnoir/master
Update fork
2023-01-02 17:12:49 +02:00
Cub11k 0f7464e8c4 Some translations
Up to lines sync_version.po:3008 and async_version.po:3122
2023-01-02 17:09:48 +02:00
Badiboy 6f86382e33
Merge pull request #1860 from Badiboy/master
Bump version to 4.9/0
2023-01-02 18:00:39 +03:00
Badiboy 43cc203654 Bump version to 4.9/0 2023-01-02 18:00:20 +03:00
Badiboy 3b62ad4765
Merge pull request #1855 from coder2020official/botapi6.4
Bot API 6.4
2023-01-02 17:55:32 +03:00
_run 3be5015f9e
Update telebot/types.py 2023-01-02 17:55:30 +04:00
_run 267a33c329
Update telebot/types.py 2023-01-02 17:55:14 +04:00
_run 667e82d073
Update telebot/types.py 2023-01-02 17:54:35 +04:00
Cub11k dd50273c95 Some translations
Up to lines sync_version.po:2709 and async_version.po:2853
2022-12-31 14:16:13 +02:00
Cub11k 8e9d566d5c Minor fixes and some translations
Up to lines sync_version.po:2382 and async_version.po:2528
2022-12-31 00:56:38 +02:00
_run 79bc869143
Merge pull request #1856 from Cub11k/master
Copied translations from sync_version.po to async_version.po
2022-12-30 23:56:32 +04:00
Konstantin Ostashenko 68edb4990c
Fix async_version.po 2022-12-30 21:42:50 +02:00
Cub11k 19544ecc58 Copied translations from sync_version.po to async_version.po
Minor fixes in sync_version.po, found while copying
2022-12-30 21:24:13 +02:00
coder2020official eed56be596 Added fields has_hidden_members and has_aggressive_anti_spam_enabled to class Chat 2022-12-30 20:38:26 +04:00
coder2020official 9f8256607a Added the parameter message_thread_id to the method sendChatAction for sending chat actions to a specific message thread or a forum topic.
Added the parameter message_thread_id to the method sendChatAction for sending chat actions to a specific message thread or a forum topic.
2022-12-30 20:23:53 +04:00
coder2020official f297ad23c7 Added methods for topic management
Added the methods editGeneralForumTopic, closeGeneralForumTopic, reopenGeneralForumTopic, hideGeneralForumTopic, unhideGeneralForumTopic for managing the General topic in forums.
2022-12-30 20:19:50 +04:00
coder2020official a20a3ae321 topic events and write_access_allowed
Added the classes ForumTopicEdited, GeneralForumTopicHidden, GeneralForumTopicUnhidden, and WriteAccessAllowed and the fields forum_topic_edited, general_forum_topic_hidden, general_forum_topic_unhidden, and write_access_allowed to the class Message.
2022-12-30 20:07:38 +04:00
coder2020official 107f92314b icon_custom_emoji_id and name parameters made optional for edit_forum_topic
The parameters name and icon_custom_emoji_id of the method editForumTopic are now optional. If they are omitted, the existing values are kept.
2022-12-30 19:50:14 +04:00
coder2020official 9f5d9861a4 Added the field has_media_spoiler to the class Message.
Added the field has_media_spoiler to the class Message.
2022-12-30 19:41:46 +04:00
coder2020official 4537b237c8 has_spoiler for types.py
Added the field has_spoiler to the classes InputMediaPhoto, InputMediaVideo, and InputMediaAnimation.
2022-12-30 19:27:38 +04:00
coder2020official 4d11e97c25 has_spoiler parameter
Added the parameter has_spoiler to the methods sendPhoto, sendVideo, and sendAnimation.
2022-12-30 19:20:23 +04:00
coder2020official f0a1cefdda Added the field is_persistent to the class ReplyKeyboardMarkup
Added the field is_persistent to the class ReplyKeyboardMarkup, allowing to control when the keyboard is shown.
2022-12-30 19:08:37 +04:00
_run 24cd014410
Update README.md 2022-12-30 18:52:00 +04:00
Badiboy ba64180b5f
Merge pull request #1854 from Cub11k/master
Fixed typehints for reply markup in editing methods
2022-12-30 16:44:31 +03:00
Cub11k 3812fd05e3 Fixed typehints for reply markup in editing methods (async) 2022-12-30 14:04:12 +02:00
Cub11k 69afd7232e Fixed typehints for reply markup in editing methods 2022-12-30 14:02:02 +02:00
Badiboy 81600cf27e
Merge pull request #1849 from eternnoir/dependabot/pip/wheel-0.38.1
Bump wheel from 0.24.0 to 0.38.1
2022-12-30 00:02:27 +03:00
_run bb8023ecc6
Merge pull request #1852 from Cub11k/master
Fixed typehints for register_<any>_handler()
2022-12-28 22:14:50 +04:00
Cub11k a50a6e2e54 Fixed typehints for register_<any>_handler() 2022-12-28 20:00:06 +02:00
Badiboy 0329e5adb8
Merge pull request #1850 from ayitinya/patch-1
Update README.md
2022-12-27 09:17:26 +03:00
Rudy Ayitinya Sulley 2f25b56659
Update README.md
Adds a bot to Bots using this library list
2022-12-27 02:46:07 +00:00
dependabot[bot] 2aaab08517
Bump wheel from 0.24.0 to 0.38.1
Bumps [wheel](https://github.com/pypa/wheel) from 0.24.0 to 0.38.1.
- [Release notes](https://github.com/pypa/wheel/releases)
- [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst)
- [Commits](https://github.com/pypa/wheel/compare/0.24.0...0.38.1)

---
updated-dependencies:
- dependency-name: wheel
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-26 19:49:24 +00:00
_run a6a22c351a
Merge pull request #1845 from Cub11k/master
Partly translated files: sync_version.po
2022-12-21 17:14:55 +04:00
Cub11k d211db90cf Update sync_version.po 2022-12-21 15:04:43 +02:00
_run f2c211616c
Merge pull request #1844 from coder2020official/master
✉️ Fixed escape_markdown: now it should escape { and } characters in a string as well.
2022-12-21 16:59:03 +04:00
_run c5e733a4c1
Escape both metachars 2022-12-20 23:47:12 +04:00
_run 925f7012f1
Update formatting.py 2022-12-20 23:44:32 +04:00
_run 625ae09573
Merge pull request #1839 from coder2020official/master
Fix bug with asyncwebhooks
2022-12-19 17:35:23 +04:00
coder2020official 5b279b7ad9 (A)SyncWebhookListener changes 2022-12-19 17:28:05 +04:00
_run 247cddf23d
Merge pull request #1831 from coder2020official/reloader_fix
Update reloader.py
2022-12-19 17:17:11 +04:00
_run 171172d12e
Update async_telebot.py 2022-12-19 17:12:15 +04:00
_run c3c12b93dd
Merge pull request #1832 from coder2020official/master
Fix bug related to get_user_profile_photos
2022-12-14 14:18:18 +04:00
_run add240adfd
Update asyncio_helper.py 2022-12-14 12:41:30 +04:00
_run 45fe2ea319
Update reloader.py 2022-12-13 18:44:41 +04:00
Badiboy 6373af78f3
Merge pull request #1824 from reddere/patch-3
fixing escape()
2022-12-03 16:48:16 +03:00
reddere 4ed460b137
Update util.py 2022-12-03 14:23:10 +01:00
reddere ae20cb9f31
Update util.py 2022-12-03 14:21:31 +01:00
reddere 669c18fdc0
update
updated "== None" to "is None" and adjusted the else statement
2022-12-03 14:11:07 +01:00
reddere 34acae9a59
fixing escape()
fixing escape() as replacing a None would throw an exception 'NoneType' object has no attribute 'replace'. useful in case of escaping a None string given from message.from_user.last_name as you dont know wether the user has a last name or not
2022-12-03 13:33:22 +01:00
Badiboy 109ae69f27
Merge pull request #1823 from Badiboy/master
Fixed register_next_step_handler_by_chat_id chat_id description
2022-12-03 00:01:57 +03:00
Badiboy 43abedbff7 Fixed register_next_step_handler_by_chat_id chat_id description 2022-12-02 23:59:59 +03:00
Badiboy 42d162f732
Merge pull request #1822 from Badiboy/master
Fix caption_entities miss in InputMediaXXX
2022-12-02 23:52:54 +03:00
Badiboy cd4dc899a1 Fix caption_entities miss in InputMediaXXX 2022-12-02 23:46:26 +03:00
_run 5066626692
Merge pull request #1818 from Cub11k/master
Translated to russian file: util.po
2022-12-01 12:46:16 +04:00
Konstantin Ostashenko e255d9cbab
Update docs/source/locales/ru/LC_MESSAGES/util.po
Co-authored-by: _run <khumogo1@gmail.com>
2022-11-30 23:12:33 +02:00
Konstantin Ostashenko 8e1c8a2742
Update docs/source/locales/ru/LC_MESSAGES/util.po
Co-authored-by: _run <khumogo1@gmail.com>
2022-11-30 23:12:25 +02:00
Cub11k e358abc1bd Update util.po 2022-11-30 21:07:46 +02:00
_run 42da2d1794
Merge pull request #1816 from Cub11k/master
Translated into russian file: formatting.po
2022-11-30 19:44:24 +04:00
Cub11k feaef2b2b8 Merge remote-tracking branch 'origin/master' 2022-11-30 17:33:28 +02:00
Cub11k 6cf60a3dcb Update formatting.po according to comments 2022-11-30 17:33:06 +02:00
Konstantin Ostashenko 91ff06eeba
Update docs/source/locales/ru/LC_MESSAGES/formatting.po
Co-authored-by: _run <khumogo1@gmail.com>
2022-11-30 16:49:46 +02:00
Cub1tor 1c2111d689 Update formatting.po 2022-11-29 20:19:25 +02:00
_run bf039df122
Merge pull request #1815 from coder2020official/master
Update install.po
2022-11-29 19:25:40 +04:00
_run 44309797d1
Update install.po 2022-11-29 19:21:05 +04:00
_run 8489383eb4
Merge pull request #1814 from abdullaev388/master
Translated into russian files:  install.po, quick_start.po
2022-11-29 19:12:54 +04:00
abdullaev388 848a2cc7ec
Update docs/source/locales/ru/LC_MESSAGES/install.po
Co-authored-by: _run <khumogo1@gmail.com>
2022-11-29 10:11:27 -05:00
abdullaev388 cc87dbce50
Update docs/source/locales/ru/LC_MESSAGES/install.po
Co-authored-by: _run <khumogo1@gmail.com>
2022-11-29 10:11:21 -05:00
abdullaev388 15f6bbeacb
Update docs/source/locales/ru/LC_MESSAGES/install.po
Co-authored-by: _run <khumogo1@gmail.com>
2022-11-29 10:09:48 -05:00
abdullaev388 29befa4d0c
Update install.po
translated into russian
2022-11-29 09:25:10 -05:00
abdullaev388 cce03dab78
Update quick_start.po
translated into russian
2022-11-29 09:21:24 -05:00
_run 7702d63fd7
Merge pull request #1813 from coder2020official/docs
Base of ru documentation added.
2022-11-29 17:39:30 +04:00
_run d636cdf88b
Update doc_req.txt 2022-11-29 17:37:16 +04:00
_run 06a28380d7
Update doc_req.txt 2022-11-29 17:33:42 +04:00
coder2020official d7e9d3accc Update conf.py 2022-11-29 14:59:17 +04:00
coder2020official 736c03fe84 Update conf.py 2022-11-29 14:49:32 +04:00
coder2020official 7502d26b1a Added locales 2022-11-29 14:45:51 +04:00
Badiboy b4d59fdf0a
Merge pull request #1812 from Badiboy/master
Bump version to 4.8.0 and update Python versions
2022-11-28 19:24:46 +03:00
Badiboy 8d723bdcb3 Python 3.6 removed, Python 3.11 added 2022-11-28 19:17:23 +03:00
Badiboy a169404a7c Bump version to 4.8.0 2022-11-28 19:14:07 +03:00
Badiboy 7a20017dfb
Merge pull request #1811 from coder2020official/continuehandling-fix
Continuehandling fix
2022-11-27 11:30:37 +03:00
_run 8d82b3d56b
Update async_telebot.py 2022-11-26 20:08:00 +04:00
_run 0759c8e081
Update __init__.py 2022-11-26 20:07:08 +04:00
_run 8992db1d24
Merge pull request #1808 from coder2020official/master
Fix #1804
2022-11-26 20:05:00 +04:00
_run deb2099396
Update types.py 2022-11-22 18:36:15 +04:00
_run 8a74198276
Merge pull request #1801 from coder2020official/master
Fixed bot api bug
2022-11-18 23:22:39 +04:00
_run 15bd5f991a
Update types.py 2022-11-18 23:21:06 +04:00
_run 25571b581c
Update types.py 2022-11-18 23:12:03 +04:00
Badiboy bf617ab8da
Merge pull request #1799 from Badiboy/master
content_type_media and content_type_service reviewed
2022-11-13 13:21:45 +03:00
Badiboy 74732f2eda content_type_media and content_type_service reviewed 2022-11-13 13:20:26 +03:00
Badiboy 0a79f7e4f3
Merge pull request #1783 from coder2020official/botapi-63
Bot API 6.3 Update
2022-11-13 12:39:38 +03:00
_run 8b735aa114
Update __init__.py 2022-11-13 13:34:54 +04:00
coder2020official ae1845f285 Added active_usernames and emoji_status_custom_emoji_id 2022-11-06 17:38:01 +04:00
coder2020official 0846852ea1 Added all necessary parameters
Added the parameter message_thread_id to the methods sendMessage, sendPhoto, sendVideo, sendAnimation, sendAudio, sendDocument, sendSticker, sendVideoNote, sendVoice, sendLocation, sendVenue, sendContact, sendPoll, sendDice, sendInvoice, sendGame, sendMediaGroup, copyMessage, forwardMessage to support sending of messages to a forum topic.
2022-11-06 17:31:49 +04:00
coder2020official 4825624d48 Added docs to types, added new methods
Added the methods createForumTopic, editForumTopic, closeForumTopic, reopenForumTopic, deleteForumTopic, unpinAllForumTopicMessages, and getForumTopicIconStickers for forum topic management.
2022-11-06 15:43:16 +04:00
coder2020official 876d679765 Added ForumTopic class and fixed previous classes by fixing de_json method. 2022-11-06 15:14:19 +04:00
coder2020official 7958d0dca7 Added can_manage_topics for promotechatmember
Added the parameter can_manage_topics to the method promoteChatMember.
2022-11-06 15:04:41 +04:00
coder2020official 4e2ea90db3 Added field can_manage_topics
Added the field can_manage_topics to the classes ChatAdministratorRights, ChatPermissions, ChatMemberAdministrator, and ChatMemberRestricted.
2022-11-06 15:00:20 +04:00
coder2020official 566aef1679 Fix wrong typehint for previous commit 2022-11-06 14:49:13 +04:00
Badiboy 2dad99ad95
Merge pull request #1761 from coder2020official/master
Extended exception handler behaviour for async
2022-11-06 09:23:02 +03:00
coder2020official f288470b43 Added the classes ForumTopicCreated, ForumTopicClosed, and ForumTopicReopened and the fields forum_topic_created, forum_topic_closed, and forum_topic_reopened to the class Message. Note that service messages about forum topic creation can't be deleted with the deleteMessage method.
Added the classes ForumTopicCreated, ForumTopicClosed, and ForumTopicReopened and the fields forum_topic_created, forum_topic_closed, and forum_topic_reopened to the class Message. Note that service messages about forum topic creation can't be deleted with the deleteMessage method.
2022-11-06 01:04:33 +04:00
coder2020official 475394d241 Added message_thread_id & is_topic_message 2022-11-05 23:23:00 +04:00
coder2020official 76f06cacfe Fix typo 2022-11-05 23:15:10 +04:00
coder2020official 77738b2537 Added is_forum 2022-11-05 23:14:37 +04:00
coder2020official 070479f7af Update async_telebot.py 2022-11-05 23:06:28 +04:00
coder2020official f1f18c6df2 Fix error description 2022-11-05 22:49:07 +04:00
_run 81c8ee5820
Update README.md 2022-11-05 22:20:11 +04:00
Badiboy 76a689d939
Merge pull request #1774 from batmanscode/master
fixes: `debug` removed from uvicorn #1767
2022-11-02 13:29:45 +03:00
batmanscode 92ecfdec48
fixes: `debug` removed from uvicorn #1767 2022-10-30 17:21:53 +00:00
Badiboy 20376168c1
Merge pull request #1772 from sijokun/master
Added example of running serverless on AWS Lambda
2022-10-29 12:02:31 +03:00
Yan Khachko 507d53efbd
Rename lambda_function.py to aws_lambda_function.py 2022-10-29 11:57:53 +03:00
Yan Khachko 1d8dc78c87
Added example of running serverless on AWS Lambda
Example of using of PyTelegramBotAPI in Amazon AWS Lambda
2022-10-29 01:18:52 +03:00
Badiboy ebec3bf5c1
Merge pull request #1762 from reddere/patch-1
Fixed InlineQueryResultVideo params in example.
2022-10-24 19:25:15 +03:00
reddere d11b9802da
Fixed InlineQueryResultVideo params in example.
Fixed InlineQueryResultVideo params in example. String "Video" was passed in stead of the thumbnail url, making the example not work, This has been tested working.
2022-10-24 16:02:59 +02:00
coder2020official 572f103db7 Extended exception handler behaviour for async 2022-10-22 21:48:29 +04:00
Badiboy 231371f1f8
Merge pull request #1759 from Badiboy/master
Bump version to 4.7.1
2022-10-21 10:58:23 +03:00
Badiboy 623d8b27ec Bump version to 4.7.1 2022-10-21 10:18:47 +03:00
Badiboy 31c3a2b2a3
Merge pull request #1742 from byehack/ContinueHandling
Support ContinueHandling
2022-10-11 19:03:44 +03:00
_run c45af810f9
Updated docstrings for ContinueHandling 2022-10-11 19:15:38 +04:00
_run 81f090cce6
Update asyncio_handler_backends.py 2022-10-11 19:15:01 +04:00
_run 5d16b8bd4a
Create continue_handling.py 2022-10-11 19:13:10 +04:00
_run 0fecf46201
Create continue_handling.py 2022-10-11 19:09:59 +04:00
_run 982e642c73
Update telebot/handler_backends.py 2022-10-11 19:05:55 +04:00
byehack 97bca49c00
ContinueHandling on asyncio_handler_backends 2022-10-09 02:28:05 +03:30
Badiboy e0ee087162
Merge pull request #1749 from Badiboy/master
Check CUSTOM_REQUEST_SENDER before RETRY_xxx.
2022-10-08 23:43:44 +03:00
Badiboy 620b1364a6 Check CUSTOM_REQUEST_SENDER before RETRY_xxx. 2022-10-08 23:41:41 +03:00
Badiboy c561cf3076
Merge pull request #1748 from coder2020official/master
Added warning for non_stop=False
2022-10-08 23:24:58 +03:00
coder2020official b3953d6249 ℹ️ Better description 2022-10-08 23:03:04 +04:00
coder2020official 2d7170feee Added warning for non_stop=False 2022-10-08 22:35:22 +04:00
Badiboy 0ca8007633
Merge pull request #1747 from coder2020official/master
Update __init__.py
2022-10-07 20:57:49 +03:00
_run c541533762
Update __init__.py 2022-10-07 21:50:51 +04:00
byehack 4798c26188
improve code quality 2022-10-02 12:05:20 +03:30
byehack 30aaf8d0f1
Support ContinueHandling 2022-10-02 03:27:06 +03:30
Badiboy 82ad37fed8
Merge pull request #1693 from coder2020official/conflicts
Logging improvements(still not 100%), file restarts on file changes(needs tests), and more
2022-10-01 22:30:49 +03:00
coder2020official 2d1f39085d Improved code readability x 2 2022-10-01 22:34:49 +04:00
coder2020official b523cec22f Improved code readability 2022-10-01 22:32:41 +04:00
coder2020official 27e0197855 Added examples and made it possible to specify --path path for path 2022-10-01 21:28:53 +04:00
coder2020official ea69b8093d Added some notes 2022-10-01 21:15:24 +04:00
coder2020official 04ff428bba Added option to specify path to watch 2022-10-01 21:02:40 +04:00
coder2020official eb576d83fb Fixed a bug, made improvements in reload system
Didn't test that much, there is still some stuff to do
2022-09-30 23:22:21 +04:00
_run d3080b6d4e
Merge branch 'master' into conflicts 2022-09-30 22:53:19 +04:00
Badiboy 7c9b01b10a
Merge pull request #1722 from Badiboy/master
Handlers and Middlewares processing union
2022-09-24 22:16:33 +03:00
Badiboy b3993bb019 Merge remote-tracking branch 'upstream/master' 2022-09-24 22:14:45 +03:00
Badiboy 36b889feab
Merge pull request #1736 from AntonGlyzin/antonglyzin-shopbotlist
Added a new bot to the list
2022-09-24 16:06:33 +03:00
Anton d943f40643 Added a new bot to the list 2022-09-24 15:33:11 +03:00
_run dafafd2ad2
Merge pull request #1735 from coder2020official/class_params
⚙️ Added some frequent parameters to classes(see full list)
2022-09-23 22:06:09 +04:00
coder2020official e002484a9b ⚙️ Added some frequent parameters to classes(see full list)
Added:
- disable_web_page_preview
- disable_notification
- protect_content
- allow_sending_without_reply
2022-09-23 21:52:40 +04:00
Badiboy 52e09637c2 Fix: do not call handler in one more task 2022-09-17 23:17:07 +03:00
Badiboy e7a96ec2ed Rename also in Async 2022-09-17 14:09:05 +03:00
Badiboy 598de25b6d Rename _check_middlewares to _get_middlewares 2022-09-17 12:55:55 +03:00
_run b841fc10ed
Merge pull request #1723 from byehack/patch-1
don't block loop
2022-09-17 13:42:57 +04:00
byehack c14760d81c
don't block loop 2022-09-17 13:58:28 +04:30
Badiboy da639dd1f6 Handlers and Middlewares processing union
Call for handlers now union in a single function for future extension.

Plus minor fixes in storages.
2022-09-17 11:57:12 +03:00
_run 96e137f5e6
Update setup.py 2022-09-16 22:39:40 +04:00
Badiboy 8d9dfcfac8
Merge pull request #1707 from S1RANN/master
raise other exceptions in antiflood function
2022-09-13 17:59:30 +03:00
_run a1c77db236
Merge pull request #1710 from coder2020official/bugfixes
Fixed difference between request_timeout and timeout.
2022-09-10 20:48:30 +04:00
coder2020official 4f97b26e81 Update asyncio_helper.py 2022-09-10 20:37:13 +04:00
coder2020official 0028feb4c5 Update asyncio_helper.py 2022-09-10 20:14:48 +04:00
orocane a06b4a1e9c raise other exceptions in antiflood 2022-09-10 21:46:16 +08:00
coder2020official da5084f53c Update asyncio_helper.py 2022-09-10 14:36:56 +04:00
coder2020official 2f8d878f06 Fixed difference between request_timeout and timeout.
getUpdates parameter may contain 2 parameters: request_timeout & timeout. other methods may contain timeout parameter that should be applied to ClientTimeout.
2022-09-10 14:34:56 +04:00
orocane 783beb165b raise other exceptions in antiflood 2022-09-10 15:59:40 +08:00
_run 4fd01e3ac8
Merge pull request #1703 from coder2020official/downloadfile
Fix #1702
2022-09-09 21:09:25 +04:00
_run b4c28de104
Update asyncio_helper.py 2022-09-07 20:44:39 +04:00
_run de344bd5e0
Merge pull request #1701 from coder2020official/states
#1699 fixed
2022-09-06 18:16:06 +04:00
_run e3a4fdff9a
Update asyncio_filters.py 2022-09-06 18:12:11 +04:00
_run 71d3ec8b42
Changed user id and chat id 2022-09-06 18:11:40 +04:00
coder2020official 1b1d6c8239 Improved asyncio helper's logger 2022-08-30 21:26:56 +04:00
coder2020official 9216f15c16 Logs, file restarts, loggers to async
Added colorful logs, file restarts on changes, improved logger, added cached version of user-bot to async
2022-08-30 21:26:41 +04:00
coder2020official 0f7ab0d05f Added colorful logs, file restarts on changes to sync 2022-08-30 21:25:41 +04:00
coder2020official e0ffe0b4f5 Added reloader to ext 2022-08-30 21:24:54 +04:00
Badiboy f4c5dd0d22
Merge pull request #1691 from ananthb/master
Starlette ASGI example
2022-08-30 15:55:28 +03:00
Ananth Bhaskararaman e4179ea65f
Add SSL cert 2022-08-30 17:27:43 +05:30
Ananth Bhaskararaman d7770bf670
Starlette ASGI example 2022-08-30 17:05:56 +05:30
_run 095bf03227
Merge pull request #1688 from ananthb/patch-1
Import aioredis from redis module too
2022-08-30 12:28:18 +04:00
_run 85bd174fdc
Update redis_storage.py 2022-08-30 12:26:34 +04:00
Ananth Bhaskararaman b86c38367a
Import aioredis from redis module too
aioredis is available in redis-py as of version 4.2.0rc1: https://github.com/aio-libs/aioredis-py#-aioredis-is-now-in-redis-py-420rc1-
Try importing from the new package as well.
2022-08-28 17:32:56 +05:30
Badiboy b8214d32d5
Merge pull request #1679 from Badiboy/master
Code simplify and sync/async unificatiion
2022-08-22 12:20:36 +03:00
Badiboy f4e66f6807 Added traceback for handlers exception 2022-08-21 22:27:02 +03:00
Badiboy b1a4136603 Code simplify and sync/async unificatiion 2022-08-21 20:32:37 +03:00
Badiboy 3d97b08289
Merge pull request #1678 from coder2020official/master
Fixed bug with searching a new handler after the execution of handler
2022-08-21 19:38:59 +03:00
_run 3d2576ca24 Fixed bug with searching a new handler after the execution of handler 2022-08-21 20:42:55 +05:00
Badiboy b2d2ab5c33
Merge pull request #1675 from coder2020official/master
Fixed #1650
2022-08-17 00:38:59 +03:00
_run c9a732e3dd
Merge branch 'eternnoir:master' into master 2022-08-16 21:39:55 +05:00
_run 01be1fb583 Fixes #1650 2022-08-16 21:39:20 +05:00
Badiboy 7b95874627
Merge pull request #1672 from Badiboy/master
Typo fix
2022-08-16 17:34:57 +03:00
Badiboy 426f9f3787 Typo fix
and minor code opt
2022-08-16 17:12:50 +03:00
Badiboy 47ae696528
Merge pull request #1668 from coder2020official/master
Update asyncio_helper.py
2022-08-13 13:03:47 +03:00
Badiboy a9b8baea2c
Merge pull request #1667 from Badiboy/master
Readme update
2022-08-13 12:59:57 +03:00
_run d3cab9cdba Update asyncio_helper.py 2022-08-13 14:59:57 +05:00
Badiboy d6ef67073e Readme fix 2022-08-13 12:59:13 +03:00
Badiboy 345fa3433c Readme update 2022-08-13 12:58:20 +03:00
_run c95ba8c9c2
Merge pull request #1666 from coder2020official/master
Update async_telebot.py
2022-08-13 14:58:11 +05:00
_run 20bdb54e94 Update async_telebot.py 2022-08-13 14:57:39 +05:00
Badiboy 124dfbf392
Merge pull request #1665 from Badiboy/master
Bump version to 4.7.0
2022-08-13 12:53:00 +03:00
Badiboy 9f9821bbe8 Bump version to 4.7.0 2022-08-13 12:52:38 +03:00
Badiboy c8d1dac61e
Merge pull request #1663 from coder2020official/master
Bot API 6.2
2022-08-13 12:44:33 +03:00
_run ffb34da610 Fix 2022-08-13 14:40:20 +05:00
_run 2647a02fc6 Contains_mask 2022-08-13 14:36:48 +05:00
_run dd4073fd74 Fixes regarding contains_masks 2022-08-13 13:22:25 +05:00
_run 737c3a439d Fix tests(1st attempt) 2022-08-12 22:13:54 +05:00
_run 40698408c9 Bot API 6.2 2022-08-12 22:10:08 +05:00
_run ffa1c37204
Update README.md 2022-08-12 20:12:44 +05:00
Badiboy d42c8e2961
Merge pull request #1652 from coder2020official/master
Added InputFile
2022-08-12 17:35:20 +03:00
_run 5471b88da6 Update apihelper.py 2022-08-12 19:25:46 +05:00
_run 26db76f207 Fix backward comptability 2022-08-12 15:25:51 +05:00
_run e860f114c6 Forgot to remove unnecessary import 2022-08-12 14:37:00 +05:00
_run c5a69944be Documentation improvements and file name fix 2022-08-12 14:33:24 +05:00
Badiboy 2fe5ba403e
Merge pull request #1662 from Peibolvig/add_web_app_data_content_type
Add 'web_app_data' content type to README
2022-08-12 10:14:03 +03:00
Badiboy d2a7f975de
Merge pull request #1661 from ablakely/patch-1
Update README.md
2022-08-12 10:08:09 +03:00
Pablo Vazquez Rodriguez 41b1519786 Add 'web_app_data' content type to README 2022-08-12 01:53:35 +02:00
Aaron Blakely 93e1813139
Update README.md
Added TeleServ
2022-08-11 18:17:06 -05:00
Badiboy dab5d7f632
Merge pull request #1660 from Mahakam20000/master
Example of async bot using webhook and aiohttp
2022-08-10 22:28:17 +03:00
Mahakam20000 1667b51034
Example of async bot using webhook and aiohttp
An async echo bot using aiohttp and webhoook
2022-08-10 19:57:30 +02:00
Badiboy 7d94e01009
Merge pull request #1655 from dasshit/master
Fix for token visibility in swagger in fastapi webhook example
2022-08-09 08:04:16 +03:00
v.korobov c0ed659f30 Minor code style fixes 2022-08-08 23:07:04 +03:00
v.korobov 047777fada Fixed TOKEN visibility in fastapi swagger 2022-08-08 23:04:36 +03:00
Badiboy 839aced912
Merge pull request #1646 from coder2020official/test_branch
Removed state storages and fixed a typo(for docs)
2022-08-01 13:24:29 +03:00
_run d03f3b2c52 Updated asyncio_helper to support InputFile and fixed unecessary methods 2022-08-01 14:09:44 +05:00
_run 65b353ffae Added InputFile 2022-08-01 12:40:43 +05:00
Badiboy 914c5fdf0c
Merge pull request #1649 from Badiboy/master
Bump version to 4.6.1
2022-07-27 17:19:53 +03:00
Badiboy 8aa3d052cc Bump version to 4.6.1 2022-07-27 17:18:54 +03:00
_run 5beb51f907 Removed state storages and fixed a typo 2022-07-27 13:48:20 +05:00
Badiboy c145b7ef8f
Merge pull request #1644 from coder2020official/test_branch
Updated all docstrings(visual)
2022-07-26 21:31:27 +03:00
_run 6303ecc7c6 Little fix 2022-07-26 20:45:32 +05:00
_run fc01ec50fc Added .ext file to documentation 2022-07-26 16:30:51 +05:00
_run 51b2ec701d Removed unecessary methods from documentation(to_json, de_json, to_dict) 2022-07-26 16:27:15 +05:00
_run 3d7f334d79 Updated all docstrings for types(visual) 2022-07-26 16:16:35 +05:00
Badiboy a61508ca0c
Merge pull request #1643 from robz-tirtlib/patch-1
small fix
2022-07-25 21:42:22 +03:00
robz-tirtlib 9d9e76e724
small fix
Fixed "ERROR - TeleBot: "message_handler: Commands filter should be list of strings (commands), unknown type supplied to the 'commands' filter list. Not able to use the supplied type."
2022-07-25 15:49:33 +03:00
_run b0e06253ff Completed docstrings for all files except types.py 2022-07-24 23:14:09 +05:00
Badiboy 7c12162576
Merge pull request #1640 from coder2020official/master
Updated all docstrings / typehints in __init__.py(visual)
2022-07-20 11:35:40 +03:00
_run f0feb45e87 Completed all docstrings / typehints up to 100%(visual) 2022-07-19 23:51:25 +05:00
_run c2cfe24426 Typehints & Docstrings completed for sync version up to 100%(visual) 2022-07-19 23:49:05 +05:00
_run f6ec3493ad Fixed 45% of typehints/docstrings for sync telebot 2022-07-19 00:27:21 +05:00
Badiboy e553f3aa1d
Merge pull request #1638 from coder2020official/master
Fixes #1637, #1636
2022-07-18 18:14:52 +03:00
_run 49d3b463ed Fixes #1636 2022-07-18 14:01:14 +05:00
_run 147278733b Fix #1637 2022-07-18 13:47:14 +05:00
Badiboy 54ad1582aa
Merge pull request #1635 from coder2020official/master
Fixed description
2022-07-17 00:42:55 +03:00
_run e379708af6
Update __init__.py 2022-07-16 20:12:38 +05:00
_run 9f7b113e2f
Merge branch 'master' into master 2022-07-16 20:11:40 +05:00
_run 482498e1e5 Merge branch 'master' of https://github.com/coder2020official/pyTelegramBotAPI 2022-07-16 20:09:54 +05:00
_run 22beead3b5 Update __init__.py 2022-07-16 20:09:52 +05:00
Badiboy 2b01765627
Merge pull request #1633 from coder2020official/master
Update async_telebot.py
2022-07-16 18:04:52 +03:00
Badiboy 5dbe1b3523
Merge pull request #1631 from coder2020official/newfeatures
update_sensitive field for middlewares
2022-07-16 12:46:12 +03:00
_run 3ffd06fcca
Add feedback-bot to `Bots using this library` section 2022-07-15 23:26:55 +05:00
_run ea1efad1ea Update asyncio_helper.py 2022-07-15 22:28:43 +05:00
_run 1efe465e9d
Update async_telebot.py 2022-07-15 22:06:18 +05:00
_run 0c6f84c79a update_sensitive field for middlewares 2022-07-15 16:24:15 +05:00
Badiboy bf415e4bd7
Merge pull request #1624 from coder2020official/master
Set request_timeout to default aiohttp's timeout(5 minutes)
2022-07-13 20:01:30 +03:00
_run 2fcfdc2584
Merge branch 'eternnoir:master' into master 2022-07-13 21:52:57 +05:00
_run 659501efef
Update async_telebot.py 2022-07-13 21:52:48 +05:00
Badiboy 92654ee970
Merge pull request #1623 from Badiboy/master
Fix exception with typed_middleware_handlers
2022-07-13 15:08:12 +03:00
Badiboy a1bcd3c42e use_class_middlewares checks added 2022-07-13 13:10:16 +03:00
Badiboy b276bfacaf Fix exception with typed_middleware_handlers
+ some additional checks
2022-07-13 12:30:13 +03:00
Badiboy 726b203724
Merge pull request #1621 from Badiboy/master
Typo
2022-07-12 22:48:01 +03:00
Badiboy 16703161aa Typo 2022-07-12 22:44:25 +03:00
Badiboy a3a55e7393
Merge pull request #1617 from coder2020official/bugfixes
Extended exception handler behaviour with middlewares for synchronous version as well
2022-07-12 22:12:20 +03:00
Badiboy 1c11898ea1
Merge pull request #1612 from coder2020official/newfeatures
run_webhooks() built in function to listen and process webhook requests.
2022-07-11 23:33:39 +03:00
_run 8c6f81546c A typo fixed 2022-07-11 23:24:22 +05:00
_run 194bf6e95d Merge branch 'bugfixes' of https://github.com/coder2020official/pyTelegramBotAPI into bugfixes 2022-07-11 23:23:10 +05:00
_run 124606fdcb Extend exception handler behaviour with middlewares 2022-07-11 23:22:11 +05:00
_run 90a90d4a34 Divided async and sync versions into aio & sync folders 2022-07-09 22:30:36 +05:00
_run d67ee2a5c5 Delete webhooks.py 2022-07-08 21:16:01 +05:00
_run 970b9d6be4 SyncWebhookListener was rewritten under fastapi. Extensions folder was divided into 2(namings are long, might be changed) 2022-07-08 21:13:07 +05:00
Badiboy 0b5b7ad39a
Merge pull request #1614 from Badiboy/master
parse_web_app_data function fix
2022-07-08 11:19:35 +03:00
Badiboy a7c420aa14 parse_web_app_data function fix 2022-07-08 11:15:50 +03:00
_run 0cf2a0fe77 Added extra dependencies and fixed tests 2022-07-07 23:02:51 +05:00
_run 2f32236680 Added run_webhooks for asynctelebot 2022-07-07 22:56:13 +05:00
_run f8f147f9f4 Fix certificate for webhooks 2022-07-07 15:53:27 +05:00
_run 140befc132 Typehint fix if there is no flask installed 2022-07-07 15:15:24 +05:00
_run 36fbb13663 Merge branch 'newfeatures' of https://github.com/coder2020official/pyTelegramBotAPI into newfeatures 2022-07-07 15:09:45 +05:00
_run e353572c03 Update webhooks listeners. 2022-07-07 15:09:02 +05:00
_run ebca668979
Create __init__.py 2022-07-06 23:35:59 +05:00
_run 7b8c98d731 Test 2022-07-06 23:15:22 +05:00
_run 3cf5305845 Rename 2022-07-06 22:06:49 +05:00
_run eb4cd7aba0 Webhook processing function using flask for sync 2022-07-06 21:31:03 +05:00
Badiboy 01f9e3b710
Merge pull request #1607 from coder2020official/newfeatures
ReadME update and filter updates
2022-07-05 22:40:54 +03:00
_run e1094c6f02
Update README.md 2022-07-05 21:50:11 +05:00
_run 174bbf9c84
Merge branch 'eternnoir:master' into newfeatures 2022-07-05 21:19:21 +05:00
_run 1df19e3b2d CallbackQuery fixes for custom filters
Now some custom filters support callback query messages
2022-07-05 21:18:42 +05:00
Badiboy e0e6eee374
Merge pull request #1605 from Badiboy/master
ChatMember is now typed
2022-07-05 00:01:38 +03:00
Badiboy 78251cdf43 ChatMember type checking reordered 2022-07-04 22:41:01 +03:00
Badiboy 81cbddb8cd Added source data (json_string) to CallbackQuery 2022-07-04 22:36:42 +03:00
Badiboy 0aa9f0fb42 Update type fix 2022-07-04 22:26:24 +03:00
Badiboy f3b1f97362 ChatMember is now typed
https://core.telegram.org/bots/api#chatmember
2022-07-03 23:33:55 +03:00
Badiboy df1977911e
Merge pull request #1603 from coder2020official/master
#1594 & fixes regarding handler execution in async
2022-07-02 23:12:49 +03:00
_run d861fd0042
Merge branch 'eternnoir:master' into master 2022-07-02 21:07:23 +05:00
_run 1fb14e28d4 Fix handler execution and #1594 2022-07-02 21:07:00 +05:00
Badiboy b691a467c0
Merge pull request #1602 from GooGuJiang/patch-1
Add bot to README.md
2022-07-02 11:18:04 +03:00
咕谷酱 badf982147
Update README.md 2022-07-02 15:08:06 +08:00
咕谷酱 6d52090ef9
Update README.md 2022-07-02 15:06:46 +08:00
咕谷酱 cf3a85d699
Update README.md 2022-07-02 14:31:37 +08:00
咕谷酱 ef86453126
Update README.md 2022-07-02 14:23:31 +08:00
Badiboy d9ab5b0d28
Merge pull request #1599 from coder2020official/master
Fix group and supergroup issues with states
2022-07-01 13:55:48 +03:00
_run c920809fa9
Update asyncio_helper.py 2022-07-01 15:39:42 +05:00
_run 5939e754bb
Update asyncio_helper.py 2022-07-01 15:29:34 +05:00
_run 3019b71f7f
Merge branch 'eternnoir:master' into master 2022-06-30 17:54:25 +05:00
_run 0bdf925fbe Merge branch 'master' of https://github.com/coder2020official/pyTelegramBotAPI 2022-06-30 17:54:16 +05:00
_run d14064a84d Fix group and supergroup issues 2022-06-30 17:51:58 +05:00
Badiboy 49c93b6027
Merge pull request #1598 from coder2020official/master
Fix typehint for set_state
2022-06-30 15:32:30 +03:00
_run 36749cbdd9
Merge branch 'eternnoir:master' into master 2022-06-30 17:10:25 +05:00
_run 6d12b1f2a7
Update callback_data.py 2022-06-30 17:10:14 +05:00
_run 419bc5878f Fix typehint for ```set_state``` 2022-06-30 17:06:39 +05:00
Badiboy b9b4885568
Merge pull request #1597 from Badiboy/master
Copyright update
2022-06-29 19:25:40 +03:00
Badiboy ce0a974c91 Copyright update 2022-06-29 19:24:27 +03:00
_run c36f3a228e Update callback_data.py 2022-06-29 21:17:57 +05:00
_run ca525b5bea Copyright changes 2022-06-29 21:06:36 +05:00
Badiboy 6ff015689a
Merge pull request #1595 from coder2020official/master
Add the possibility to getbase class of a State object
2022-06-29 18:34:06 +03:00
_run 6459aded82
Merge branch 'eternnoir:master' into master 2022-06-29 20:22:59 +05:00
_run fec47cecaf Add the possibility to getbase class of a State object 2022-06-29 20:21:42 +05:00
Badiboy 3892b0fb80
Merge pull request #1593 from coder2020official/master
Fixed previous fix 🤦‍♂️
2022-06-29 12:58:43 +03:00
_run fbb9a73fc0 F###, forgot to put await 2022-06-29 14:52:37 +05:00
Badiboy db5c53b8e5
Merge pull request #1591 from coder2020official/master
Pass only the necessary data
2022-06-28 17:58:35 +03:00
_run 6e8abc709e Pass only the necessary data 2022-06-28 19:51:51 +05:00
Badiboy 752f35614c
Merge pull request #1587 from coder2020official/master
Middleware update: everything in data will be passed to handler if ne…
2022-06-26 12:09:38 +03:00
_run a2893945b2 Async changes and sync improvements 2022-06-25 22:15:53 +05:00
_run 1686ce4f44 Middleware update: everything in data will be passed to handler if needed. 2022-06-25 21:48:44 +05:00
Badiboy 24b1129c8a
Merge pull request #1584 from coder2020official/master
Bot API 6.1 update
2022-06-23 10:50:39 +03:00
coder2020official 7f9dac4147 Fix previous commit 2022-06-23 12:46:27 +05:00
Badiboy f96775e9eb
Merge pull request #1585 from Prikalel/master
Rename `midddleware` to `middleware` in examples.
2022-06-23 10:41:20 +03:00
coder2020official 1342cab259 Fix boolean parameters 2022-06-23 12:05:26 +05:00
Alex Poklonsky dd8125cbd0
Rename `midddleware` to `middleware` in examples. 2022-06-23 09:09:37 +03:00
coder2020official 8769802744 Bump version to 4.6.0 2022-06-21 15:44:42 +05:00
coder2020official a7fb8a2bec Implemented some tests 2022-06-21 15:28:01 +05:00
coder2020official d7f34ae370 Fix the typo 2022-06-21 15:27:45 +05:00
coder2020official 7d931abe37 Added secret token and create_invoice_link for asynctelebot 2022-06-21 15:22:00 +05:00
coder2020official f52124827f Added all new changes for types (is_premium, added_to_attachment_menu, and etc) 2022-06-21 15:21:35 +05:00
coder2020official 0d0f9ef330 Added secret token and create_invoice_link 2022-06-21 15:20:55 +05:00
_run 24cdcb1bcc
Update README.md 2022-06-21 14:22:57 +05:00
Badiboy 7994a80a00
Merge pull request #1580 from e323w/master
Fixed async long polling
2022-06-15 11:21:12 +03:00
e323w b2662274f9 Fixed async long polling 2022-06-15 03:24:51 +04:00
Badiboy a21ab203a1
Merge pull request #1575 from coder2020official/bugfixes
Fix bug with unsaving data
2022-06-04 19:44:47 +03:00
coder2020official e689e968db Fix bug with unsaving data 2022-06-04 21:33:05 +05:00
Badiboy 808810e6d6
Merge pull request #1574 from Mayson90/master
add hydrolib_bot to Bots using this library
2022-06-01 19:14:59 +03:00
Andrey M 5a60846c7f add hydrolib_bot to Bots using this library 2022-06-01 19:07:54 +03:00
Badiboy d2c1615392
Merge pull request #1573 from tusharhero/master
Added my bot made using pyTelegramBotAPI
2022-06-01 10:56:01 +03:00
Tushar maharana 7cdb48c3e0
brought my bot ot end 2022-06-01 10:22:22 +05:30
Tushar maharana 28ae0867f8
Added my bot made using pyTelegramBotAPI
source code available here 
https://github.com/tusharhero/bincode-telegram-bot
2022-05-31 22:58:03 +05:30
Badiboy e84cc0e0af
Merge pull request #1571 from TECH-SAVVY-GUY/patch-1
Added `WebApp` functions
2022-05-30 15:25:05 +03:00
Soham Datta 42ce47914d
Fix typo in `WebApp()` functions 2022-05-30 17:21:33 +05:30
Soham Datta 4401780ba9
Update `WebApp()` functions
Adjusted function name case to pythonic style.
2022-05-30 17:18:03 +05:30
Soham Datta 82f056e88a
Added `WebApp` functions
`validate_WebApp_data()` - Use to validate the data received by the WebApp from Telegram.

`parse_WebApp_data()` - Use to parse the data sent to the WebApp from the bot's backend.
2022-05-30 14:52:49 +05:30
Badiboy 6b19d631d1
Merge pull request #1565 from DevAdvik/master
Update create_invite_link.py
2022-05-23 14:16:42 +03:00
Advik Singh Somvanshi ee7adb00df
Re-fix inlinekeyboardmarkup 2022-05-23 13:27:48 +05:30
Badiboy 82a8aa65f0
Merge pull request #1566 from coder2020official/master
More description for class-based middlewares in readme.
2022-05-22 11:21:49 +03:00
_run 72aaf44dc7
Update README.md 2022-05-22 01:50:38 +05:00
Advik Singh Somvanshi 1d0efce76e
Update create_invite_link.py
Fix
2022-05-22 02:17:21 +05:30
Advik Singh Somvanshi 74d0604c05
Update create_invite_link.py
Bug fix (Real FINAL FIX!!)
2022-05-22 01:54:02 +05:30
Badiboy 1943f659bc
Merge pull request #1561 from coder2020official/bugfixes
Aiohttp client session management improvements.
2022-05-21 23:22:29 +03:00
Advik Singh Somvanshi d6ec104829
Update create_invite_link.py
Imported both inline keyboards in same line:|
2022-05-22 01:48:48 +05:30
Advik Singh Somvanshi 7edaa51995
Update create_invite_link.py
Removed while loop
2022-05-22 01:43:24 +05:30
Advik Singh Somvanshi 6bb47e9a44
Update create_invite_link.py
Added .types while importing inline markup keyboards (fix)
Removed threading import since message is not to be deleted
2022-05-22 01:38:32 +05:30
coder2020official 8da749ee05 Remove ssl 2022-05-22 01:02:55 +05:00
coder2020official 0c59d1187e Update requirements.txt 2022-05-22 00:11:16 +05:00
Badiboy e9d1d98f03
Merge pull request #1562 from coder2020official/newfeatures
Added ability to hide a link in text
2022-05-21 16:51:51 +03:00
Badiboy c63b0d6a3d
Merge pull request #1560 from coder2020official/master
Changed behaviour of default parse mode in sync and async telebot.
2022-05-21 16:51:17 +03:00
coder2020official 388306b7fe Updated examples 2022-05-21 17:45:59 +05:00
coder2020official 5e3fd17436 Added ability to hide a link in text 2022-05-21 17:39:45 +05:00
coder2020official ccc09ffaf3 Aiohttp client session management improvements. 2022-05-21 17:38:16 +05:00
_run e086303535
Merge branch 'eternnoir:master' into master 2022-05-21 17:11:14 +05:00
coder2020official d6e93f85f1 Improved the comment for quick_markup 2022-05-21 17:10:57 +05:00
coder2020official d954f8f5b3 Fixed default parse mode in asynctelebot 2022-05-21 17:10:45 +05:00
coder2020official 33375ac135 Added ability to set default parse_mode for explanation_parse_mode in send_poll 2022-05-21 17:10:29 +05:00
coder2020official 28662876a2 Add workspace exception in gitignore 2022-05-21 17:09:59 +05:00
Badiboy 0f44fd3c40
Merge pull request #1558 from DevAdvik/master
Created create_invite_link.py
2022-05-20 22:48:10 +03:00
Advik Singh Somvanshi 8fefd7b5b3
Create create_invite_link.py
Added create_chat_invite_link() func example
2022-05-20 23:00:38 +05:30
Badiboy 7567750276
Merge pull request #1552 from m-cyx/patch-1
Small srtring formatter fix
2022-05-15 23:15:12 +03:00
m-cyx f526a9d8a4
Small srtring formatter fix 2022-05-15 22:46:15 +03:00
Badiboy feffe726dd
Merge pull request #1551 from everpcpc/patch-1
fix: warning none_stop parameter is deprecated
2022-05-15 10:57:59 +03:00
everpcpc 3ff7e28467
fix: warning none_stop parameter is deprecated 2022-05-15 14:29:29 +08:00
Badiboy 5d74e18d1a
Merge pull request #1550 from Badiboy/master
Poll type parameter parse fix
2022-05-15 01:06:04 +03:00
Badiboy 91b665ea94 Poll type parameter parse fix
Plus some typo
2022-05-15 00:59:35 +03:00
Badiboy 6e4c63b09c
Merge pull request #1549 from coder2020official/master
Set escape=True by default.
2022-05-14 19:27:44 +03:00
coder2020official 42efb8488c Set escape=True by default. 2022-05-14 20:32:28 +05:00
Badiboy 03a567ea93
Merge pull request #1548 from AHOHNMYC/copy-message-fix
CopyMessage return type fix
2022-05-14 16:30:29 +03:00
AHOHNMYC 3f28bb6e9d
CopyMessage return type fix [async] 2022-05-14 15:48:27 +03:00
AHOHNMYC e051dda113
CopyMessage return type fix 2022-05-14 15:46:05 +03:00
Badiboy 856debe7d2
Merge pull request #1542 from abdullaev388/master
Added examples of multibot
2022-05-13 15:11:39 +03:00
abdullaev388 42955d1886 added examples of multibot 2022-05-11 10:50:33 +05:00
Badiboy a2f3cd03e1
Merge pull request #1540 from Badiboy/master
class File parse fix
2022-05-08 23:39:00 +03:00
Badiboy 7e68721475 class File parse fix 2022-05-08 23:34:56 +03:00
Badiboy 7965ba4f69
Merge pull request #1538 from coder2020official/master
Fix typo in readme
2022-05-08 18:45:32 +03:00
Badiboy aba4d3e246
Merge pull request #1536 from atif5/master
Updated the "bots using this api" section in README
2022-05-08 18:45:07 +03:00
_run caae6bb93f
Update README.md 2022-05-08 18:13:07 +05:00
Burzum 096d7a4eea
Update README.md 2022-05-08 00:02:40 +03:00
Burzum ab4140ba9f
Update README.md 2022-05-08 00:01:45 +03:00
Burzum 77c3587012
Update README.md 2022-05-08 00:00:46 +03:00
Badiboy efb1b44e59
Merge pull request #1535 from Badiboy/master
Bump version to 4.5.1
2022-05-07 22:41:19 +03:00
Badiboy 2c8793b794 Bump version to 4.5.1 2022-05-07 22:40:26 +03:00
Badiboy 146fd57b10
Merge pull request #1531 from coder2020official/patch-3
Random unused import deleted
2022-05-05 09:26:57 +03:00
_run 8a12ae3565
Update redis_storage.py 2022-05-04 19:55:43 +05:00
Badiboy 2d8c2312e3
Merge pull request #1529 from coder2020official/state-fixes
Allow only state objects
2022-05-03 13:02:24 +03:00
coder2020official f9cd0d7e08 Avoid circular import 2022-05-02 14:45:43 +05:00
Badiboy 59cd1a00e7
Merge pull request #1528 from coder2020official/master
Seo improvements for documentation.
2022-05-02 00:30:55 +03:00
coder2020official 836130a718 Allow only state objects 2022-05-02 02:08:48 +05:00
_run a7db2d8d9c
Merge branch 'eternnoir:master' into master 2022-05-01 23:20:02 +05:00
coder2020official c022d49996 SEO improvements for documentation 2022-05-01 23:19:46 +05:00
Badiboy 825827cb1e
Merge pull request #1527 from coder2020official/proxy-fix
Fixed proxy for asynctelebot
2022-05-01 17:26:54 +03:00
_run cd92b70d6b
Update README.md 2022-05-01 19:13:49 +05:00
Badiboy 617c990994
Merge pull request #1526 from coder2020official/master
Key for custom filters
2022-05-01 17:01:37 +03:00
coder2020official 9b959373db Fixed proxy for asynctelebot 2022-05-01 18:43:07 +05:00
coder2020official 76c0197ab7 Key for custom filters 2022-05-01 16:11:00 +05:00
Badiboy 7d9658b062
Merge pull request #1525 from Badiboy/master
Polling exception logging updated
2022-05-01 14:00:50 +03:00
Badiboy db0c946780 Polling exception logging updated
Polling exception logging arranged with infinity_polling mode
2022-05-01 00:17:14 +03:00
Badiboy c6202da36f
Merge pull request #1524 from coder2020official/master
Markdown & Html functions added(Beta version, still in progress)
2022-04-30 23:43:53 +03:00
coder2020official 532011138c Added examples for formatting 2022-05-01 00:58:06 +05:00
coder2020official 191164cba0 Fix traceback 2022-05-01 00:45:34 +05:00
coder2020official 5688aaa03b Markdown & Html functions added(Beta version, still in progress) 2022-05-01 00:28:00 +05:00
Badiboy 88a76c0a15
Merge pull request #1521 from Badiboy/master
Mistake in ChatAdministratorRights
2022-04-24 23:42:51 +03:00
Badiboy e1dc6d7beb Mistake in ChatAdministratorRights 2022-04-24 23:41:08 +03:00
Badiboy 730d11012d
Merge pull request #1517 from Badiboy/master
Bugfix in answer_web_app_query
2022-04-24 11:40:42 +03:00
Badiboy b43b636ba0 Bugfix in answer_web_app_query 2022-04-24 11:33:19 +03:00
Badiboy a7ca6c057e
Merge pull request #1516 from Badiboy/master
i18n middleware - file revert
2022-04-24 11:29:47 +03:00
Badiboy bd002c6429 i18n middleware - file revert 2022-04-24 11:28:20 +03:00
Badiboy 453df01f26
Merge pull request #1511 from abdullaev388/master
Added sync i18n class based middleware
2022-04-24 11:27:12 +03:00
abdullaev388 24ae38cca6 added function based middleware i18n example 2022-04-24 12:51:01 +05:00
abdullaev388 3b386965ea sync middleware examples separated into two folders 2022-04-24 11:52:01 +05:00
Badiboy 5077289d0d
Merge pull request #1513 from Badiboy/master
typo
2022-04-23 20:20:17 +03:00
Badiboy a54b21cb50 type 2022-04-23 20:19:25 +03:00
Badiboy fa80cb0002
Merge pull request #1512 from Badiboy/master
Bot API 6.0. Deprecation fixes
2022-04-23 19:37:01 +03:00
Badiboy ad5b92b650 Remove incorrect deprecation 2022-04-23 19:35:38 +03:00
Badiboy 9b1b324ab4 Bump version to 4.5.0 2022-04-23 16:33:59 +03:00
Badiboy e444bc2a0b Payment example fix 2022-04-23 16:27:53 +03:00
Badiboy dd25432359 Bot API 6.0. Deprecation fixes 2022-04-23 15:03:54 +03:00
Badiboy cfbbfe84ad
Merge pull request #1501 from coder2020official/master
Prepare for Bot API 6.0
2022-04-23 14:10:26 +03:00
abdullaev388 b25d2846e9 TextFilter class supports case insensitiveness with lazy translations 2022-04-23 11:53:55 +05:00
abdullaev388 ab64e17464 added new i18n class based middleware 2022-04-23 11:48:58 +05:00
abdullaev388 3a5db47c1b removed old class based i18n middleware 2022-04-23 10:44:35 +05:00
coder2020official 4812dcb02b Fix typo in types.py 2022-04-22 23:06:11 +05:00
coder2020official b146df346d Indentation fix to fit documentation. 2022-04-17 16:46:38 +05:00
coder2020official 5f2713bcfb Merge branch 'master' of https://github.com/coder2020official/pyTelegramBotAPI 2022-04-17 16:39:14 +05:00
coder2020official a1bf961fd2 Bump Bot API 6.0(Beta) 2022-04-17 16:39:09 +05:00
_run a8451a5e30
Merge branch 'eternnoir:master' into master 2022-04-17 14:07:44 +05:00
Badiboy 9417c49d8e
Merge pull request #1502 from Badiboy/master
Bump version to 4.4.1
2022-04-16 23:22:30 +03:00
Badiboy 1a40f1da7a Bump version to 4.4.1 2022-04-16 23:21:25 +03:00
Badiboy 5e28f27764 Bump version to 4.4.1 2022-04-16 23:17:19 +03:00
_run 43d0e10ba4
Merge branch 'eternnoir:master' into master 2022-04-16 23:52:41 +05:00
_run 9652fdbecb
Update README.md 2022-04-16 23:50:45 +05:00
Badiboy 110575ca40
Merge pull request #1500 from coder2020official/master
Road to release(1st part)
2022-04-15 22:49:02 +03:00
coder2020official 22b4e636e2 Road to release(1st part) 2022-04-16 00:13:14 +05:00
Badiboy 1688a466f4
Merge pull request #1492 from nj-vs-vh/master
Issue #1491: missing await inserted
2022-04-01 18:54:37 +03:00
Igor Vaiman 625da4cdd9 missing await inserted 2022-03-27 18:32:05 +04:00
Badiboy a9e0f5b7b0
Merge pull request #1484 from coder2020official/master
Regular documentation update.
2022-03-21 01:36:15 +03:00
_run 7b1b1a7caa
Update PULL_REQUEST_TEMPLATE.md 2022-03-19 14:06:07 +05:00
coder2020official a6477541c0 Documentation incorrect display is fixed now. 2022-03-19 13:49:36 +05:00
_run b652a9f6dc
Update doc_req.txt 2022-03-19 13:26:09 +05:00
_run 73b2813512
Update doc_req.txt 2022-03-10 20:22:42 +05:00
Badiboy ace28983b6
Merge pull request #1475 from coder2020official/master
Fix
2022-03-08 22:53:55 +03:00
Badiboy e82675320c
Merge pull request #1474 from WuerfelDev/patch-1
Add TranslateThisVideoBot to the bot list
2022-03-08 22:53:13 +03:00
_run 1e88671799
Merge branch 'eternnoir:master' into master 2022-03-08 12:07:09 +05:00
coder2020official 1cdf9640d7 Fix example on chat_member, fix middleware-exception for async 2022-03-08 12:07:00 +05:00
Badiboy 91badb53e5
Merge pull request #1473 from coder2020official/master
Docstrings of sync telebot updated to fit documentation. Basic middleware classes added.
2022-03-07 20:00:55 +03:00
coder2020official 477d02468d Fixed middlewares 2022-03-07 21:40:39 +05:00
coder2020official 9f3a270fae Merge branch 'master' of https://github.com/coder2020official/pyTelegramBotAPI 2022-03-07 21:13:49 +05:00
coder2020official 244b058648 Fix 2022-03-07 21:13:30 +05:00
_run 886c9b9bc0
Update README.md 2022-03-07 20:38:22 +05:00
_run 41025ba97b
Update setup_python.yml 2022-03-07 20:26:11 +05:00
_run 4875bb6188
Update requirements.txt 2022-03-07 19:04:12 +05:00
_run 5f91c3d4e6
Added python 3.10 to tests 2022-03-07 18:56:16 +05:00
_run 7b62915a5b
Create PULL_REQUEST_TEMPLATE.md 2022-03-07 18:54:59 +05:00
_run 05c3cb2c1d
Update doc_req.txt 2022-03-07 18:08:41 +05:00
_run 60a96d1400
Update README.md 2022-03-07 17:42:47 +05:00
_run dcd0df93da
Update README.md 2022-03-07 17:39:42 +05:00
_run f15101fc6f
Update doc_req.txt 2022-03-07 17:32:42 +05:00
coder2020official 5f03253398 Fix comments 2022-03-07 17:31:02 +05:00
_run 8fab55e937
Create antiflood_middleware.py 2022-03-07 17:30:10 +05:00
_run 60a23665cb
Update flooding_middleware.py 2022-03-07 17:23:55 +05:00
_run b292b275cb
Create basic_example.py 2022-03-07 17:21:59 +05:00
_run 403028bf35
Update README.md 2022-03-07 17:14:51 +05:00
_run 3dda5cff06
Create README.md 2022-03-07 17:14:25 +05:00
coder2020official dd589e2490 Updated documentation to another theme. 2022-03-07 16:10:44 +05:00
coder2020official c8fb83c97c Fix documentation 2022-03-07 14:24:28 +05:00
coder2020official 854f6a9506 Merge branch 'master' of https://github.com/coder2020official/pyTelegramBotAPI 2022-03-07 13:30:41 +05:00
coder2020official be0557c2b5 Multiple middlewares allowed for async 2022-03-07 13:30:39 +05:00
WuerfelDev 436422e4da
TranslateThisVideo Bot 2022-03-06 22:29:57 +01:00
_run fc72576aaa
Update README.md 2022-03-07 00:39:25 +05:00
coder2020official f69a2ba044 Update docstrings for asynctelebot. 2022-03-07 00:18:11 +05:00
coder2020official c45e06c694 Updated description for TeleBot class 2022-03-06 23:23:33 +05:00
coder2020official 78bdf1ca4e Update docstrings 2022-03-06 23:14:07 +05:00
coder2020official 3c7d3c0196 Fix tests 2022-03-06 19:52:42 +05:00
coder2020official 441a5793cc Update docstrings to correct documentation. 2022-03-06 19:41:54 +05:00
coder2020official 388477686b Added middlewares.
Bumped middlewares
2022-03-06 18:39:41 +05:00
WuerfelDev 4f654d9e12
Add TranslateThisBot to the bot list 2022-03-06 04:26:40 +01:00
Badiboy ac12d0fc02
Merge pull request #1467 from coder2020official/master
CallbackQuery usage with states.
2022-03-02 11:56:13 +03:00
Badiboy b8ebe4fd58
Merge pull request #1469 from abdullaev388/master
argument of 'func' parameter in handlers can be async function
2022-03-01 18:11:20 +03:00
abdullaev388 c84896391e argument of 'func' parameter in handlers can be async function 2022-03-01 14:39:00 +05:00
_run 995e28e9d8
Remove unnecessary thing 2022-02-26 22:50:55 +05:00
coder2020official 1bfc082d46 Update documentation 2022-02-26 22:48:03 +05:00
coder2020official 1a35bbb127 Merge branch 'master' of https://github.com/coder2020official/pyTelegramBotAPI 2022-02-26 22:43:05 +05:00
coder2020official e585c77830 Fix 2022-02-26 22:43:03 +05:00
Badiboy 5ca92ff637
Merge pull request #1465 from coder2020official/master
Added isinstance checkups in state filters
2022-02-26 13:07:53 +03:00
_run f4c76553ed
Update asyncio_filters.py 2022-02-25 19:53:17 +05:00
_run 75baf6dd96
Update custom_filters.py 2022-02-25 19:52:56 +05:00
_run 301b9288a4
Merge branch 'eternnoir:master' into master 2022-02-25 19:47:50 +05:00
_run 70b9fc86d2
Update custom_filters.py 2022-02-25 19:46:49 +05:00
_run dde9cd323c
Update asyncio_filters.py 2022-02-25 19:45:52 +05:00
Badiboy 01a6827542
Merge pull request #1462 from coder2020official/master
Allow using non-class states
2022-02-23 11:32:01 +03:00
_run b960a9e574
Update custom_filters.py 2022-02-23 13:08:02 +05:00
_run 102fe3a8fb
Update asyncio_filters.py 2022-02-23 13:07:25 +05:00
Badiboy 292df419ba
Merge pull request #1456 from abdullaev388/master
I18N class for sync telebot and middleware for async
2022-02-22 22:37:13 +03:00
abdullaev388 7993e1d1c9 corrected setup middleware in async i18n middleware example 2022-02-21 20:08:03 +05:00
Badiboy 7309f92c36
Merge pull request #1459 from coder2020official/master
Fixed documentation and added link
2022-02-19 22:48:37 +03:00
_run 7875ff293d
Update README.md 2022-02-20 00:44:08 +05:00
_run 4adac4d852
Update quick_start.rst 2022-02-20 00:40:25 +05:00
abdullaev388 38bff65caf removed unused imports from util.py 2022-02-20 00:28:27 +05:00
Badiboy 9ecadf1bc1
Merge pull request #1458 from coder2020official/master
Bump documentation
2022-02-19 22:19:00 +03:00
abdullaev388 5d7ae385ec token removed. 2022-02-20 00:12:14 +05:00
abdullaev388 74e9780b30 BaseMiddleware returned to it's original place && I18N middleware is now only in examples 2022-02-20 00:08:14 +05:00
abdullaev388 9b20f41ece I18N class removed from telebot.util.py 2022-02-19 23:57:21 +05:00
Badiboy 967309120e
Merge pull request #1457 from Badiboy/master
Fix check of the regexp and commands types
2022-02-19 21:41:55 +03:00
Badiboy 94be2abdbd Typo 2022-02-19 21:39:52 +03:00
Badiboy 6c31b53cd9 Fix check of the regexp and commands types 2022-02-19 21:39:02 +03:00
abdullaev388 9bfc0b2c6f preventet breaking change 2022-02-19 23:37:03 +05:00
Badiboy fc374ec57a
Merge pull request #1454 from Troshchk/message_handler_checking
Additional check of the regexp and commands types
2022-02-19 21:33:30 +03:00
_run 7a8e60ddc2
Update index.rst 2022-02-19 22:41:09 +05:00
coder2020official 7f43f26886 Add telebot 2022-02-19 22:21:15 +05:00
coder2020official 4521982837 Create .readthedocs.yml 2022-02-19 22:17:29 +05:00
coder2020official 30c43b557c Documentation Bump 2022-02-19 21:56:51 +05:00
abdullaev388 10b5886dcc Completed I18N examples descriptions 2022-02-19 18:56:27 +05:00
abdullaev388 93b97fc3fe I18N middleware example was added 2022-02-19 18:47:36 +05:00
abdullaev388 1f6e60fd74 I18N middleware implementation was added 2022-02-19 16:25:46 +05:00
abdullaev388 5337d4838d asyncio_middlewares.py was created && BaseMiddleware class was replaced to asyncio_middlewares.py 2022-02-19 16:02:14 +05:00
abdullaev388 ae5d183db0 slight TextFilter class improvement 2022-02-19 15:53:58 +05:00
abdullaev388 0d85a34551 an example for i18n class was added 2022-02-19 15:07:46 +05:00
abdullaev388 002c608d45 i18n class was added 2022-02-19 15:04:31 +05:00
Troshchk ec766a3e43 Wrapping checking in private methods; warnings changed to errors 2022-02-16 14:05:54 +01:00
Badiboy 0ef8d04ed2
Merge pull request #1449 from abdullaev388/master
new advanced TextFilter was added && An example demostrating TextFilt…
2022-02-16 12:48:29 +03:00
abdullaev388 3a86916e72 example of TextFilter starts_with and ends_with usage simultaneously 2022-02-16 12:43:23 +05:00
abdullaev388 b41435f407 more descriptive exceptions 2022-02-16 12:29:27 +05:00
Badiboy f689d90815
Merge pull request #1455 from Badiboy/master
Fix timer_bot.py
2022-02-15 19:55:32 +03:00
Badiboy 966f2e7ef7
Fix timer_bot.py 2022-02-15 19:55:12 +03:00
Troshchk 9075430210 Making first condition shorter, no change in functionality 2022-02-15 15:46:02 +01:00
Troshchk 68095ad69a Adding checks for the commands and regexp input types 2022-02-15 15:24:55 +01:00
abdullaev388 8c3d1e608c new TextFilter examples were added 2022-02-12 21:53:40 +05:00
abdullaev388 6822f18cbb multiple check patterns && multiple startwith, endswith fields 2022-02-12 21:41:10 +05:00
abdullaev388 6e4f2e19d6 async text contains filter was fixed 2022-02-12 20:36:10 +05:00
abdullaev388 8bbd062d13 text contains filter was fixed 2022-02-12 20:31:02 +05:00
abdullaev388 5f7ccc8c9b created async TextFilter 2022-02-12 17:33:29 +05:00
abdullaev388 5b1483f646 removed TextFilterKey in example, instead TextMatchFilter was modified 2022-02-12 17:07:59 +05:00
abdullaev388 3cd86d0e93 token. again. 2022-02-12 15:31:54 +05:00
abdullaev388 a893fbc358 async advanced callback_data example was added 2022-02-12 15:30:04 +05:00
abdullaev388 6fd2a38fe9 An asyncio example demostrating TextFilter usage 2022-02-12 15:12:30 +05:00
abdullaev388 b89ecb3e5a modified code 2022-02-12 14:32:59 +05:00
abdullaev388 2e5590b566
token removed :) 2022-02-12 14:11:16 +05:00
abdullaev388 733bb2ebbb new advanced TextFilter was added && An example demostrating TextFilter usage 2022-02-12 13:35:52 +05:00
Badiboy 64a22457e2
Merge pull request #1446 from abdullaev388/master
New CallbackData example
2022-02-10 12:26:12 +03:00
abdullaev388 0c8e94d2c6 advanced usage of callbackdata was added 2022-02-10 13:43:19 +05:00
abdullaev388 b9436821e0 callbackdata examples were separated into a directory 2022-02-10 13:33:44 +05:00
Badiboy a8af9120de
Merge pull request #1444 from skelly37/patch-1
Update README.md
2022-02-09 09:51:24 +03:00
Kamil 0655a1f6b6
Update README.md
added my pyfram-telegram-bot
2022-02-09 00:27:18 +00:00
Badiboy 97dbedaa54
Fix &gt; 2022-02-07 00:57:33 +03:00
Badiboy 4028b44d07
Update README.md 2022-02-06 21:02:14 +03:00
Badiboy 661218c7e3
Merge pull request #1434 from coder2020official/master
Fix States
2022-02-02 13:57:08 +03:00
_run cd4a9add68 Fix States 2022-02-02 14:44:02 +04:00
Badiboy 7d2915c7f9
Merge pull request #1433 from Badiboy/master
Extend custom exception_handler behaviour
2022-02-02 10:40:58 +03:00
Badiboy ce56a035b5 Extend custom exception_handler behaviour 2022-02-01 23:58:57 +03:00
Badiboy 9fa79aabc0
Merge pull request #1432 from coder2020official/master
Bot API 5.7
2022-02-01 17:31:35 +03:00
_run 62fad9ca3a Fix tests 2022-02-01 18:16:53 +04:00
_run 388f055643 Merge branch 'master' of https://github.com/coder2020official/pyTelegramBotAPI 2022-02-01 17:43:52 +04:00
_run 71be20636a Bot API 5.7 2022-02-01 17:43:49 +04:00
_run 3b38d1b46e
Bot API 5.7 in readme 2022-02-01 14:51:36 +04:00
_run 1e0c2ea633
Update README.md 2022-02-01 14:50:36 +04:00
_run 4e7652be7a Bot API 5.7 2022-02-01 14:47:42 +04:00
Badiboy 723075d2da
Merge pull request #1430 from barbax7/wrong_setup
Installing storage and asyncio_storage
2022-02-01 09:33:22 +03:00
Andrea Barbagallo 7ba021871a Adding new way to install library 2022-01-31 23:09:18 +01:00
Andrea Barbagallo d7cb819502 Excluding tests and examples from packages to install 2022-01-31 22:58:52 +01:00
Andrea Barbagallo 5ee2aa77c6 storage and asyncio_storage were not installed with previews setup function 2022-01-31 22:53:31 +01:00
Badiboy 80cf5d8d5b
Merge pull request #1427 from barbax7/user
The output of get_me() is already an User object
2022-01-30 19:56:19 +03:00
Andrea Barbagallo 69277400b7 The output of get_me() is already an User object 2022-01-30 17:53:55 +01:00
Badiboy 8d380b4913
Merge pull request #1423 from coder2020official/master
Code template
2022-01-25 14:42:29 +03:00
_run 23d20e0753
Update README.md 2022-01-25 15:21:09 +04:00
_run 6fc7beba57
Update README.md 2022-01-25 15:18:12 +04:00
Badiboy 8d49d22074
Merge pull request #1422 from Badiboy/master
Code base cleanup
2022-01-25 10:27:10 +03:00
Badiboy 6aa97d055f Bump version to 4.4.0 2022-01-25 10:25:53 +03:00
Badiboy e55938e23a Keep python 3.6 check 2022-01-25 10:24:45 +03:00
Badiboy 4166fb229e Code base cleanup 2022-01-24 22:38:35 +03:00
Badiboy 2e9947277a
Merge pull request #1421 from coder2020official/master
RedisStorage, middleware fix, pass_bot parameter and more
2022-01-24 21:25:16 +03:00
_run c350ea0ced Comment fixes 2022-01-24 21:34:50 +04:00
_run 588b5c4d89 Fix parameter for example 2022-01-24 21:28:56 +04:00
_run 91d0877c61 Fix parameter name to fit 2022-01-24 21:28:10 +04:00
_run 8045ad56ea States Update 2022-01-24 21:24:56 +04:00
_run 124b07ee44 Create __init__.py 2022-01-24 19:08:34 +04:00
_run 195974ddc1 Fix 2022-01-24 18:33:59 +04:00
_run 2b081b42bb Merge branch 'master' of https://github.com/coder2020official/pyTelegramBotAPI 2022-01-24 18:31:44 +04:00
_run 321d241483 Delete types.py 2022-01-24 17:23:40 +04:00
_run ad4ff5835e
Merge branch 'eternnoir:master' into master 2022-01-24 17:15:35 +04:00
_run a3cda2e0ff Updated sync and async. Fixes and new features. 2022-01-24 17:15:04 +04:00
Badiboy cf2eb1fec7
Merge pull request #1418 from artyl/master
add default None for get_my_commands, examples for bot.set_my_commands
2022-01-21 22:48:11 +03:00
Artem Lavrenov 7eb759d1fd remove unused import 2022-01-21 22:25:06 +03:00
Artem Lavrenov a07bf86c30 add default None for get_my_commands parameters scope and language_code sync\async, add examples for bot.set_my_commands 2022-01-21 21:50:33 +03:00
Badiboy 64c4aca3b7
Merge pull request #1417 from artyl/master
Add timer_bot sync and async example
2022-01-21 14:47:59 +03:00
Artem Lavrenov 40465643b9 Add timer_bot sync and async example 2022-01-21 12:32:23 +03:00
Badiboy 56fbf491bc
Merge pull request #1411 from studentenherz/master
Removed redundant logger configuration in async_telebot
2022-01-12 10:26:35 +03:00
Michel Romero Rodríguez 685c071056 Removed redundant logger configuration in async_telebot that made logs repeated twice 2022-01-11 19:24:16 -03:00
Badiboy fdbc0e6a61
Merge pull request #1410 from barbax7/patch-1
Correct test for antiflood function
2022-01-10 18:36:15 +03:00
Andrea Barbagallo 7fe8d27686
Correct test for antiflood function 2022-01-10 16:19:21 +01:00
Badiboy 9050f4af1f
Merge pull request #1409 from Badiboy/master
Bugfix in send_data
2022-01-10 16:51:44 +03:00
Badiboy 9140044956 Tests ant type hint fix 2022-01-10 16:49:49 +03:00
Badiboy 2e6b6bda53 Additional bugfix
Additional bugfix
Plus protected methods removal
2022-01-10 16:40:33 +03:00
Badiboy 8d8aa5a380 Bugfix in send_data
Bugfix in send_data
Protected methods renamed
Some hints added
2022-01-10 14:38:28 +03:00
Badiboy ae2dbd00fa
Merge pull request #1405 from Badiboy/master
Bump version to 4.3.0
2022-01-08 20:03:30 +03:00
Badiboy 6550a5d745 Bump version to 4.3.0 2022-01-08 20:02:54 +03:00
Badiboy 593b27358b
Merge pull request #1404 from coder2020official/master
Create webhook_fastapi_echo_bot.py
2022-01-03 23:01:37 +03:00
_run a51ff0f100
Fix readme typos 2022-01-03 16:30:49 +04:00
_run a96bc802bc
Update README.md 2022-01-03 16:28:24 +04:00
_run df8f34e726 Create webhook_fastapi_echo_bot.py 2022-01-03 16:16:19 +04:00
Badiboy 00998ac9c8
Merge pull request #1402 from coder2020official/master
Push bot API to 5.6
2022-01-02 23:26:01 +03:00
_run 3f243c64ca Fix data-typo 2022-01-02 22:09:09 +04:00
_run 034241ba31 Fix commit 2022-01-02 14:58:15 +04:00
_run ed6fb57cb5 Added protect_content parameter to all methods 2022-01-02 14:53:47 +04:00
_run b71507387f Added spoiler 2022-01-02 14:12:15 +04:00
_run e7d0ec1f6c Fix asyncio_helper.py 2021-12-31 19:25:29 +04:00
_run b3b318fd28 Delete asyncio_types.py 2021-12-31 15:14:42 +04:00
_run d334f5cb8d Added protect_content parameter. Remade some methods. 2021-12-31 15:05:40 +04:00
_run 7f06424980
Update README.md 2021-12-31 13:20:54 +04:00
Badiboy 7490aa0d26
Merge pull request #1400 from Badiboy/master
send_document param type fix
2021-12-25 16:26:50 +03:00
Badiboy e59e2ee2ee send_document param type fix 2021-12-25 16:23:26 +03:00
Badiboy f25dcad10c
Merge pull request #1399 from coder2020official/master
_make_request edited
2021-12-25 15:32:51 +03:00
_run 24a9491ec0 _make_request function edited 2021-12-25 16:04:29 +04:00
Badiboy 744549defe
Merge pull request #1397 from EnriqueMoran/master
Added bot using pyTelegramBotAPI to readme
2021-12-23 23:38:03 +03:00
Enrique-Moran c86fc4c3fa Added bot to readme 2021-12-23 12:31:01 -08:00
Badiboy 943396767c
Merge pull request #1392 from studentenherz/master
Added bot using pyTelegramBotAPI
2021-12-13 10:07:39 +03:00
Michel Romero Rodríguez 13fffe58a1
Added bot using pyTelegramBotAPI 2021-12-12 23:23:52 -03:00
Badiboy 7fe60e19ef
Merge pull request #1390 from coder2020official/master
Update README.md
2021-12-12 14:11:51 +03:00
_run ba9bf17f46
Update README.md 2021-12-12 15:54:06 +05:00
Badiboy 373ee4b45b
Merge pull request #1389 from coder2020official/master
Polling is now asynchronous, and some readme fixes.
2021-12-12 13:28:57 +03:00
_run e5f0ba67fc Merge branch 'master' of https://github.com/coder2020official/pyTelegramBotAPI 2021-12-12 15:13:10 +05:00
_run 096d58ae71 Update admin_filter_example.py 2021-12-12 15:13:07 +05:00
_run ed5b47cb96
Update README.md 2021-12-12 15:11:42 +05:00
_run e92946301f Asyncio.run back 2021-12-12 15:07:30 +05:00
Badiboy 7588c9fb9f
infinity_polling 2021-12-10 21:32:57 +03:00
Badiboy 6d10bfefbd
Merge pull request #1386 from zeph1997/master
Create a template for QWERTY custom keyboard an example for ReplyKeyboardMarkup
2021-12-10 21:32:19 +03:00
zeph1997 cebfbb83fa Merge branch 'master' of https://github.com/zeph1997/pyTelegramBotAPI 2021-12-11 02:28:41 +08:00
zeph1997 5a06d8021b changed markup.add row from hardcoded index to *row 2021-12-11 02:28:19 +08:00
zeph1997 a75841aa8e
Merge branch 'eternnoir:master' into master 2021-12-11 02:11:44 +08:00
zeph1997 e76649bb49 Create reply_keyboard_markup_example.py
Example to show how to use ReplyKeyboardMarkup as well as a template for a QWERTY keyboard
2021-12-11 02:11:15 +08:00
Badiboy 7567c6cd71
Merge pull request #1384 from Badiboy/master
Bump version to 4.2.2
2021-12-08 23:45:27 +03:00
Badiboy 751deeafd7 Bump version to 4.2.2 2021-12-08 23:44:57 +03:00
Badiboy 3ebefa15bf
Merge pull request #1383 from coder2020official/master
Bot API 5.5
2021-12-08 13:19:56 +03:00
_run bb19687854 fix 2021-12-08 15:15:57 +05:00
_run 311eec6888 fix 2021-12-08 14:15:40 +05:00
_run 08fc32b70a Comment fix 2021-12-08 14:13:39 +05:00
_run 555257a3fe Documentation Bug fixed 2021-12-08 14:00:39 +05:00
_run 5a03ab62d0 Update test_types.py 2021-12-07 22:27:19 +05:00
_run 038be81db3 5.5 2021-12-07 22:17:51 +05:00
Badiboy fbf34f5953
Bump version to 4.2.1 - AsyncTeleBot alpha 2021-12-04 20:25:39 +03:00
Badiboy 4347dd3dd9
Merge pull request #1380 from coder2020official/master
2 new examples and behaviour change
2021-12-04 20:08:26 +03:00
_run d830ae0b15 Merge branch 'master' of https://github.com/coder2020official/pyTelegramBotAPI 2021-12-04 22:03:56 +05:00
_run 4f198bc6f5 Forgot to update file 2021-12-04 22:03:14 +05:00
_run 66615a41c4
Merge branch 'eternnoir:master' into master 2021-12-04 21:57:32 +05:00
_run a5ee5f816c Update README.md 2021-12-04 21:57:16 +05:00
_run fb52137bff 2 new examples 2021-12-04 21:54:26 +05:00
Badiboy 7ee07f4dc7
Merge pull request #1379 from Badiboy/master
Readme
2021-12-04 19:44:00 +03:00
Badiboy f224069a34 Update README.md 2021-12-04 19:43:33 +03:00
Badiboy 6cca77f755 Update README.md 2021-12-04 19:43:01 +03:00
Badiboy 084289baa4
Merge pull request #1378 from Badiboy/master
Readme minor fixed
2021-12-04 19:42:08 +03:00
Badiboy e2dbb88459 Readme minor fixed 2021-12-04 19:41:25 +03:00
_run a2822c74ed
Update README.md 2021-12-04 21:34:15 +05:00
Badiboy 4cd30c75ac
Merge pull request #1377 from coder2020official/master
Exception handler, Boolean Fix and more
2021-12-04 19:33:53 +03:00
_run f4b9480588
Update README.md 2021-12-04 21:25:47 +05:00
_run 482589af49
Update README.md 2021-12-04 21:25:14 +05:00
_run bbe4a96984
Update README.md 2021-12-04 21:23:23 +05:00
_run 60294d0c41
Update README.md 2021-12-04 21:22:44 +05:00
_run 3035763277 Update send_file_example.py 2021-12-04 21:22:00 +05:00
_run 51eabde320 Update 2021-12-04 21:11:51 +05:00
_run a5305f551c
Update README.md 2021-12-03 21:13:02 +05:00
Badiboy 1f918dece5
Merge pull request #1375 from coder2020official/master
Forgot to make polling sync
2021-11-27 23:12:15 +03:00
_run fc152f37ad
Merge branch 'eternnoir:master' into master 2021-11-28 01:05:11 +05:00
_run 411c7e915a No asyncio.run() 2021-11-28 01:04:49 +05:00
Badiboy 5bf2415653
Merge pull request #1374 from Badiboy/master
Python 3.10 added
2021-11-27 22:30:25 +03:00
Badiboy 7d9856dae3 Python 3.10 added 2021-11-27 22:29:57 +03:00
Badiboy a308ab12fa
Asynchronous TeleBot version Alpha release 2021-11-27 22:28:46 +03:00
_run d58336adcb Fix 2021-11-28 00:25:56 +05:00
_run bfc0b8ecd5 Update async_telebot.py 2021-11-28 00:21:09 +05:00
_run a9b422783f Middlewares, new file, and examples 2021-11-27 23:41:39 +05:00
Badiboy e015b4c010
Merge pull request #1373 from Carlosma7/master
Add GrandQuiz Bot by Carlosma7
2021-11-27 18:49:05 +03:00
Carlos Morales Aguilera f666c15a1f
Add GrandQuiz Bot by Carlosma7 2021-11-27 16:32:58 +01:00
_run 6770011dd7 Middleware support 2021-11-27 19:04:03 +05:00
_run d7b0513fb1
Merge branch 'eternnoir:master' into master 2021-11-26 21:05:05 +05:00
Badiboy 9932ade00e
Merge pull request #1369 from abdullaev388/master
CallbackData class added
2021-11-24 18:32:42 +03:00
abdullaev 8b6eba8203 Docstrings added 2021-11-24 20:26:58 +05:00
abdullaev 9c8ea29fc6 token removed :) 2021-11-23 18:15:52 +05:00
abdullaev 714ae7d67f CallbackData class added 2021-11-23 18:01:51 +05:00
_run 1e4477c148 Logging fix 2021-11-20 16:01:38 +05:00
_run 53f9232f36 Update requirements.txt 2021-11-20 15:54:43 +05:00
_run 1f05b47ad6 Asynchronous Telebot 2021-11-20 15:47:55 +05:00
Badiboy 98d63d235f
Merge pull request #1360 from JoachimStanislaus/master
added Google Sheet bot to list of bot examples.
2021-11-11 12:40:36 +03:00
JoachimStanislaus 7925bdc6c9 added Google Sheet bot to list of bot examples. 2021-11-11 17:21:56 +08:00
Badiboy 4ba23562ef
Merge pull request #1358 from Badiboy/master
Update readme and typo
2021-11-08 19:11:11 +03:00
Badiboy e22a7fecea One more readme update... 2021-11-08 18:53:10 +03:00
Badiboy 9b99bb5f21 Update readme and typo 2021-11-08 18:51:42 +03:00
Badiboy c39b3aaaf3
Merge pull request #1357 from Badiboy/master
Bump to version 4.2.0
2021-11-08 18:37:03 +03:00
Badiboy d14ac2fe85 Bump to version 4.2.0 2021-11-08 18:35:55 +03:00
Badiboy 04f3e518da Merge remote-tracking branch 'upstream/master' 2021-11-08 18:33:10 +03:00
Badiboy 5f5298bcd1
Merge pull request #1356 from Badiboy/master
RETRY_ENGINE
2021-11-08 18:33:00 +03:00
Badiboy 7f1497c5e9 Merge remote-tracking branch 'upstream/master' 2021-11-08 18:32:38 +03:00
Badiboy 5ac71baafe RETRY_ENGINE
Added RETRY_ENGINE var to api_helper.

Added RETRY_ENGINE = 2 based on native "requests" retry mechanism.
2021-11-07 23:02:23 +03:00
Badiboy 695c699893
Merge pull request #1353 from coder2020official/master
Bot API 5.4 features
2021-11-06 18:02:01 +03:00
_run bf96f13296 Merge branch 'master' of https://github.com/coder2020official/pyTelegramBotAPI 2021-11-06 19:59:59 +05:00
_run 62b1ec04ab Update __init__.py 2021-11-06 19:59:44 +05:00
_run e412d2f084
Update README.md 2021-11-06 19:56:10 +05:00
_run 8003ff5e59 Delete states.pkl 2021-11-06 19:51:29 +05:00
_run becce1f580 Update apihelper.py 2021-11-06 19:51:05 +05:00
_run 3a6073e3a0 Update custom_states.py 2021-11-06 13:08:49 +05:00
_run fc347ae166 Update custom_states.py 2021-11-06 13:06:43 +05:00
_run 8dcfa0c282 Little fix for states 2021-11-06 12:52:41 +05:00
_run 6808ab3ebe Update test_types.py 2021-11-06 12:42:48 +05:00
_run 31097c5380 Update test_types.py 2021-11-06 12:34:49 +05:00
_run d49c57699e Tests 2021-11-06 12:27:19 +05:00
_run ed6616e4c7 Bot API 5.4 2021-11-06 12:21:02 +05:00
_run 953e2286b8 Bot API 5.4 2021-11-06 12:15:28 +05:00
_run 06c8782127 Little update
Allowed other handlers, checked methods and other things
2021-11-05 23:22:03 +05:00
Badiboy 2623fa362c
Merge pull request #1350 from Badiboy/master
Custom request sender
2021-11-03 18:50:25 +03:00
Badiboy 4a274ba440 Custom request sender
Added apihelper.CUSTOM_REQUEST_SENDER option. It allows to substitute requests.request to your own function.
2021-11-03 18:48:46 +03:00
Badiboy bfef7e1ce2
Merge pull request #1349 from barbax7/antiflood
Antiflood
2021-11-03 17:38:32 +03:00
Andrea Barbagallo 558b37b1c3 New antiflood function 2021-11-03 15:30:10 +01:00
Badiboy d1c26f82aa
Merge pull request #1346 from DevAdvik/patch-1
Added A New Bot - @ETHGasFeeTrackerBot
2021-10-24 19:09:04 +03:00
Advik Singh Somvanshi 1a351bc8c7
Added A New Bot 2021-10-24 20:38:15 +05:30
Badiboy 27546daad9
Merge pull request #1345 from resinprotein2333/patch-1
Update README.md
2021-10-24 11:48:02 +03:00
resinprotein2333 bb58d3fead
Update README.md
Add my bot into the bot list
2021-10-24 16:45:49 +08:00
Badiboy 099d638a7e
Merge pull request #1338 from barbax7/exceptions
Added description of the ApiTelegramException as attribute of the class
2021-10-17 11:29:44 +03:00
Andrea Barbagallo 5fb48e68a0 Added description of the ApiTelegramException as attribute of the class 2021-10-16 17:45:15 +02:00
Badiboy b979c2fa1f
Merge pull request #1336 from coder2020official/master
File support for states
2021-10-14 17:23:43 +03:00
_run b6625baec6 Update __init__.py 2021-10-13 19:02:17 +05:00
_run 98044d6faa File support for states
File support. Now states can be saved in pickle file
2021-10-13 18:34:36 +05:00
Badiboy 2113846567
Merge pull request #1330 from Badiboy/master
Bump version 4.1.1
2021-10-09 22:31:59 +03:00
Badiboy 5c9d4edca9 Bump version 4.1.1 2021-10-09 22:31:34 +03:00
Badiboy 4dce9340b0
Merge pull request #1326 from TrevorWinstral/master
Added my bots to README
2021-10-08 13:45:24 +03:00
TrevorWinstral bf79e8341e
Moved bots to bottom of list 2021-10-08 10:39:59 +00:00
TrevorWinstral dadfdc2f13 Updated README with my bots 2021-10-06 14:15:30 +02:00
TrevorWinstral 585f627e1f Updated README with my bots 2021-10-06 14:14:05 +02:00
TrevorWinstral eead303d47 Updated README with my bots 2021-10-06 14:13:05 +02:00
Badiboy 14cc15c711
Merge pull request #1325 from coder2020official/master
Critical fix
2021-10-01 21:47:50 +03:00
_run bf8736e17e Critical fix 2021-10-01 23:29:59 +05:00
Badiboy 5014ca2459
Merge pull request #1324 from coder2020official/master
Update of state handlers
2021-10-01 14:55:09 +03:00
_run f337abe06e Update __init__.py 2021-10-01 16:09:20 +05:00
_run ff35f25211 Update __init__.py 2021-10-01 16:08:01 +05:00
_run 2e4280a947 Update of state handlers
No need to create state handlers
2021-10-01 15:56:54 +05:00
Badiboy 4a6b5b3d28
Merge pull request #1322 from Badiboy/master
Bugfix with one_time_keyboard = False
2021-09-30 11:57:54 +03:00
Badiboy a28af3903d Bugfix with one_time_keyboard = False 2021-09-30 11:56:36 +03:00
Badiboy d1d5b9effb
Merge pull request #1320 from Badiboy/master
polling should leave our world. :)
2021-09-28 19:18:32 +03:00
Badiboy 062fababf2 polling should leave our world. :) 2021-09-28 19:17:09 +03:00
Badiboy 946afcc3c1
Merge pull request #1317 from coder2020official/master
Update handler_backends.py
2021-09-25 21:35:25 +03:00
_run 6e502cd1c6
Merge branch 'master' into master 2021-09-25 23:29:50 +05:00
Badiboy 0a7f897f05
Merge pull request #1318 from Badiboy/master
States minor update
2021-09-25 21:15:52 +03:00
Badiboy b35f17124f States minor update 2021-09-25 21:15:24 +03:00
_run 44b44ac2c5 Optimization 2021-09-25 23:05:36 +05:00
_run 39e875c1ea Update handler_backends.py 2021-09-25 22:49:32 +05:00
Badiboy be7317cc86
Merge pull request #1315 from coder2020official/master
States, New filter, and more
2021-09-25 20:43:33 +03:00
Badiboy e1c33a1de6
Merge pull request #1316 from Badiboy/master
Release 4.1.0
2021-09-25 20:34:05 +03:00
Badiboy 8149551a15 Release 4.1.0 2021-09-25 20:33:32 +03:00
_run ab648ef3db Merge branch 'master' of https://github.com/coder2020official/pyTelegramBotAPI 2021-09-25 22:19:09 +05:00
_run e721910c0c Update __init__.py 2021-09-25 22:19:07 +05:00
_run 9287eced49
Update a typo 2021-09-25 21:10:29 +05:00
_run 967b94b14f Update handler_backends.py 2021-09-25 20:27:03 +05:00
_run 2df6f00ba5 Optimization
Optimized code, added filters support
2021-09-25 18:22:54 +05:00
_run beb4f8df44 Update register_handler.py 2021-09-25 17:15:33 +05:00
_run 92ac5a4166 States, and some minor improvements 2021-09-25 17:12:32 +05:00
_run 716323e56a Register_XXX_Handler 2021-09-22 22:46:19 +05:00
_run cd92d95f91 Create admin_filter_example.py 2021-09-22 22:37:57 +05:00
_run 9c86ed623d Update custom_filters.py 2021-09-22 22:37:18 +05:00
Badiboy c6ff9b07df
Merge pull request #1311 from SwissCorePy/master
added property `user` to TeleBot class
2021-09-20 15:40:14 +03:00
SwissCorePy 38cc96d0f3 added property `user` to TeleBot class
Added property `user` to TeleBot class. The idea is to have easy access to the user object representing the bot without doing an API call every time.
2021-09-20 14:31:00 +02:00
Badiboy 82518d8664
Merge pull request #1309 from bim-ba/master
Added new example: anonymous chat-bot
2021-09-19 17:50:51 +03:00
bim-ba aba2a9e179
Improve readabilty of "elif-zone" 2021-09-19 17:41:07 +03:00
bim-ba c5c4d081ea Added new example: anonymous chat-bot 2021-09-18 19:46:53 +03:00
Badiboy f854163626
Merge pull request #1308 from coder2020official/master
Added example and editd description.
2021-09-14 13:08:45 +03:00
coder2020official fc31a2d466 Update custom_filters.py 2021-09-14 15:02:54 +05:00
coder2020official 86a0a8cd68 Little fixes and example
Fixed is_forwarded custom filter & created example
2021-09-14 15:00:27 +05:00
Badiboy 31c3b3b28e
Merge pull request #1307 from coder2020official/master
Update custom_filters.py
2021-09-13 23:26:40 +03:00
coder2020official b95ab104e3 Update custom_filters.py 2021-09-13 23:09:06 +05:00
Badiboy a54e4c22a8
Merge pull request #1305 from Badiboy/master
4.0.1 beta release
2021-09-12 21:13:38 +03:00
Badiboy 7913e25be2 4.0.1 beta release 2021-09-12 21:12:19 +03:00
Badiboy 63cbda8890
Merge pull request #1304 from Badiboy/master
README contents update
2021-09-12 20:53:04 +03:00
Badiboy 38851bce22 README contents update 2021-09-12 20:02:49 +03:00
Badiboy 74835c40ea
Merge pull request #1303 from Badiboy/master
Update custom filters readme and examples
2021-09-12 19:42:36 +03:00
Badiboy 97e99b4910 Fix 2021-09-12 19:39:26 +03:00
Badiboy 4ced4d29f5 Update custom filters readme and examples 2021-09-12 19:36:23 +03:00
Badiboy 239a90de14
Merge pull request #1302 from coder2020official/master
Some useful filters
2021-09-12 19:14:46 +03:00
_run c86af0496b
Update README.md 2021-09-12 20:43:09 +05:00
_run 4071ab9124
Update README.md 2021-09-12 20:41:26 +05:00
_run 5c715dabc3
Update README.md 2021-09-12 20:40:31 +05:00
_run 43d2d8583e
Update README.md 2021-09-12 20:32:16 +05:00
_run cf78234e3a
Update README.md 2021-09-12 20:30:32 +05:00
_run 5f4cd09490
Update README.md 2021-09-12 20:28:46 +05:00
_run 8534804c0c
Update README.md 2021-09-12 20:28:01 +05:00
_run cf75e76e5c
Update README.md 2021-09-12 20:27:01 +05:00
coder2020official 7d5e9e5111 Added file custom_filters
Added file with custom filters. Updated the examples
2021-09-12 20:22:26 +05:00
coder2020official 1ceec3cb54 Update custom_filters.py 2021-09-12 19:38:54 +05:00
coder2020official 5f8c75816e Some useful filters
Created useful filters that can be used in message handlers.
Created some examples on using them.
2021-09-12 19:34:43 +05:00
coder2020official 4e37662ab3 upd 2021-09-12 00:30:56 +05:00
Badiboy a97a917522
Merge pull request #1301 from coder2020official/master
Custom filters example
2021-09-11 22:30:50 +03:00
coder2020official 88f91518c7 Update __init__.py 2021-09-12 00:27:51 +05:00
coder2020official e89acc8ba6 Update custom_filters.py 2021-09-12 00:27:04 +05:00
coder2020official 5d611ea7f3 upd 2021-09-12 00:24:52 +05:00
coder2020official 5c80f11261 Updated __init__.py 2021-09-12 00:21:35 +05:00
Badiboy f2202b44fe
Merge pull request #1300 from Badiboy/master
Custom filters upd
2021-09-11 21:51:09 +03:00
Badiboy 2da48c0adc Custom filters upd 2021-09-11 21:49:51 +03:00
Badiboy 389407e3ee
Merge pull request #1299 from Badiboy/master
Custom filters upd
2021-09-11 21:14:43 +03:00
Badiboy 14be2b8c18 Custom filters upd 2021-09-11 21:10:21 +03:00
Badiboy df7808264f
Merge pull request #1298 from coder2020official/master
Custom filters
2021-09-11 21:03:28 +03:00
coder2020official 9d37503442 reupdated 2021-09-11 23:02:56 +05:00
Badiboy dd6f39c3cd
Merge pull request #1296 from Badiboy/master
Filter clearance
2021-09-11 20:57:55 +03:00
coder2020official 8e4d70b9c6 Update __init__.py 2021-09-11 22:30:53 +05:00
coder2020official 87fb30d57b Update __init__.py 2021-09-11 22:03:37 +05:00
coder2020official 8f3371dcd5 Update __init__.py 2021-09-11 21:59:28 +05:00
coder2020official ec8975c9e3 Custom filters
Added new feature - from now you can create your own custom filters
2021-09-11 21:47:59 +05:00
Badiboy 16edfbb9dc Warning if commands or content_types filters are strings 2021-09-11 19:26:55 +03:00
Badiboy f70b135359 Filter clearance
1. Filter optimization: should not store empty filters
2. Filter order: chat_type, content, others
3. Default session timeout set to 600 instead of "forever".
4. Type
2021-09-11 17:02:40 +03:00
Badiboy 78fb69ded1
Merge pull request #1295 from coder2020official/master
is_private filter
2021-09-10 22:17:05 +03:00
_run 0f7eb1571e
Update README.md 2021-09-10 20:42:48 +05:00
coder2020official ac54b7abd4 Merge branch 'master' of https://github.com/coder2020official/pyTelegramBotAPI 2021-09-10 20:42:51 +05:00
coder2020official 0f3a6393fc Update __init__.py 2021-09-10 20:42:43 +05:00
_run de6f339cdf
Update README.md 2021-09-10 17:57:19 +05:00
coder2020official d0969bd5f3 Merge branch 'master' of https://github.com/coder2020official/pyTelegramBotAPI 2021-09-10 17:57:13 +05:00
coder2020official 4035a38507 Update __init__.py 2021-09-10 17:56:44 +05:00
_run 944b077c65
Update README.md 2021-09-10 17:30:58 +05:00
coder2020official 644c6b9082 is_private 2021-09-10 17:30:17 +05:00
Badiboy dc9f8db556
Merge pull request #1288 from SwissCorePy/master
Added missing content_type "animation"
2021-09-02 22:34:51 +03:00
SwissCorePy 07ebdeab25 Added missing content_type "animation" 2021-09-02 19:46:01 +02:00
Badiboy e8738cce7d
Merge pull request #1284 from Badiboy/master
Bump version to 4.0 release
2021-08-30 13:50:32 +03:00
Badiboy d9e638a7df Bump version to 4.0 release 2021-08-30 13:49:28 +03:00
Badiboy 08b1dd31c8
Merge pull request #1277 from fgallaire/master
A Google Cloud Functions webhook
2021-08-25 15:19:51 +03:00
Florent Gallaire b4f0a6d546 add Google in the name 2021-08-25 14:17:25 +02:00
Florent Gallaire 4eb28df1ab A Google Cloud Functions webhook 2021-08-24 13:01:10 +02:00
Badiboy 50e5e96bb1
Merge pull request #1275 from Badiboy/master
chat_invite_link bugfix
2021-08-22 22:17:30 +03:00
Badiboy bd3a9bc350 chat_invite_link bugfix 2021-08-22 22:16:03 +03:00
Badiboy 06923c8274
Merge pull request #1272 from Badiboy/master
Simplify and speedup _test_filter
2021-08-20 15:55:10 +03:00
Badiboy 3efc2cf869 Typo 2021-08-19 23:36:37 +03:00
Badiboy f5de0eeacf Simplify and speedup _test_filter 2021-08-19 22:46:12 +03:00
Badiboy 6e871b8eb1
Merge pull request #1270 from Badiboy/master
Check and update for full compatibility to Bot API up to 5.3
2021-08-18 23:31:15 +03:00
Badiboy f6359bc32c Readme fix 2021-08-18 23:29:40 +03:00
Badiboy 2bc052ad5a Check and update for full compatibility to Bot API up to 5.3
Pre-release of 4.0.0
2021-08-18 23:27:28 +03:00
Badiboy 022ef6a64c Dependecies clearing 2021-08-18 22:16:30 +03:00
Badiboy 3232811543
Merge pull request #1269 from Badiboy/master
Check and update for full compatibility to Bot API up to 5.0
2021-08-18 22:01:12 +03:00
Badiboy fabcd93dd7 API update fix 03 2021-08-18 21:57:56 +03:00
Badiboy 8053183cb5 API update fix 02 2021-08-18 19:36:48 +03:00
Badiboy b2b7d90888 API update fix 01 2021-08-18 19:32:43 +03:00
Badiboy 3e9d73c25d Merge remote-tracking branch 'upstream/master' 2021-08-18 18:52:09 +03:00
Badiboy d6501ddc0e Check and update for full compatibility to Bot API up to 5.0 2021-08-18 18:47:38 +03:00
Badiboy e818e3875d
Merge pull request #1266 from coder2020official/master
New set of register_xxx_handler functions for dynamic handlers registering.
2021-08-17 16:50:00 +03:00
_run 56cd3971dc Update __init__.py 2021-08-16 22:41:27 +04:00
Badiboy 958ca34e9c
Merge pull request #1264 from coder2020official/master
Added skip_pending parameter to polling and infinity_polling in addition to skip_pending in Telebot.Init. Allows skip pending updates for already created Bot instances.
2021-08-16 21:07:41 +03:00
_run f4ef2366b6 Update skip_updates_example.py 2021-08-16 22:03:17 +04:00
_run f553960096 Update __init__.py 2021-08-16 22:00:08 +04:00
_run 24ef64456b Update __init__.py 2021-08-16 14:53:00 +04:00
_run 3e7da0fd18 Update skip_updates_example.py 2021-08-16 14:49:45 +04:00
_run 2c0f42b363 Update __init__.py 2021-08-16 14:48:21 +04:00
_run 1e4a6e2125 Update __init__.py 2021-08-15 13:32:11 +04:00
_run beeb60aab8 skip_updates 2021-08-15 11:40:13 +04:00
Badiboy 5b942a5b31
Merge pull request #1263 from coder2020official/master
Create chat_member_example.py
2021-08-14 17:55:15 +03:00
_run 3e4a6cd702 Create chat_member_example.py 2021-08-14 18:46:45 +04:00
Badiboy 0e369953cb
Merge pull request #1261 from Badiboy/master
BotCommandScopeChatMember fix
2021-08-12 15:17:11 +03:00
Badiboy 911e356930 BotCommandScopeChatMember fix 2021-08-12 15:16:04 +03:00
Badiboy 554b39a49a
Merge pull request #1257 from AmolDerickSoans/master
Add IPO bot
2021-08-06 14:48:51 +03:00
Amol Soans ea16f35432
Add IPO bot
Listed oneIPO bot created using pyTelegramBotAPI in  section : Bpts using this API
2021-08-06 12:29:00 +05:30
Badiboy 81d94687be
Merge pull request #1254 from snikidev/bug/InputInvoiceMessageContent-return-statement
🐛 Bugfix: Add return statement to to_dict() method inside InputInvoiceMessageContent type
2021-08-03 21:03:38 +03:00
snikidev 4ba4bc18cf add extra space 2021-08-03 17:35:59 +01:00
snikidev c117ff2d50 Add return statement to to_dict() method inside InputInvoiceMessageContent 2021-08-03 17:34:29 +01:00
Badiboy 735c224444
Merge pull request #1248 from coder2020official/master
caption_entities in edit_message_caption
2021-07-30 19:11:05 +03:00
coder2020official 81adfd335e UPD 2021-07-30 19:15:37 +05:00
coder2020official 7ebe589b46 Update __init__.py 2021-07-28 23:10:15 +05:00
coder2020official 9c1b19a9e4 upd 2021-07-28 23:06:31 +05:00
coder2020official 02b886465e new filters 2021-07-25 15:46:53 +05:00
Badiboy 2d89ceb745
Merge pull request #1241 from Badiboy/master
Release version 3.8.2
2021-07-21 21:54:29 +03:00
Badiboy ae8c3252df Release version 3.8.2 2021-07-21 21:53:56 +03:00
Badiboy 7914f71938
Merge pull request #1237 from monosans/comprehension
Replace for loops with comprehensions
2021-07-19 23:40:55 +03:00
monosans 097ba9fec2 Replace for loops with comprehensions 2021-07-19 20:03:03 +03:00
Badiboy d09d9f0c09
Merge pull request #1232 from Badiboy/master
Invoice tips typo fix
2021-07-15 09:27:49 +03:00
Badiboy 29c98b0230 Invoice tips typo fix 2021-07-15 09:27:07 +03:00
Badiboy 2b1db1f1b3
Merge pull request #1231 from vnagornyy/master
Added tip for invoice
2021-07-15 09:23:10 +03:00
Vladislav Nahorniy fa80b1dba0 Added tip for invoice 2021-07-15 08:56:04 +03:00
Badiboy b45db584df
Merge pull request #1230 from Badiboy/master
Fix worker_pool issue
2021-07-13 22:16:48 +03:00
Badiboy f52ea635e5 Fix worker_pool issue 2021-07-13 22:09:56 +03:00
Badiboy 9b56afd569
Merge pull request #1229 from Badiboy/master
Fix CallbackQuery issue for games
2021-07-13 20:13:36 +03:00
Badiboy 6fb10e92e4 Fix CallbackQuery issue for games 2021-07-13 20:11:47 +03:00
Badiboy fcf4d91564 Merge remote-tracking branch 'upstream/master' 2021-07-13 20:00:17 +03:00
Badiboy 38319871e6
Merge pull request #1225 from dannkunt/patch-1
Fix wrong type hint
2021-07-13 11:32:06 +03:00
dannkunt 2d0b092ea4
Fix wrong type hint
call.id gives int
2021-07-10 22:03:31 +03:00
Badiboy 060b8c61bb Merge remote-tracking branch 'upstream/master' 2021-07-09 10:50:53 +03:00
Badiboy db2accc2f8
Merge pull request #1223 from Badiboy/master
Timeouts in making requests are rethought
2021-07-09 10:50:46 +03:00
Badiboy 798fda4c8a Merge remote-tracking branch 'upstream/master' 2021-07-09 10:50:03 +03:00
Badiboy 2578e48134 Timeouts in making requests are rethought 2021-07-09 10:42:56 +03:00
Badiboy ac20216a7a
Merge pull request #1222 from Badiboy/master
Preserve dict change in de_json routines
2021-07-08 13:43:09 +03:00
Badiboy beb5a456eb Preserve dict change in Update 2021-07-08 09:35:48 +03:00
Badiboy 41faadd572
Merge pull request #1221 from AndydeCleyre/feature/mentioncolorcodebot
mention colorcodebot as a project using this library
2021-07-08 08:36:22 +03:00
Andy Kluger a15016d7d9 mention colorcodebot as a project using this library 2021-07-07 13:00:32 -04:00
Badiboy 47dd84c441
Merge pull request #1216 from SwissCorePy/master
fixed bug
2021-07-01 20:04:37 +03:00
SwissCorePy c7b360e982 fixed bug 2021-07-01 18:54:39 +02:00
Badiboy 09041b018f
Merge pull request #1215 from SwissCorePy/master
Added the property `difference` to the class ChatMemberUpdated
2021-06-30 17:33:13 +03:00
SwissCorePy 3a4cf47def Merge branch 'master' of https://github.com/SwissCorePy/pyTelegramBotAPI 2021-06-30 14:16:54 +02:00
SwissCorePy 56e4f68a83 added the property `difference` to ChatMemberUpdated 2021-06-30 14:16:38 +02:00
Badiboy 484e7fccbd
Merge pull request #1214 from SwissCorePy/master
new deprecated decorator
2021-06-30 15:01:46 +03:00
SwissCorePy 791d65e95a replaced old deprecated decorator 2021-06-30 13:47:39 +02:00
SwissCorePy 073d7fb6a7 Update util.py
whoops warn is not optional
2021-06-30 13:11:48 +02:00
SwissCorePy a6668397e1 new deprecated decorator
added a new deprecated decorator to util
2021-06-30 13:08:05 +02:00
Badiboy 983d626d87
Merge pull request #1212 from Badiboy/master
Update file_name to visible_file_name in send_document
2021-06-29 13:31:25 +03:00
Badiboy a4e73a05c6 Update file_name to visible_file_name in send_document 2021-06-29 13:30:01 +03:00
Badiboy 30e304ffb5
Merge pull request #1204 from floydya/file-name-patch
Allows to set visible document file_name on send.
2021-06-29 13:27:44 +03:00
Badiboy 430b34c7a2
Merge pull request #1210 from SwissCorePy/master
README update
2021-06-28 17:15:45 +03:00
SwissCorePy b222416fd8 Update README.md 2021-06-28 15:44:49 +02:00
SwissCorePy f8110cd046 Update README.md
* Added the new message_handlers
* Added some information about local Bot API Server
* Replaced the split_string with the smart_split function
2021-06-28 15:17:53 +02:00
Badiboy 6bc60f4aa9
Merge pull request #1208 from SwissCorePy/master
get_chat_member_count and ban_chat_member added.
get_chat_members_count and kick_chat_member are marked as deprecated.
2021-06-28 13:09:19 +03:00
SwissCorePy b48a445e9f Update __init__.py
updated docstrings
2021-06-28 12:02:40 +02:00
SwissCorePy 0b383498eb addded logger info for deprecated funcs 2021-06-28 11:59:21 +02:00
Badiboy 2e3b4223a5
Merge pull request #1209 from Badiboy/master
Release 3.8.1 - bugfix
2021-06-28 12:41:38 +03:00
Badiboy 60bb63ab2b Release 3.8.1 - bugfix 2021-06-28 12:41:15 +03:00
SwissCorePy 0aa7a8a8f6 new 5.3 function names
added the new function names (the previous names are still working) from 5.3 and some other small changes
2021-06-28 09:31:06 +02:00
Badiboy 72ed7c1dde
Merge pull request #1207 from Badiboy/master
Post-release fix for infinity_polling
2021-06-27 20:43:34 +03:00
Badiboy a29c4af2ee Post-release fix for infinity_polling 2021-06-27 20:40:16 +03:00
Badiboy 8d8f234138
Merge pull request #1206 from MAIKS1900/master
2 of 3 Bot API 5.3 changes
2021-06-27 17:33:04 +03:00
MAIKS1900 491cc05a95 - Set BotCommandScope as abstract class.
- Docstrings from telegram API Scope types
2021-06-27 17:28:11 +03:00
MAIKS1900 b2c6077f4d Merge branch 'master' of https://github.com/MAIKS1900/pyTelegramBotAPI into master 2021-06-27 15:08:37 +03:00
Badiboy fb290dc12d
Merge pull request #1205 from Badiboy/master
Release version 3.8.0
2021-06-27 13:24:55 +03:00
Badiboy c088fabe6c Release version 3.8.0 2021-06-27 13:09:08 +03:00
Vlad Galatskiy a791ff4e46
Add tests for file sending with name 2021-06-27 11:58:33 +03:00
Vlad Galatskiy e56f134a7c
Add file_name support to send_document method 2021-06-27 11:38:45 +03:00
Vlad Galatskiy 38c4c21030
Add file_name argument to send_data method 2021-06-27 11:37:27 +03:00
MAIKS1900 3e33b7f1cb Bot API 5.3 changes
- Personalized Commands for different chats
- Custom Placeholders of input field for ReplyKeyboardMarkup and ForceReply.
2021-06-26 14:36:14 +03:00
Badiboy e381671645
Merge pull request #1201 from SwissCorePy/master
Added handlers for `my_chat_member` and `chat_member`.
Added aalowed_updates to polling functions.
2021-06-24 09:06:33 +03:00
SwissCorePy ce991e9ac3 Update types.py
added the missing attributes `can_manage_chat` and `can_manage_voice_chats` to ChatMember class
2021-06-23 22:52:24 +02:00
SwissCorePy 3d5415433e Update __init__.py
Updated TeleBot doc string and added the missing functions to AsyncTeleBot
2021-06-23 22:51:17 +02:00
SwissCorePy 0bfefdf15d changed allowed_updates in util to update_types
i think its more clear name
2021-06-23 19:57:44 +02:00
SwissCorePy 506464e637 Update __init__.py
Added the parameter `allowed_updates` to polling and infinity_polling functions
2021-06-23 19:29:36 +02:00
SwissCorePy 4554cb969f Update __init__.py
added handlers for `my_chat_member` and `chat_member`
2021-06-23 16:10:48 +02:00
SwissCorePy 65cf841015 Update util.py
added `allowed_updates` list (used by `_init_._retrieve_all_updates` because `chat_member` is not requested by default)
2021-06-23 16:09:40 +02:00
Badiboy 0f0ce934dc
Merge pull request #1199 from SwissCorePy/master
added InputInvoiceMessageContent and tgs_sticker support
2021-06-22 17:34:05 +03:00
SwissCorePy bffbe764e5 Update tgs_sticker support
* Updated `create_new_sticker_set` and `add_sticker_to_set` functions
* Removed `create_new_animated_sticker_set` and `add_sticker_to_animated_sticker_set` functions
2021-06-22 15:57:34 +02:00
SwissCorePy c00595e212 Update types.py
* Added Parameter `caption_entities` to `InputMedia` class
* Added Parameter `disable_content_type_detection` to `InputMediaDocument` class
2021-06-22 15:55:14 +02:00
Badiboy b20f5b359b
Merge pull request #1200 from pablodz/patch-1
Fix long string blocking version of python on github actions setup
2021-06-22 08:29:50 +03:00
Pablo 558eef78b4
Fix long string blocking version of python on github actions setup 2021-06-21 17:27:35 -05:00
SwissCorePy 3f46ce3b7b added InputInvoiceMessageContent and tgs_sticker support
and some small changes
2021-06-21 19:59:39 +02:00
Badiboy 69e8edef19
Merge pull request #1198 from SwissCorePy/master
Added some missing features
2021-06-21 20:48:04 +03:00
SwissCorePy d3369245c4 fixed wrong type hint 2021-06-21 17:49:03 +02:00
SwissCorePy 55e9f2095e Merge branch 'master' of https://github.com/eternnoir/pyTelegramBotAPI 2021-06-21 17:39:57 +02:00
SwissCorePy 7118613ef7 Added missing features
* added some missing features of TelegramBotAPI 4.6-5.2 to pyTelegramBotAPI
* added type hints to (almost) all public TeleBot functions
2021-06-21 17:39:13 +02:00
Badiboy 105d65d5ce
Merge pull request #1197 from vishal2376/master
Add developer bot
2021-06-21 14:16:37 +03:00
Vishal Singh f11bf08ba1
Update README.md 2021-06-21 16:30:17 +05:30
Vishal Singh 66598e39fe
Change description of developer bot 2021-06-21 16:27:32 +05:30
Vishal Singh 4146b50384
Add developer bot 2021-06-21 13:16:22 +05:30
Badiboy f62d642572
Merge pull request #1196 from leonheess/patch-1
Add Anti-Tracking Bot
2021-06-20 19:33:50 +03:00
Leon Heess 18f1fd42b0
Add Anti-Tracking Bot 2021-06-20 13:14:55 +02:00
Badiboy 07d198aebe
Merge pull request #1195 from SwissCorePy/master
Added class ChatMemberUpdated
2021-06-19 22:18:50 +03:00
SwissCorePy 0370a9f277 Added class ChatMemberUpdated
* Added class `ChatMemberUpdated` to types
* Simplified `de_json` functions in `WebhookInfo` and `Update` classes (for overall more consistent code)
* changed `options_ids` to ´option_id` in class `PollAnswer`
* Added test for `ChatMemberUpdated` class in `test_types.py` and added the fields `my_chat_member` and `chat_member` to the `Update` class and its tests
2021-06-19 20:13:53 +02:00
Badiboy 22d3ac027a
Merge pull request #1194 from SwissCorePy/master
Minor updates to the https://github.com/eternnoir/pyTelegramBotAPI/pull/1191
2021-06-19 19:25:04 +03:00
SwissCorePy 795f7fff7f Some small changes
* Fixed type warnings in some editors by changing `var: Type = None` to `var: Union[Type, None] = None`
* changed some args from `obj['arg']` to `obj.get('arg')` if arg is optional
* better PEP-8 compliance for less weak warnings
* added tests for the new type `ChatInviteLink`
2021-06-19 17:59:55 +02:00
Badiboy ab6d40a072
Merge pull request #1193 from Badiboy/master
Raise exception if no token passed
2021-06-19 15:10:32 +03:00
Badiboy d26923e167 Raise exception if no token passed 2021-06-19 15:09:52 +03:00
Badiboy 05aff236c1
Merge pull request #1191 from SwissCorePy/master
Huge update with type checking and some new properties.

Note: should be presisely tested before publishing.
2021-06-19 15:00:12 +03:00
SwissCorePy a9ae070256 Update types.py 2021-06-18 22:37:31 +02:00
SwissCorePy 63fe6e01d1 Fixed the errors from my last PRs
I testet all using pytest and python versions 3.6-3.9 on macOS
2021-06-18 22:35:49 +02:00
SwissCorePy bbafdd1c1d Some Updates
> Added lot of type hints to types.py
> Added some new fields from TelegramBotAPI to pyTelegramBotAPI
> fixed `circular import error in util.py
> Added functions `log_out` and `close` to __init__.py and apihelper.py
> And some more small changes
2021-06-17 20:28:53 +02:00
Badiboy fe9df2df8c
Merge pull request #1186 from AREEG94FAHAD/master
Add to translator bot
2021-06-12 21:13:41 +03:00
AREEG94FAHAD b0b8623dce
Merge pull request #1 from AREEG94FAHAD/Cryptocurrency
Update README.md
2021-06-12 19:02:06 +03:00
AREEG94FAHAD a01e59951a
Update README.md 2021-06-12 19:01:42 +03:00
AREEG94FAHAD d5c202abbd
Update README.md 2021-06-12 18:19:18 +03:00
AREEG94FAHAD 81299ff613
Update README.md 2021-06-12 18:18:51 +03:00
AREEG94FAHAD 25bac68309
Update README.md 2021-06-12 18:18:16 +03:00
Badiboy a05324bdad
Merge pull request #1181 from pablodz/master
Github Actions: setup for 3.6+ pypy3.6+
2021-06-09 17:29:57 +03:00
Badiboy 74c4ab2f04
Merge pull request #1183 from SwissCorePy/master
Fixed a bug in `user_link`
2021-06-09 17:28:13 +03:00
SwissCorePy ab05cb0045 Fixed a bug in `user_link`
`user_link` returned an empty string if `include_id` was set to False
2021-06-09 16:20:42 +02:00
ZurMaD 709eb8cf45 Github Actions: setup for 3.6+ pypy3.6+ 2021-06-06 14:30:55 -05:00
Badiboy 643cdeceee
Merge pull request #1179 from Badiboy/master
Fix special case when content_type is None
2021-06-04 12:29:05 +03:00
Badiboy 2add34c702 Fix special case when content_type is None 2021-06-04 12:28:33 +03:00
Badiboy 877397a46b
Merge pull request #1178 from Badiboy/master
Partial rollback for previous update
2021-06-04 12:12:26 +03:00
Badiboy afbc67795a Partial rollback for previous update 2021-06-04 12:11:37 +03:00
Badiboy da5dc20b3a
Merge pull request #1176 from SwissCorePy/master
Added some functions and type hints
2021-06-03 23:45:21 +03:00
SwissCorePy ed5e5e5077 Update util.py
- Removed function `unix_time`
- Added function `escape`
- Added function `user_link`
- Added function `quick_markup`
- Added some type hints
2021-06-03 19:51:33 +02:00
SwissCorePy 9a6ddce8df Added the function `unix_time` 2021-06-03 19:06:53 +02:00
Badiboy db8478d0a4
Merge pull request #1174 from SwissCorePy/master
Add `smart_split` function to utils.py
2021-06-03 19:55:44 +03:00
SwissCorePy 20030f47af Update util.py
Added the function `smart_split` to split text into meaningful parts.
2021-06-03 18:51:32 +02:00
Badiboy f7cf1965cb
Merge pull request #1168 from anvarjamgirov/patch-1
Bug fixed on set_game_score
2021-06-01 08:30:42 +03:00
anvar aea067f789
Bug fixed on set_game_score
fixed wrong ordered argument error on calling apihelper.set_game_score method in set_game_score
2021-06-01 08:39:09 +05:00
Badiboy e2c20c1e55
Merge pull request #1167 from zora89/master
typo corrected.
2021-05-25 23:56:01 +03:00
zora89 1209281787
type corrected. 2021-05-26 02:17:49 +05:30
Badiboy 742f67c85b
Merge pull request #1163 from yehwankim23/patch-1
Fix typo
2021-05-20 12:07:34 +03:00
김예환 Ye-Hwan Kim (Sam) e22fcbe3c0
Fix typo 2021-05-20 18:01:10 +09:00
Badiboy d3998dfadb
Merge pull request #1161 from yarreg/feature/invite-link-api
Create_chat_invite_link, edit_chat_invite_link, revoke_chat_invite_link methods
2021-05-19 11:30:06 +03:00
Yaroslav Vorobev ff54f194ad Added: create_chat_invite_link, edit_chat_invite_link, revoke_chat_invite_link methods 2021-05-19 11:22:40 +03:00
Badiboy f6b967421e
Merge pull request #1160 from Badiboy/master
Update version.py
2021-05-15 20:30:27 +03:00
Badiboy 59559199d5 Update version.py 2021-05-15 20:29:58 +03:00
Badiboy 98784c811e
Merge pull request #1159 from Badiboy/master
Fix release 3.7.8u1 (update was inconsistent, sorry)
2021-05-15 20:28:51 +03:00
Badiboy 26e5f3d3a8 Fix release 3.7.8u1 2021-05-15 20:27:52 +03:00
Badiboy fe1f99abdf
Merge pull request #1158 from Badiboy/master
send_poll fix of fix
2021-05-15 20:09:49 +03:00
Badiboy 7540a26fb9 send_poll fix of fix
Previous update was inconsistent, sorry.
2021-05-15 20:08:51 +03:00
Badiboy 10d0ff2c06
Merge pull request #1157 from Badiboy/master
Release 3.7.8
2021-05-15 11:36:00 +03:00
Badiboy 90de2e4ad9 Release 3.7.8
Regular release with minor updates
2021-05-15 11:35:13 +03:00
Badiboy d3c2ffd422
Merge pull request #1155 from Badiboy/master
send_poll fix with PollOptions
2021-05-15 11:31:02 +03:00
Badiboy 53c98328c1 send_poll fix with PollOptions
Now send_poll correctly operates with PollOptions passed as array of PollOption.
2021-05-12 00:26:33 +03:00
Badiboy 3d26a0ce0d
Merge pull request #1154 from Badiboy/master
Change message handler filtering order
2021-05-11 23:27:54 +03:00
Badiboy 73fb18c193 Change message handler filtering order
Now content_type is checked first.
2021-05-11 23:26:22 +03:00
Badiboy 1ba595daa0
Merge pull request #1153 from hemantapkh/patch-1
Add Torrent Hunt bot in README
2021-05-11 09:23:59 +03:00
Hemanta Pokharel 47cab4d63e
Fix typo 2021-05-11 07:58:19 +05:45
Hemanta Pokharel 4a25675007
Add Torrent Hunt bot in README 2021-05-11 07:51:13 +05:45
Badiboy c437b40d58
Merge pull request #1140 from eternnoir/dependabot/pip/py-1.10.0
Bump py from 1.4.29 to 1.10.0
2021-04-20 22:00:39 +03:00
dependabot[bot] b7a18bf0d9
Bump py from 1.4.29 to 1.10.0
Bumps [py](https://github.com/pytest-dev/py) from 1.4.29 to 1.10.0.
- [Release notes](https://github.com/pytest-dev/py/releases)
- [Changelog](https://github.com/pytest-dev/py/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/py/compare/1.4.29...1.10.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-20 17:03:50 +00:00
Badiboy bc3d5a46b7
Merge pull request #1138 from Badiboy/master
Python 3.5 end-of-life
2021-04-19 18:46:53 +03:00
Badiboy 990bb827be Python 3.5 end-of-life 2021-04-19 18:45:49 +03:00
Badiboy 3ecb84bd94
Merge pull request #1137 from FosterToster/master
middleware handlers exception handling
2021-04-19 18:42:24 +03:00
FosterToster 2565094897 fixed overwriting exception args 2021-04-19 22:20:42 +07:00
FosterToster 855b838e91 more explict process_middleware exceptions suppressing 2021-04-18 22:41:28 +07:00
FosterToster 042d8c17da suppress_middleware_excepions configuration. False by default. 2021-04-18 22:31:24 +07:00
FosterToster a39fb14726 middleware handlers exception handling 2021-04-18 19:56:52 +07:00
Badiboy 888c7a6b0d
Merge pull request #1126 from David256/feature-new-property-fullname
Change fstrings to string formatting
2021-04-02 01:41:48 +03:00
David256 2f69917a82 Change fstrings to string formatting 2021-04-01 16:52:12 -05:00
Badiboy efa35ba71c
Merge pull request #1125 from David256/feature-new-property-fullname
New property full_name
2021-04-02 00:05:29 +03:00
David256 6c90da793e New property full_name 2021-04-01 14:56:08 -05:00
Badiboy 4024490249
Merge pull request #1121 from Badiboy/master
Minor release
Heroku example update
2021-03-28 11:57:49 +03:00
Badiboy 209d9b27b4 Minor release 2021-03-28 11:57:05 +03:00
Badiboy 96e0be8942 Heroku example update 2021-03-28 11:54:46 +03:00
Badiboy 87bce0bce1
Merge pull request #1113 from barbax7/master
Added Price Tracker bot
2021-03-18 17:43:43 +03:00
Andrea Barbagallo f23059d7ec
Added Price Tracker bot 2021-03-18 08:38:47 +01:00
Badiboy cc08fe32c6
Merge pull request #1107 from MasterGroosha/patch-1
Removed my bot from README
2021-03-09 10:35:06 +03:00
Aleksandr 07e93f95a1
Removed my bot from list
The link is now dead, and so is that bot
2021-03-09 02:05:44 +03:00
Badiboy a10e8afa5c
Merge pull request #1096 from anvaari/master
Add my bot to Readme.md
2021-02-16 13:25:07 +03:00
Mohammad Arab Anvari b39244f827
Add my bot to Readme.md 2021-02-16 13:41:56 +03:30
Badiboy af4d986a13
Merge pull request #1090 from Badiboy/master
Custom logging level for infinity_polling
2021-02-05 00:43:22 +03:00
Badiboy 8790f26e68 Custom logging level for infinity_polling 2021-01-30 14:41:19 +03:00
Badiboy f01412a996
Merge pull request #1086 from dexpiper/patch-1
README list of bots update
2021-01-22 16:56:02 +03:00
dexpiper 20d0ab229f
README list of bots update
Add another bot to the list below
2021-01-21 17:19:54 +03:00
Badiboy 2dec4f1ffc
Merge pull request #1083 from ModischFabrications/patch-1
Add MineGramBot to readme
2021-01-20 13:31:05 +03:00
Robin Modisch a7d1dbf0e9
add MineGramBot 2021-01-20 11:04:55 +01:00
Badiboy eace25d9d2
Merge pull request #1082 from Badiboy/master
Minor update to copyMessage
2021-01-19 01:28:16 +03:00
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 cc299fe4da
Merge pull request #1081 from ModischFabrications/patch-1
Extend readme with more usage hints
2021-01-18 02:26:02 +03:00
Robin Modisch cd31c8db5c
fix example 2021-01-17 23:47:03 +01:00
Robin Modisch 6d7116d521
document SESSION_TIME_TO_LIVE 2021-01-17 23:45:23 +01:00
Robin Modisch f93916372e
document edit_message_text in readme 2021-01-17 23:34:54 +01:00
Robin Modisch 80c9e17fd4
add apihelper.ENABLE_MIDDLEWARE = True to readme 2021-01-17 23:22:45 +01: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
Badiboy 9c2d279806
Merge pull request #1078 from ModischFabrications/patch-1
Hide token from debug logs
2021-01-17 12:21:42 +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 3799a1e99a
Merge pull request #1077 from Badiboy/master
Added short live sessions
2021-01-17 00:46:01 +03: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 a7587057bf
Merge pull request #1076 from Badiboy/master
Polling timeout fix
2021-01-16 02:15:26 +03:00
Badiboy e9ba2fd8bb Polling timeout fix 2021-01-16 02:14:29 +03:00
Badiboy 8203fa588f
Merge pull request #1074 from Badiboy/master
Version update to previous commit
2021-01-14 15:49:01 +03:00
Badiboy 2e5250ec98 Version update to previous commit 2021-01-14 15:48:30 +03:00
Badiboy 1f910745f1
Merge pull request #1073 from Badiboy/master
Fix restrict_chat_member until_date bug
2021-01-14 15:47:21 +03:00
Badiboy f56da17741 Fix restrict_chat_member until_date bug 2021-01-14 15:45:47 +03:00
Badiboy a0d86977b0
Merge pull request #1072 from Badiboy/master
Infinity polling fall down fixed
2021-01-14 03:57:00 +03:00
Badiboy 82838e1d26 Infinity polling fall down fixed 2021-01-14 03:44:37 +03:00
Badiboy bb8bc7672a
Merge pull request #1070 from dgarcoe/patch-1
Update README.md
2021-01-13 20:03:10 +03:00
Daniel García Coego 6e3e159109
Update README.md
I included my bot in the README. Thanks for the library!
2021-01-13 17:55:08 +01: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 87574a7613
Merge pull request #1066 from Badiboy/master
drop_pending_updates in set_webhook
2021-01-09 21:23:55 +03:00
Badiboy 52ebb5a1a7 drop_pending_updates in set_webhook 2021-01-09 21:22:49 +03:00
Badiboy da9ee5ffba
Merge pull request #1065 from Badiboy/master
Release version  3.7.5
2021-01-07 20:47:12 +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
Badiboy bbcd7aa9db
Merge pull request #1060 from TarasKindrat/master
Modify RedisHandlerBackend, add argument "password=None" to __init__()
2021-01-06 15:06:24 +03:00
Badiboy 51effdd9a1
Merge pull request #1061 from barbax7/patch-2
Added bot @donamazonbot to the list
2021-01-06 15:05:37 +03:00
Andrea Barbagallo 0126ba82a5
Added bot @donamazonbot to the list 2021-01-05 17:31:18 +01: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
FrankWang eab36a99e9
Update README.md 2021-01-01 23:14:00 +08:00
Badiboy 28357c8c33
Merge pull request #1056 from Badiboy/master
Bot API update
2020-12-29 19:27:06 +03: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 b5d054cf5f
Merge pull request #1054 from timgates42/bugfix_typo_performance
docs: fix simple typo, perfomance -> performance
2020-12-25 01:52:17 +03:00
Tim Gates 93b86307d9
docs: fix simple typo, perfomance -> performance
There is a small typo in examples/webhook_examples/README.md.

Should read `performance` rather than `perfomance`.
2020-12-25 09:47:40 +11:00
Badiboy f62d72e2a1
Merge pull request #1053 from Badiboy/master
Avoid dead threads in treaded polling
2020-12-25 00:03:24 +03:00
Badiboy c4e624d999 Avoid dead threads in treaded polling 2020-12-24 23:55:12 +03:00
Badiboy fcb3d9b1b3
Merge pull request #1052 from Badiboy/master
Exception if middleware is used but not enabled
2020-12-24 19:57:25 +03:00
Badiboy 2534dc5925 Exception if middleware is used but not enabled. 2020-12-24 19:55:24 +03:00
Badiboy ded0d257fc
Merge pull request #1050 from twistfire92/master
fix restrict_chat_member method
2020-12-22 23:05:43 +03:00
Mikhail Krostelev 96686e5221 fix restrict_chat_member method 2020-12-22 21:38:38 +03:00
Badiboy b522053e27
Merge pull request #1043 from vixfwis/master
Add webhook example for Twisted
2020-12-17 16:49:26 +03:00
vixfwis 4e61bc3a8b add short description to example and readme files 2020-12-17 15:34:36 +03:00
Badiboy 487ede7c88
Merge pull request #1046 from Badiboy/master
Fix unban_chat_member in async
2020-12-16 01:58:31 +03:00
Badiboy 4658d2b8da Fix unban_chat_member in async 2020-12-16 01:57:30 +03:00
vixfwis 75a18e5869 add webhook example for Twisted framework 2020-12-15 15:02:41 +03:00
Badiboy fab2b2d223
Merge pull request #1035 from Badiboy/master
parse_mode = ""
2020-12-09 11:23:09 +03:00
Badiboy 65c3ca58da Update __init__.py
Allow parse_mode = "" to disable default parse mode.
2020-12-09 01:41:07 +03:00
Badiboy a4d0b685b5
Merge pull request #1026 from Badiboy/master
Bot API 5.0 pinning-unpinning logic post-fix.
2020-11-29 16:11:46 +03:00
Badiboy 6cc80f25d7 Bot API 5.0 pinning-unpinning logic post-fix. 2020-11-29 15:33:39 +03:00
Badiboy 0418818629
Merge pull request #1025 from alexmechanic/master
Bot API 5.0 pinning-unpinning logic update
2020-11-29 15:28:43 +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 438cfe4dbd
Merge pull request #1022 from Badiboy/master
Version 3.7.4 release
2020-11-20 23:50:39 +03:00
Badiboy 640f398262 Version 3.7.4 release 2020-11-20 23:49:55 +03:00
Badiboy a9db217c64
Merge pull request #1020 from Badiboy/master
added only_if_banned to unban_chat_member
2020-11-20 15:05:41 +03:00
Badiboy 5824d47590 added only_if_banned to unban_chat_member 2020-11-18 02:22:52 +03:00
Badiboy 0da192aec7
Merge pull request #1014 from Badiboy/master
set_webhook bugfinx
2020-11-11 01:02:21 +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 2c15cd0996
Merge pull request #1012 from Badiboy/master
Long polling timeouts update
2020-11-07 16:51:10 +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 ece7ca97e0
Merge pull request #1011 from Badiboy/master
Long polling updates and combo content types
2020-11-07 13:02:22 +03:00
Badiboy 7a3fd30f6a Long polling updates and combo content types 2020-11-07 12:52:51 +03:00
Badiboy 1d99cc224f
Merge pull request #1005 from Badiboy/master
Animation content_type
2020-11-03 23:26:53 +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
Badiboy 42e6d84f13
Merge pull request #1004 from diegop384/patch-1
Update README.md
2020-11-03 17:36:04 +03:00
diegop384 27461c03af
Update README.md
I added my bot
2020-11-03 09:28:31 -05:00
Badiboy 3be51390b1
Merge pull request #997 from Mrsqd/patch-1
Added Frcstbot description
2020-10-30 00:42:04 +03:00
Mrsqd afa88304d7
Added Frcstbot
I've made a weather forecast bot using your API. Can you approve my request to add it, please?
2020-10-29 02:09:47 +03:00
Badiboy 82e79b6ac6
Merge pull request #995 from pinguluk/patch-1
Update README.md
2020-10-28 14:16:03 +03:00
Pinguluk 746c71665e
Update README.md
linked example/webhook_examples to the directory
2020-10-28 12:31:57 +02:00
Badiboy 37c09406d0
Merge pull request #989 from andvch/patch-1
Fix broken text_mention html formatting
2020-10-15 11:57:38 +03:00
andvch 36a3ce62c4
Fix broken text_mention html formatting 2020-10-14 12:06:49 +03:00
Badiboy 6dc8173176
Merge pull request #977 from Badiboy/master
Previous commit bugfix
2020-09-22 01:46:51 +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
FrankWang 3ae145f206
Update README.md 2020-09-10 16:22:50 +08:00
Badiboy 5fda52cf5d
Merge pull request #970 from meoww-bot/master
UPG: Added the field reply_markup to the Message object
2020-09-07 13:09:46 +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 698b4371e6
test: Add tests for InlineKeyboardMarkup and ...
Add tests for InlineKeyboardMarkup and InlineKeyboardButton
2020-09-02 10:33:32 +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
Badiboy d15cb16bef
Merge pull request #969 from ArtemFrantsiian/patch-1
Fix an error with the is_pil_image function
2020-08-29 22:04:36 +03: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
Badiboy 79ff9191f3
Merge pull request #967 from meoww-bot/patch-1
Added the field `file_unique_id` (Bot API 4.5)
2020-08-29 11:18:00 +03:00
meoww-bot bdfb793e34
test: Added file_unique_id from Bot API 4.5 2020-08-29 12:07:38 +08: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 1eb9651894
Merge pull request #963 from Badiboy/master
Minor readme update
2020-08-26 00:53:12 +03:00
Badiboy 309e55845c Minor readme update 2020-08-26 00:51:55 +03: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
Badiboy 7acad2d825
Merge pull request #958 from Badiboy/master
Bot API support checked/updated up to 4.2
2020-08-25 21:49:40 +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 47b9c1d3fb
Merge pull request #957 from Badiboy/master
Empty list optimization, Py2 arteacts removed
2020-08-25 16:46:28 +03:00
Badiboy 06ed637f2f Merge remote-tracking branch 'upstream/master' 2020-08-25 16:24:07 +03:00
Badiboy 7bf432170e
Merge pull request #956 from Pablo-Davila/master
Append bots to list
2020-08-25 16:23:52 +03:00
Pablo Dávila Herrero 8cd18945c5 Append bots to list
TasksListsBot
MyElizaPsychologistBot
2020-08-25 15:45:08 +02:00
eternnoir 48b53f6a8e Update version.X 2020-08-24 21:36:27 +08: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
Badiboy c1c84a588d
Merge pull request #955 from fgallaire/master
Fix 'NoneType' object assignment error from #892 and #954
2020-08-22 18:32:25 +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
Badiboy 818905de32
Merge pull request #954 from rfoxxxy/master
Added missing thumb parameters to send_document, send_animation and send_video_note
Implemented getting the runtime version of pyTelegramBotAPI
Fixed docstring for send_video_note function
2020-08-21 17:33:22 +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 83df269730
Merge pull request #953 from Badiboy/master
Two None checks
2020-08-20 00:00:57 +03:00
Badiboy 18eb8eb605 Two None checks 2020-08-19 23:57:48 +03:00
Badiboy 19aaf83d88
Merge pull request #950 from BLUE-DEVIL1134/master
Update README.md
2020-08-17 11:48:59 +03:00
Akash 3b57c288b4
Update README.md 2020-08-17 14:08:20 +05:30
FrankWang 8f1c34db76
Merge pull request #947 from BLUE-DEVIL1134/master
Update README.md
2020-08-14 22:07:47 +08:00
Akash 2aaff09c39
Update README.md 2020-08-14 11:38:57 +05:30
Akash 1cd36253f0
Update README.md 2020-08-14 11:36:04 +05:30
Akash 484c3a4c48
Update README.md 2020-08-14 10:50:56 +05:30
Badiboy 5347a068e0
Merge pull request #944 from barbax7/patch-1
Update README.md
2020-08-13 18:25:23 +03:00
Andrea Barbagallo 52511fce48
Update README.md
Added my bot to the list.
2020-08-13 12:14:57 +02:00
Badiboy 507d524215
Merge pull request #939 from mrpes/patch-6
Keyboard bugfix
2020-08-04 22:03:00 +03:00
Mr. Dog ec79d1dc1e
Keyboard bugfix 2020-08-04 23:45:33 +05:00
Badiboy 31e40d155b
Merge pull request #938 from Badiboy/master
CopyPaste bugfix
2020-08-04 18:29:31 +03:00
Badiboy c6f51f6c55 CopyPaste bugfix 2020-08-04 18:28:35 +03:00
Badiboy dc07cacc7f
Merge pull request #935 from mrpes/patch-4
Exceptions classes redesign followup
2020-08-04 18:25:31 +03:00
Mr. Dog ce6a21cd09
Merge branch 'master' into patch-4 2020-08-04 19:49:55 +05:00
Badiboy 58c4010155
Merge pull request #937 from Badiboy/master
Bugfix and DISABLE_KEYLEN_ERROR
2020-08-04 12:40:32 +03: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
Badiboy 67fdb2f52e
Merge pull request #934 from Badiboy/master
Minor keyboard update followup
2020-08-03 11:37:09 +03: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
Badiboy e987e40ee7
Merge pull request #930 from mrpes/patch-5
Minor keyboard code redisign
2020-08-02 18:49:32 +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
Badiboy 9a3f370dce
Merge pull request #929 from mrpes/patch-3
Support for sending PIL images in sendPhoto / sendChatPhoto as photo argument.
2020-07-31 11:06:31 +03: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
Badiboy 88e0f1337b
Merge pull request #928 from mrpes/patch-2
Exception classes redesign: additional Exception subclasses added
2020-07-31 01:37:32 +03: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
Badiboy b790e4e6ba
Merge pull request #927 from mrpes/patch-1
Optional retry on requests error
2020-07-30 11:14:51 +03: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
Badiboy 48e48610f3
Merge pull request #918 from daveusa31/master
Documented the default parse_mode installation
2020-07-18 23:01:25 +03:00
Badiboy d7aaccef63
Merge pull request #917 from EskiSlav/master
Added strike and underline entities to parse to html
2020-07-18 21:19:47 +03:00
daveusa31 a02f499a20
Documented the default parse_mode installation 2020-07-18 19:02:07 +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 40e19e5af1
Merge pull request #915 from zeph1997/editreadme
Added JoinGroup Silencer Bot into the "Bots using this API" in README
2020-07-16 14:22:45 +03:00
zeph1997 bc5d9c8d69 Update README.md 2020-07-16 19:09:37 +08:00
zeph1997 6049de4356 Update README.md 2020-07-16 19:07:39 +08: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
Badiboy 00798df0c0
Merge pull request #909 from iPurya/patch-1
Fix Sticker tests
2020-07-07 09:17:01 +03:00
Purya Jafari d2d7cc39be
Update test_types.py 2020-07-07 03:39:00 +04:30
Badiboy d74f47e16c
Merge pull request #908 from iPurya/patch-2
Added field file_unique_id to Sticker.
2020-07-07 01:31:08 +03:00
Purya Jafari d5e9f73821
Update test_types.py
tests updated for pull request #908.
2020-07-07 02:38:06 +04:30
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
eternnoir f42ec4fe0d Bump version. 2020-07-06 00:37:17 +08:00
Badiboy e9f925e14c
Merge pull request #906 from daveusa31/master
Added ability to set default parse_mode in main TeleBot class.
2020-07-04 22:29:32 +03:00
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
Badiboy 30664f396a
Merge pull request #904 from timbyxty/master
Added NST bot to the bot list
2020-07-04 00:17:43 +03:00
Timur Davletshin cdffeba829
added NST 2020-07-03 22:05:47 +05: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
Badiboy 8e82d1c462
Merge pull request #902 from 0xnu/patch-1
Update README.md
2020-07-02 16:08:22 +03:00
Finbarrs b5a4276282
Update README.md
Link to Sports bot added.
2020-07-02 13:27:51 +01:00
Badiboy d43292e42b
Merge pull request #892 from Otxoto/Otxoto-patch-2
Added thumbnail support for send_audio and send_video
2020-06-24 19:10:15 +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
Badiboy 03b1531bd7
Merge pull request #890 from Otxoto/master
Update User type
Added:
can_join_groups
can_read_all_group_messages
supports_inline_queries
2020-06-22 23:14:45 +03:00
Kwisatz Haderach ab496f995e
Merge pull request #1 from Otxoto/Otxoto-patch-1
Complete User Class
2020-06-22 13:18:42 +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
FrankWang c24d1e2d0b
Update README.md 2020-06-07 02:50:30 +08:00
Badiboy 38694a9173
Merge pull request #865 from Badiboy/master
Update test_telebot.py
2020-05-29 12:43:24 +03:00
Badiboy 1494946d02 Update test_telebot.py
Build fix.
2020-05-29 12:37:23 +03: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 f7008d4d99
Merge pull request #856 from Badiboy/master
send_chat_permissions fix
2020-05-20 12:03:05 +03:00
Badiboy 32dc03ec44 send_chat_permissions fix 2020-05-20 11:57:41 +03:00
Badiboy dbff7cbb3e
Merge pull request #852 from olegshek/keyboard_button_poll_type
Keyboard button poll type
2020-05-18 11:23:02 +03:00
oleg 27e2cbc7ea Remove unnecessary test 2020-05-18 12:22:26 +05: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 783fe56566
Merge pull request #848 from Badiboy/master
Correct processing of bool parameters. Some timeouts added.
2020-05-16 17:45:30 +03:00
Badiboy 2368421332 Correct processing of bool parameters. Some timeouts added. 2020-05-16 17:34:56 +03:00
Badiboy 046276b491
Merge pull request #841 from drforse/master
fix test 1
2020-05-12 21:02:01 +03:00
dr_forse 3de8140c0b fix test 1 2020-05-12 18:29:36 +01:00
Badiboy e5ad9ab383
Merge pull request #840 from drforse/master
fix test
2020-05-12 20:21:40 +03:00
dr_forse d04e708438 fix test 2020-05-12 18:09:04 +01:00
Badiboy 200c6ccd07
Merge pull request #839 from drforse/master
add PollAnswer, poll_answer_handler
2020-05-12 19:56:22 +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
Badiboy aacc494a55
Merge pull request #834 from tohabyuraev/master
Bot API 4.5 partial support (in regards to chat).
2020-05-11 23:11:11 +03: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 df640966c2
Merge pull request #831 from Badiboy/master
Fix to_dic->to_dict refactoring
2020-05-09 00:54:22 +03:00
Badiboy 2849e67029 Fix to_dic->to_dict refactoring 2020-05-09 00:51:18 +03:00
Badiboy d02de07142
Merge pull request #830 from tohabyuraev/newcon
Add BotCommand, setMyCommands
2020-05-08 22:06:24 +03:00
Anthony Byuraev a56fb8cc54 UPG: Add BotCommand, setMyCommands 2020-05-08 21:06:39 +03:00
Badiboy c5e5af96d1
Merge pull request #827 from CSRedRat/patch-1
Add handler decorator example
2020-05-07 18:01:39 +03:00
CSRedRat 5d388f7ec4
Add handler decorator example 2020-05-07 19:56:17 +05:00
eternnoir 6c45511605 Update version 3.7.1 2020-05-02 19:41:46 +08:00
Badiboy d8a08638a7
Merge pull request #821 from Badiboy/master
send_poll revised to standart signature
2020-05-02 13:35:34 +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 be0fe94ee8
Merge pull request #819 from Badiboy/master
Fix Deprecation warning due to invalid escape sequences
2020-05-01 11:51:45 +03:00
Badiboy ef81868ebc Fix Deprecation warning due to invalid escape sequences 2020-05-01 11:25:51 +03:00
FrankWang 57fb8d2fad
Bump version. 3.7.0 2020-04-28 19:18:44 +08:00
Badiboy c2590ab5ed
Merge pull request #815 from bedilbek/remove-type-hinting
Remove type hinting for python 3.5 compatibility
2020-04-27 22:48:04 +03:00
bedilbek 24deb8a51d Change class from new-style class to object class 2020-04-28 00:34:52 +05:00
bedilbek d7ebaa5bb3 Fix importing dependencies 2020-04-28 00:24:47 +05:00
bedilbek 601b570b85 Fix python2.7 compatibility for class inheritance 2020-04-28 00:22:05 +05:00
Badiboy bdaabc4752
Merge pull request #814 from Badiboy/master
Travis update: remove Python 2
2020-04-27 22:01:37 +03:00
Badiboy 72d088940c Readme content fix 2020-04-27 22:00:20 +03:00
Badiboy f1a960c56b Travis update: remove Python 2 2020-04-27 21:56:37 +03:00
bedilbek bcc3a1afb4 Remove Type Hinting 2020-04-27 23:43:39 +05:00
Badiboy d0edf44774
Merge pull request #813 from drforse/patch-1
Fix Dice test
2020-04-27 18:36:17 +03:00
George Imedashvili 9c87ed3679
fix test 2020-04-27 16:20:30 +01:00
Badiboy 67cfa04737
Merge pull request #812 from Badiboy/master
Disable REDIS tests to save Travis
2020-04-27 17:47:30 +03:00
Badiboy be5d7bb73d Disable REDIS tests to save Travis
To enable REDIS set
test_handler_backeds.REDIS_TEST = True
before running tests.
2020-04-27 17:46:19 +03:00
Badiboy f3a65ef9b3
Merge pull request #811 from drforse/master
update dice as the api has updated
2020-04-27 17:14:39 +03:00
dr_forse 99c63e9eba add emoji field for dice 2020-04-27 06:30:05 +01:00
Badiboy e89a552e06
Merge pull request #810 from Badiboy/master
Polls are updated to the latest API state
2020-04-26 23:23:15 +03: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 dc3df70f9f
Merge pull request #807 from Badiboy/master
Minor code refactoring (naming)
2020-04-24 18:21:54 +03: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
Badiboy ce11b6f523
Merge pull request #806 from noideaw/patch-1
added can_invite_users parameter to restrict_chat_member function
2020-04-24 18:15:05 +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
Badiboy 39e3be6673
Merge pull request #804 from noideaw/patch-3
Add can_invite_users to restrict_chat_member #1
2020-04-24 01:34:58 +03: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
no_ideaw da924dbaeb
Update __init__.py
added can_invite_users parameter to restrict_chat_member function
2020-04-23 23:59:04 +04:30
Badiboy 7966def331
Merge pull request #801 from bedilbek/fix-middleware-invocations
Fix not needed invocations on typed middleware handlers
2020-04-20 11:10:04 +03:00
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
Badiboy 339a5c01c1
Merge pull request #789 from bedilbek/step-handler-backend
HandlerBackend Mechanism Implementation
Codebase Refactoring
2020-04-16 15:53:11 +03:00
dr_forse 615402e4f8 return a line as it was 2020-04-15 06:16:07 +01:00
dr_forse 51b1fb7695 added Dice and send_dice 2020-04-15 06:10:05 +01:00
bedilbek 0881e34381 Refactor tests 2020-04-15 01:11:43 +05:00
bedilbek 3aec66bc0d Remove class static variable 2020-04-15 01:11:43 +05:00
bedilbek e7e7c58133 Add Memory, File, Redis Backend tests 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 dd726b0759
Merge pull request #792 from Badiboy/master
Refactoring and API conformance
2020-04-14 22:22:48 +03:00
Badiboy 1bd9f5187c
Merge pull request #787 from bedilbek/middleware-handler-readme
Middleware Handler README Update
2020-04-12 02:20:05 +03:00
bedilbek 68330c9a07 Update contents with middleware handler 2020-04-12 01:44:15 +05:00
bedilbek b912e4dbaf Update with middleware handler 2020-04-12 01:41:34 +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 36a228da92
Merge pull request #786 from Badiboy/master
Possibility to use alternative serializer
2020-04-11 16:52:53 +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
Badiboy 2c385bf077
Merge pull request #785 from bedilbek/middleware-support
Add Middleware Handler
2020-04-11 11:20:58 +03:00
bedilbek 56cbc2ff93 Add examples to better understand middleware handler 2020-04-11 13:03:52 +05: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
FrankWang 862f17c716
Merge pull request #776 from irevenko/master
Add new bot in README
2020-03-28 01:15:50 +08:00
Ilya-Revenko ed7cf30034 Add new bot in README 2020-03-27 16:38:22 +02:00
Badiboy 100f6d77f6
Merge pull request #767 from Tkachov/master
Add @bot.poll_handler to be notified of new poll states
2020-03-09 13:58:23 +03: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
Badiboy 9410a3d310
Merge pull request #762 from Lin-Buo-Ren/patch-4
Use proper language for * query mentions in README
2020-03-01 21:14:32 +03:00
林博仁(Buo-ren Lin) a4e5a09ab2 Use proper language for * query mentions in README
Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
2020-02-27 16:49:28 +08:00
Badiboy ebfba49a8f
Merge pull request #761 from Lin-Buo-Ren/patch-3
Fix missing padding space in code sample comments in README
2020-02-27 11:45:59 +03:00
Badiboy 6e6420a331
Merge pull request #760 from HolidayMan/patch-1
Some clarification of custom listeners working
2020-02-27 11:45:04 +03:00
林博仁(Buo-ren Lin) 7ca629dc10
Fix missing padding space in code sample comments in README
Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
2020-02-27 16:41:13 +08:00
HolidayMan 3ecb7cef3b
Some clarification of custom listeners working 2020-02-27 00:59:21 +02:00
Badiboy e789407774
Merge pull request #743 from Quantum-0/master
Add is_anonymous flag to Poll type
2020-02-14 16:49:54 +03:00
Badiboy 8f32dec5dd
Merge pull request #744 from FaeeLoL/master
Add missed colon in readme
2020-02-14 16:48:44 +03:00
faeelol c57cfa3949 Add missed colon 2020-02-08 17:44:28 +03:00
Quantum dfac26706e
Add is_anonymous flag to Poll type 2020-02-07 12:53:31 +03:00
Badiboy 385fa98bc6
Merge pull request #738 from andrey18106/patch-1
Added missed bracket
2020-01-30 01:10:51 +03:00
Andrey d68e89fc9a
Added missed bracket 2020-01-28 20:56:03 +02:00
Badiboy 6023bae728
Merge pull request #735 from Lin-Buo-Ren/patch-2
Fix typo in README
2020-01-24 23:01:07 +03:00
林博仁(Buo-ren Lin) b323a868f0
Fix typo in README
Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
2020-01-17 17:21:30 +08:00
Frank Wang 583021d114 Update version to 3.6.7, 2020-01-14 16:33:05 +08:00
Badiboy b1e5d00821
Merge pull request #728 from Badiboy/master
Design updates from #711
2020-01-08 20:29:12 +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 9b279dc562
Merge pull request #726 from Badiboy/master
Update test_types.py
2020-01-03 19:31:39 +03:00
Badiboy 5cd97ebc96 Update detailed_example.py
Vulgarity replaced.
2020-01-03 19:24:10 +03:00
Badiboy b5ba2445d3 Update test_types.py
Updated test vectors for stickers.
2020-01-03 19:18:18 +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 b999fea2ac
Merge pull request #703 from voskresla/patch-1
Using Azure Functions for serverless bots.
2020-01-03 16:59:09 +03:00
Badiboy a41dabf73c
Merge pull request #725 from cclauss/patch-1
Travis CI: Drop EOL Py34 and add current Py38
2020-01-03 16:53:18 +03:00
Badiboy 5407801f62
Merge pull request #708 from xxsokolov/patch-1
Remove unused base_url from _make_request. Fixed misc error.
2020-01-03 16:52:47 +03:00
Badiboy 2efb33fc29
Merge branch 'master' into patch-1 2020-01-03 16:45:43 +03:00
Christian Clauss 620ea5dee0
Travis CI: Drop EOL Py34 and add current Py38 2020-01-03 14:36:08 +01:00
Badiboy eaf44f1a6b
Merge pull request #724 from Badiboy/master
Update version list in travis.yml
2020-01-03 02:08:00 +03:00
Badiboy 8c62b99057 Update .travis.yml
Travis: removed 2.6 and 3.3 (not supported). Added 3.7. Also added 3.8 (for experiment)
2020-01-03 02:05:32 +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 769ff8008e
Merge pull request #599 from KanerL/KanerL-patch-shipping-option
ShippingOption.add_price returns "self" (for chaining etc.).
2020-01-03 01:28:37 +03:00
Badiboy 0e0e2d97c0
Merge pull request #715 from Pablohn26/patch-1
Change chatid to chat_id to be the same as other examples
2020-01-03 01:19:47 +03:00
Badiboy bb199024fd
Merge pull request #593 from neoranger/patch-2
Update README.md
2020-01-03 01:02:35 +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
Badiboy 3a3bab5b92
Merge pull request #480 from SkymanOne/patch-1
create field forward_from_message_id in Message
2020-01-03 00:46:27 +03:00
Badiboy bf844ed202 HTML symbols not replaced
HTML symbols not replaced because return is before replace.
2020-01-01 13:46:18 +03:00
FrankWang fefb9d4555
Merge pull request #723 from LeoSvalov/master
Update README
2019-12-28 12:34:14 +08:00
Lev Svalov a413a51221
Update README
Adding another bot that user pyTelegramBotAPI.
2019-12-24 16:25:58 +05:00
Pablo Hinojosa a71030dcdd
Change chatid to chat_id to be the same as other examples
Change in README.md chatid to chat_id to be the same as other examples
2019-11-30 05:51:56 +01: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 5935a378ca
Merge pull request #685 from cclauss/patch-1
Use ==/!= to compare str, bytes, and int literals
2019-10-30 21:26:00 +08:00
FrankWang 1dd94d6e6d
Merge pull request #667 from desexcile/patch-2
Update Readme
2019-10-30 21:25:11 +08:00
FrankWang 2fb0f3fb4b
Merge pull request #684 from xxsokolov/patch-1
Update apihelper.py
2019-10-30 21:24:51 +08:00
FrankWang 575fb9da7f
Merge branch 'master' into patch-1 2019-10-30 21:24:43 +08:00
FrankWang c6358f35d2
Merge pull request #688 from vryazanov/master
New content type related to Telegram Passport
2019-10-30 21:22:36 +08:00
FrankWang 20b87f2242
Merge pull request #701 from eternnoir/dependabot/pip/requests-2.20.0
Bump requests from 2.7.0 to 2.20.0
2019-10-30 21:22:16 +08:00
FrankWang f4c215b0b8
Merge pull request #705 from keshamin/fix-578
Fixed #578
2019-10-30 21:21:49 +08:00
Innokentiy Min 1a30a9a249 Fixed #578 2019-10-30 14:02:00 +03:00
Stepan e644ed910a
Using Azure Functions for serverless bots.
Simple echo bot using Azure Functions as webhook.
2019-10-13 23:49:43 +03:00
dependabot[bot] 8cb2da3775
Bump requests from 2.7.0 to 2.20.0
Bumps [requests](https://github.com/requests/requests) from 2.7.0 to 2.20.0.
- [Release notes](https://github.com/requests/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md)
- [Commits](https://github.com/requests/requests/compare/v2.7.0...v2.20.0)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-05 11:55:18 +00:00
Natanael Andrés Garrido f8e7c0f819
Merge branch 'master' into patch-2 2019-09-23 10:25:18 -03:00
Vadim Ryazanov f241ef1eac passport_data content type added 2019-08-27 11:55:14 +03:00
Mohammad Taha 8f8276314e
Merge pull request #1 from cmd410/master
Support for animated stickers
2019-08-16 20:42:08 +00:00
Christian Clauss 9e30cfbda6
Use ==/!= to compare str, bytes, and int literals
Identity is not the same thing as equality in Python.
2019-08-12 22:47:59 +02: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
cmd410 f0835a1a14 Support for animated stickers 2019-07-30 12:46:39 +03:00
Taha be3b6f88e8 Added Animation 2019-07-14 18:53:59 +04:30
desexcile 87e811ce3e
Update Readme
Fixed source link
2019-06-29 09:39:14 +03:00
FrankWang 151880f391
Merge pull request #659 from OslikAi/master
Add Poll
2019-06-28 21:02:23 +08:00
FrankWang bf91829088
Merge pull request #664 from vovawed/master
Added LoginUrl to types
2019-06-28 21:02:04 +08:00
FrankWang 56f0b0a0d4
Merge pull request #603 from nailerNAS/master
infinity_polling fix
2019-06-28 20:57:28 +08:00
FrankWang 2b8e77f749
Merge pull request #616 from painca/patch-1
edit message_handler doc
2019-06-28 20:56:47 +08:00
FrankWang fba425265e
Merge pull request #645 from setazer/patch-1
remove unnecessary f-strings
2019-06-28 20:56:29 +08:00
FrankWang 23069ac729
Merge pull request #644 from David-Lor/master
update bot list
2019-06-28 20:56:15 +08:00
FrankWang 7ab93f55a6
Merge pull request #666 from desexcile/patch-1
Update Readme
2019-06-28 20:55:46 +08:00
P0lunin ba2705dc82 Merge remote-tracking branch 'origin/master' 2019-06-27 15:07:54 +03:00
P0lunin 3a1bdc2899 add Poll, sendPoll, stopPoll 2019-06-27 15:07:41 +03:00
desexcile 4e57adbcb6
Update Readme
added @asadov_bot to Bot list using this Api
2019-06-26 10:54:59 +03:00
Vova Pytsyuk 600002e158 Fixed bug with LoginUrl 2019-06-15 23:09:59 +03:00
Vova Pytsyuk 3c62e9d391 Added LoginUrl to types 2019-06-15 22:59:41 +03:00
OslikAi 63df69aeb8
Delete my_tests.py 2019-06-06 22:23:11 +03:00
OslikAi a8cf9f4ae5
Update README.md 2019-06-06 21:54:06 +03:00
Tiger 1 b10e45f714 add Poll, sendPoll, stopPoll 2019-06-06 21:49:06 +03:00
Tiger 1 9624b45314 add Poll, sendPoll, stopPoll 2019-06-06 21:47:08 +03:00
FrankWang e26ad07965
Merge pull request #658 from FacuM/add_bot_patch
Update README.md
2019-05-31 11:24:14 +08:00
FacuM 55c7b6373c Update README.md 2019-05-30 00:35:57 -03:00
FrankWang ceceeb7d8c
Update README.md 2019-05-24 15:05:20 +08:00
FrankWang b76a69e036
Merge pull request #624 from kor0p/editMessageText
Add 'method' parameter to methods that edit message
2019-05-18 07:58:56 +08:00
FrankWang e5700380bd
Merge branch 'master' into master 2019-05-18 07:56:53 +08:00
FrankWang 47b53b8812
Merge pull request #649 from karipov/master
added creationdatebot to bots api list
2019-04-24 17:41:43 +08:00
Komron 2d0ebde481 added creationdatebot to bots api list 2019-04-24 11:29:52 +02:00
FrankWang 271b7e0642
Merge pull request #646 from airatk/master
Update README.md
2019-04-23 10:15:02 +08:00
Airat K f516438360
Update README.md 2019-04-21 18:34:10 +03:00
SetazeR 7dc9abffc6
remove unnecessary f-strings 2019-04-16 07:38:50 +07:00
David Lorenzo 2285d0466e
update bot list
Remove areajugonesbot; add vigobustelegrambot
2019-04-09 11:32:15 +02:00
FrankWang 31dbe30489
Merge pull request #629 from iv8/patch-1
fix errors
2019-04-07 21:43:41 +08:00
iv8 c77307881d
fix errors 2019-03-04 15:24:55 +08: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
Moon Princess 79e6a3166d
edit message_handler doc 2019-01-20 23:04:11 +05:00
FrankWang 8005ca2f6c
Update example for api server check webhook alive. 2018-12-29 23:49:10 +08:00
nailer b82ed70ec9 fix syntax errors 2018-11-17 13:19:09 +02:00
nailer 18e37f3d20 sleep time timeout time instead of 5 seconds always 2018-11-17 12:58:56 +02:00
KanerL ceea457cf1
Update shipping option
Setting list of ShippingOptions like in payments_example.py
shipping_options = [
    ShippingOption(id='instant', title='WorldWide Teleporter').add_price(LabeledPrice('Teleporter', 1000)),
    ShippingOption(id='pickup', title='Local pickup').add_price(LabeledPrice('Pickup', 300))]
gives us [None,None],so It's better add_price to return self
2018-11-12 01:43:00 +02:00
Natanael Andrés Garrido 4131b05733
Update README.md
Adding another bot that user pyTelegramBotAPI.
2018-11-05 15:11:31 -03:00
Badiboy ad4be5c0ae Merge branch 'master' of https://github.com/eternnoir/pyTelegramBotAPI 2018-10-19 13:40:14 +03:00
FrankWang a946b79839
Merge pull request #586 from khode-mohsen/patch-2
Update deep_linking.py
2018-10-19 10:08:05 +08:00
FrankWang 4eeca78f2f
Merge pull request #585 from khode-mohsen/patch-1
Update echo_bot.py
2018-10-19 10:07:55 +08:00
FrankWang 2d6c2a345f
Merge pull request #577 from rmed/master
Add check for parse_mode in BaseInlineQueryResultCached
2018-10-19 10:07:40 +08:00
FrankWang e62eeb7ff2
Merge pull request #565 from uburuntu/analyzer-fixes
Some analyzer fixes
2018-10-19 10:06:37 +08:00
khode-mohsen 76fc8fbe5e
Update deep_linking.py
add '#!/usr/bin/python' for direct execute
2018-10-19 03:47:19 +03:30
khode-mohsen 584955962e
Update echo_bot.py
add '#!/usr/bin/env' for direct execute
2018-10-19 03:38:03 +03:30
FrankWang b8f442d06b
Update Bots using this API 2018-10-09 17:32:27 +08:00
Rafael Medina 891988be93
Added check for parse_mode in BaseInlineQueryResultCached. Should fix #571 2018-09-15 20:25:06 +02:00
Ramzan Bekbulatov 8636b282d7
Merge branch 'master' into analyzer-fixes 2018-09-07 18:07:37 +03:00
eternnoir 2c57c5c01c Update version. 2018-09-07 16:02:03 +08:00
FrankWang 07b82dc9b0
Merge pull request #575 from uburuntu/reset_session
Reset requests.Session feature
2018-09-07 15:56:59 +08:00
FrankWang a850a0d94f
Merge pull request #554 from uburuntu/patch-1
Pretty formatted docs for PyPI
2018-09-07 15:55:23 +08:00
FrankWang d4f1444503
Merge pull request #574 from setazer/master
fix typo + add inline keyboard example
2018-09-07 15:54:11 +08:00
uburuntu bab9f7bbb9 enh: reset requests.Session feature
Need for proxy changing and other reconnection stuff
2018-09-06 12:48:08 +03:00
SetazeR d9ace2adc8 fix typo + add inline keyboard example 2018-09-05 12:34:19 +07:00
uburuntu 36621bb22a fix: some intendation 2018-08-17 13:01:03 +03:00
uburuntu 99466017c5 enh: optimize imports 2018-08-17 12:54:26 +03:00
uburuntu feec1dde56 fix: little style fixes 2018-08-17 12:49:37 +03:00
uburuntu 54eba946be fix: wrong arguments usage (fix fa038c2) 2018-08-17 12:48:59 +03:00
uburuntu 65a272b901 fix: python 2/3 compatibility in examples 2018-08-17 12:47:44 +03:00
uburuntu 6a4c7e731b fix: delete doubled Sticker class (left a new one) 2018-08-17 12:46:40 +03:00
FrankWang 2b3c86b647
Merge pull request #562 from uburuntu/InputMedia
fix: python2 positional argument specifiers
2018-08-14 22:37:39 +08:00
uburuntu e419214b49 fix: python2 positional argument specifiers 2018-08-14 17:29:35 +03:00
FrankWang fe6959c38e
Merge pull request #561 from uburuntu/InputMedia
fix: support python2 super()
2018-08-14 21:58:48 +08:00
uburuntu 7dd53b1396 fix: support python2 super() 2018-08-14 12:23:15 +03:00
FrankWang 421118d9d8
Merge pull request #558 from uburuntu/InputMedia
v.4.0: InputMediaAnimation, InputMediaAudio, InputMediaDocument, editMessageMedia
2018-08-13 23:47:03 +08: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
FrankWang 12dbcb56d3
Update README.md 2018-08-09 08:45:07 +08:00
FrankWang a46975d038
Merge pull request #556 from Andru1999/patch-2
Fix issue When you use threading mode
2018-08-08 10:06:49 +08:00
Andru1999 494b535a91
Fix issue When you use threading mode 2018-08-08 10:46:23 +10:00
Ramzan Bekbulatov 74f75884f3
Delete now unused deprecated README.rst 2018-08-06 13:56:38 +03:00
Ramzan Bekbulatov 4eae469528
Use last version of README.md for PyPI docs with pretty formatting
https://packaging.python.org/specifications/core-metadata/#description-content-type
https://pypi.org/project/pyTelegramBotAPI/
2018-08-06 13:54:46 +03:00
eternnoir 41f7c07959 Update version. 2018-08-03 08:35:04 +08:00
eternnoir 35ea2a2b7e Fix #548 2018-08-03 08:34:48 +08:00
FrankWang 522b2b487b
Merge pull request #551 from heyyyoyy/origin/Bot_Api_3.6
Added parse mode for objects in Inline mode
2018-08-03 08:30:41 +08:00
heyyyoyy 5035e0ce80 Added parse mode for objects in Inline mode 2018-08-02 21:15:33 +03:00
eternnoir 7061091c1c Update version.
* Fix python 3.7 async
2018-07-31 08:58:04 +08:00
FrankWang 5c199bd246
Update README.md 2018-07-26 22:17:55 +08:00
FrankWang 44dd89881d
Update README.md 2018-07-26 21:41:08 +08:00
Badiboy 8634e65249 Fix kick_chat_member decription
Fix kick_chat_member return value type description (should be boolean according to API and is boolean by fact).
2018-07-25 12:44:18 +03:00
FrankWang 76dbb05259
Merge pull request #537 from Andru1999/patch-1
Update __init__.py
2018-07-24 13:05:02 +08:00
FrankWang 578a9383b2
Merge branch 'master' into patch-1 2018-07-24 10:42:04 +08:00
FrankWang 85093bded5
Merge pull request #515 from WaffleWafflerov/master
Saving next step and reply handlers
2018-07-24 10:39:35 +08: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
WaffleWafflerov f251def304
Merge branch 'master' into master 2018-07-22 04:43:53 +03:00
Andru1999 2b822f782d
Update __init__.py
I find bug when I use your library without threading. If call bot.register_next_step_handler in function that register next_handler in next_step_handlers but in function _notify_next_handlers this delete and bot don`t have handler, but in threading mode function self.next_step_handlers.pop(chat_id, None) has time to eval self.next_step_handlers.pop(chat_id, None) and bug disappear. Sorry for my English
2018-07-22 00:31:02 +10:00
FrankWang 8bc5b74495
Remove 3.7 stable. Travis ci not support now. 2018-07-03 22:34:28 +08:00
FrankWang 70426ac274
Merge pull request #526 from skar404/master
rename async -> async_dec
2018-07-03 11:19:29 +08:00
FrankWang a3a2bd5793
Add python 3.7 in travis ci.
#527
2018-07-03 11:17:44 +08:00
user c3b6ee9dc0
bug in travis-ci 2018-07-02 23:41:37 +03:00
user 4079772fd3
Update .travis.yml 2018-07-02 23:29:07 +03:00
user 9547a8d7b1
test python 3.7 2018-07-02 23:23:48 +03:00
users c8b2b14157 rename async -> async_dec 2018-07-02 18:13:11 +03:00
FrankWang 3d5ef5b1d8
Merge pull request #516 from Badiboy/master
_notify_next_handlers drops messages if empty handler list
2018-05-31 14:04:45 +08:00
Badiboy 776a699a8d _notify_next_handlers skips sequential messages
Is there are several sequential messages and next_step_handlers are set, the _notify_next_handlers will process only every even message dew to execute both .pop(i) and i+=1
2018-05-29 18:55:41 +03:00
Badiboy 78afd045d8 _notify_next_handlers drops messages if empty handler list
After calling
clear_step_handler(...)
code:
self.next_step_handlers[chat_id] = []
left the key in next_step_handlers.
When a next message arrives, the old handler executes nothing (no handlers), but still remove message from message queue:
new_messages.pop(i).

Updated to pop message only when there are real handlers in the list.
2018-05-27 23:24:37 +03:00
FrankWang 06faed887c
Merge pull request #509 from Badiboy/master
html_text fix and html_caption
2018-05-27 23:14:37 +08:00
Waffle bc855f7610 Fix register_for_reply_by_message_id and register_for_reply doc strings. 2018-05-27 17:05:01 +03:00
Waffle 893d5386c5 Fix register_for_reply_by_message_id doc strings. 2018-05-27 17:02:04 +03:00
Waffle 909d570dca Add warning about lambda functions in callbacks 2018-05-27 17:01:07 +03:00
Waffle 424c77fd2c Remove type hint for 2.x and PyPy python compatibility 2018-05-27 16:54:56 +03:00
Waffle 333949683f Add doc strings to new TeleBot methods
Update telebot/__init__.py
2018-05-27 01:37:06 +03:00
Waffle fa038c2e42 Move del_file_after_loading param to right methods :face_palm:
Update: telebot/__init__.py
2018-05-27 01:30:14 +03:00
Waffle d61de35a32 Remove rudiment json things, again!
Update: telebot/__init__.py
2018-05-27 01:23:20 +03:00
Waffle 13df7b5908 Add enable_save_next_step_handlers and load_next_step_handlers methods to step_example/
Update: examples/step_example.py
2018-05-26 17:21:39 +03:00
Waffle 1de356dcc3 Change default save directory to "./.handler-saves/".
Add del_file_after_loading param to load methods.

Update: telebot/__init__.py
2018-05-26 17:10:00 +03:00
Waffle 47e6dfd6bc Remove rudiment json things
Update: telebot/__init__.py
2018-05-26 16:52:30 +03:00
Waffle 3c890a7846 Remove 2 spaces up to TeleBot class.
Update: telebot/__init__.py
2018-05-26 16:37:25 +03:00
Waffle 17971ff48b Move from json to pickle.
Update: relebot/__init__.py
2018-05-26 12:19:01 +03:00
Waffle b989b7601b Add new class: Handler
Change type of (next step|reply) handlers from dict to Handler [WIP]

update: telebot/__init__.py
2018-05-25 20:57:22 +03:00
Waffle 8c574a786a Merge branch 'master' of https://github.com/WaffleWafflerov/pyTelegramBotAPI-1 2018-05-25 20:37:36 +03:00
Waffle 7e5f51e4ab Remove old thing.
Update telebot/__init__.py
2018-05-25 09:44:43 +03:00
Waffle 018e4597a2 Add del_file_after_loading param to Saver.return_load_handlers and Saver.load_handlers methods.
Update telebot/__init__.py
2018-05-25 09:40:29 +03:00
Waffle 7df6b3d4c9 Fix situation where delay <= 0.
Update telebot/__init__.py
2018-05-25 09:35:39 +03:00
Waffle 4facc5f7d7 fix unenabled saving handlers.
Updated telebot/__init__.py
2018-05-25 09:30:10 +03:00
Waffle 4bcfc34a50 Update _notify_next_handlers and _notify_reply_handlers methods:
Now if there wasn't any handler updates, timer willn't start.
2018-05-25 09:07:59 +03:00
Waffle b1d5cb2129 Rewrite.
Add class 'Saver' that provides methods for saving (next step|reply) handlers.
Add methods
enable_save_next_step_handlers,
enable_save_reply_handlers,
disable_save_next_step_handlers,
disable_save_reply_handlers,
load_next_step_handlers,
load_reply_handlers
to Telebot and AsyncTelebot.

update telebot/__init__.py
2018-05-25 08:57:48 +03:00
Waffle 00c8dcc19b Add async methods 2018-05-25 03:10:40 +03:00
Waffle ed7e33b4c6 Fix loadings funcs 2018-05-25 02:48:46 +03:00
Waffle 74a952846c Merge branch 'master' of https://github.com/CoconutWaffle/pyTelegramBotAPI-1 2018-05-24 18:32:25 +03:00
Waffle e99fb8f84f Add methods to save (reply|next step) handlers [WIP] 2018-05-20 23:40:25 +03:00
Waffle 49aee14fca Make _test_filter method static and a bit clear doc strings 2018-05-19 00:42:06 +03:00
CoconutWaffle 9267da205d
Merge pull request #1 from eternnoir/master
Updating fork
2018-05-19 00:35:58 +03:00
Badiboy 9c79ba2f87 html_text fix and html_caption
html_text now works with text_link
html_caption now works for caption/caption_entities
2018-05-14 13:29:34 +03:00
eternnoir 3be21ae361 Update version. 2018-05-14 10:15:05 +08:00
FrankWang 42343c3a7f
Merge pull request #490 from CoconutWaffle/master
Fixing and upgrading next step and reply handlers. + minor fixes
2018-05-04 07:20:18 +08:00
FrankWang 5a102ed8fa
Merge pull request #492 from sviat9440/master
Bugfixes (message.html_text offset)
2018-05-04 07:19:28 +08:00
FrankWang e1e109bef1
Merge pull request #502 from fojetin/patch-1
Fix #253 #231 #485
2018-05-04 07:18:57 +08:00
fojetin b5a217013a
Fix #253 #231 #485 2018-04-30 15:41:12 +03:00
Waffle 3ba9799b98 Renaming back pytelegrambotapi module to telebot 2018-04-28 13:50:59 +03:00
eternnoir 91f213ff34 Fix #501 2018-04-27 15:47:03 +08:00
eternnoir 8f55460924 Fix cache time is zero. 2018-04-26 09:53:55 +08:00
FrankWang f6b999053d
Merge pull request #497 from khabibr/master
Update apihelper.py
2018-04-24 23:52:45 +08:00
khabibr 99ff104a3f
Update apihelper.py
Correct files downloading when proxy used.
2018-04-24 16:48:39 +06:00
FrankWang 662c2c8797
Merge pull request #495 from BennyThink/master
fix issue #403: UnicodeEncodeError when sending a non-ASCII file in Python 2
2018-04-18 20:05:19 +09:00
FrankWang 72a0199a2f
Merge pull request #496 from Jay-T/master
Update README.md
2018-04-18 20:04:27 +09:00
Jay-T 989cae597b
Update README.md 2018-04-18 13:10:22 +05: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
FrankWang 28111bdf4e
Merge pull request #494 from LeoNeeDpk1/patch-1
Update README.md SOCKS5 proxy info
2018-04-18 11:51:44 +09:00
LeoNeeD 10ec897fb5
Update README.md
Updated and 100% working info in SOCKS5 proxy block.
2018-04-18 10:05:26 +12:00
sviat9440 ffe3a0c3d7 Update types.py
-- Fix encoding bug (emoji shifted offset)
2018-04-15 19:19:29 +03:00
sviat9440 f5f48db6ba
Merge pull request #1 from eternnoir/master
Update
2018-04-15 19:17:46 +03:00
Waffle 183230e927 Update setup.py 2018-04-12 17:24:04 +03:00
Waffle 7957bc45a8 Fixing and upgrading next step and reply handlers. + minor fixes
Rename telebot package to pytelegrambotapi becouse lib named telebot exists and it raising many errors

Add methods:
|     register_for_reply_by_message_id,
|     register_next_step_handler_by_chat_id,
|     clear_reply_handlers,
|     clear_reply_handlers_by_message_id
2018-04-12 13:45:32 +03:00
eternnoir 373d4d37ff Fix test case. 2018-04-10 14:48:39 +08:00
FrankWang 0d0e37dae5
Merge pull request #487 from sviat9440/master
Bugfixes and minor improvements
2018-04-10 15:25:36 +09:00
sviat9440 36d088dfbf Bugfixes and minor improvements 2018-04-04 10:47:37 +03:00
FrankWang 9ae20b4815
Merge pull request #482 from sviat9440/master
Minor improvements
2018-03-25 21:39:27 +08:00
sviat9440 e761e1e1d9
Update apihelper.py 2018-03-25 14:54:28 +03:00
sviat9440 cb0256b37d
Update __init__.py 2018-03-25 13:22:35 +03:00
sviat9440 ff3cbaf45b
Update apihelper.py 2018-03-25 13:21:55 +03:00
eternnoir d231b1fbaa Bump version. 2018-03-23 19:59:42 +08:00
eternnoir 7f47f11444 Fix #481 2018-03-23 19:58:43 +08:00
sviat9440 0422e62f65
Update types.py
Fix
2018-03-21 10:45:34 +03:00
sviat9440 82e252ec46
Update types.py
Fix
2018-03-21 10:44:37 +03:00
sviat9440 c11a9f810c
Update types.py
Added 'json' property to class 'Message', to quickly save a message to the database
2018-03-21 07:35:42 +03:00
German d17d28a144
create field forward_from_message_id in Message
https://core.telegram.org/bots/api#message
2018-03-20 23:36:29 +03:00
FrankWang dadcd5a577
Update "Bots using this API" entry. 2018-03-19 15:13:48 +08:00
eternnoir afc9abc269 Add ci test for python 3.6 2018-03-10 14:48:30 +08:00
eternnoir e01f17e3a0 Bump version. 2018-03-10 14:46:47 +08:00
eternnoir 48e6757686 Fix import logger problem. 2018-03-10 14:41:34 +08:00
eternnoir 8495229ce1 Update version 3.6.0 2018-03-02 19:28:34 +08:00
FrankWang 3b60f7ca67
Merge pull request #462 from heyyyoyy/Bot_Api_3.6
Bot Api 3.6
2018-02-22 22:11:46 +08:00
FrankWang a1930e05c2
Merge pull request #463 from dmytrostriletskyi/master
Make the Heroku example actual
2018-02-22 20:52:53 +08:00
Dmytro Striletskyi bc067662dc Make the Heroku example actual 2018-02-16 17:52:37 +02: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
FrankWang 55302cb972
Merge pull request #445 from heyyyoyy/update_send_media_group
Added support for local files in the sendMediaGroup method
2018-02-01 19:24:50 +08:00
FrankWang f47653d2e4
Update README.md 2018-01-24 19:13:29 +08:00
eternnoir 94b4a25980 Update version. 2018-01-24 19:11:03 +08:00
eternnoir afac177d7d Fix missing media_group_id in message. 2018-01-24 19:05:38 +08:00
heyyyoyy 2637e29dbe Updated sendMediaGroup method 2018-01-15 16:08:50 +03:00
FrankWang 6d180e30f0
Merge pull request #443 from reacheight/master
fixed example of usage sendVideoNote method
2018-01-15 10:25:06 +08:00
FrankWang e2ed4cf065
Merge pull request #387 from fumycat/patch-1
Fix optional parameter
2018-01-15 10:23:26 +08:00
reacheight 8b2dea1d56 fixed example of usage sendVideoNote method 2018-01-10 00:26:44 +03:00
FrankWang 41e31de034
Merge pull request #429 from JekaFST/master
Fix for SendLocation with live period
2017-12-06 15:50:49 +08:00
JekaFST ae074fd5c9
Merge pull request #2 from JekaFST/JekaFST-live_location_fixes
Edit and stop live location fixes
2017-12-05 01:32:06 +03:00
JekaFST 60596a95b8
Edit and stop live location fixes
.token was missed in apihelper's methods calls
2017-12-05 01:31:47 +03:00
JekaFST 44531bcedf
Merge pull request #1 from JekaFST/JekaFST-FixLiveLocation
Fix for SendLocation with live period
2017-12-05 00:23:32 +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
FrankWang f0e64b3653
Merge pull request #428 from 0xVK/patch-1
Added SmartySBot to README
2017-12-04 16:21:41 +08:00
Vitaliy 8444ea588a
Added SmartySBot to README
Added SmartySBot to README
2017-12-03 20:34:37 +02:00
eternnoir b2f376a906 Remove debug message. Add content_type 2017-11-30 23:34:07 +08:00
eternnoir d0b4bb7c69 Bump version. 2017-11-29 14:09:57 +08:00
eternnoir c300195b49 Add provider_data . 2017-11-29 13:59:47 +08:00
eternnoir 2493b200a4 Add provider_data to sendInvoice. 2017-11-29 13:53:39 +08:00
eternnoir 8528ca9e4e Add some message content type. Fix #426 2017-11-29 13:48:34 +08:00
eternnoir e1a3ccadb7 Add sendMediaGroup method. 2017-11-29 13:45:25 +08:00
eternnoir a43f037bc9 Version update. 2017-11-15 00:42:50 +08:00
eternnoir 7ac246b801 Fix inline_query_handler not work. 2017-11-15 00:42:27 +08:00
eternnoir 47624a556e Update version. 2017-11-13 10:26:27 +08:00
eternnoir 8bdbc24014 Fix ShippingOption to_json. #414 2017-11-13 10:25:39 +08:00
eternnoir e45ced958a Update version to support 3.4. 2017-11-13 10:19:13 +08:00
eternnoir 46c803bf55 Fix shipping_options bug. #414
Update version.
2017-11-13 10:14:10 +08:00
eternnoir 3986f33d3a Fix caption_entities without default value. 2017-11-06 08:42:57 +08:00
FrankWang c327be5a03
Merge pull request #410 from 0xVK/fix-exec-handlers
#405 - Message has callback function but it exec command handlers too.
2017-11-04 21:28:21 +08:00
Vitaliy d8587419e1 Fixed bug when message has next step handler and exec command handlers. 2017-11-04 15:09:29 +02:00
FrankWang 35d7293ebd
Merge pull request #402 from MasterGroosha/master
Bot API 3.4: new methods for live locations, new objects.
2017-10-31 09:51:23 +08:00
Evgeny Petrov 8e71a612a6 Added missing methods definitions to __init__.py and Async Telebot 2017-10-22 20:07:51 +03:00
Evgeny Petrov 5f8d99664e Bot API 3.4: new methods for live locations, new objects. 2017-10-22 19:50:51 +03:00
FrankWang aaa968c27f Merge pull request #396 from MasterGroosha/patch-1
Added missing author_signature field to Message object
2017-09-25 16:42:38 +08:00
Evgeny Petrov 600c014515 Added missing author_signature field to Message object
`author_signature` field was checked, but never added to `Message` object.
2017-09-22 01:08:54 +03:00
FrankWang 0a80fafd76 Update README.md 2017-09-09 21:32:13 +08:00
FrankWang 4a11bb60b4 Update new_chat_member to new_chat_members 2017-09-08 15:47:16 +08:00
eternnoir 7d37374667 Fix test case. 2017-08-28 12:13:26 +08:00
FrankWang 6ad56eb30f Merge pull request #392 from MasterGroosha/master
Bot API 3.3
2017-08-28 11:50:25 +08:00
Evgeny Petrov 211f1c607d Bot API 3.3:
- Added the new field pinned_message to the Chat object.
- Added the new fields author_signature and forward_signature to the Message object.
- Added the new field is_bot to the User object.
2017-08-23 10:30:32 +03:00
FrankWang be786021dc Merge pull request #389 from mostafaqanbaryan/patch-1
Update __init__.py
2017-08-22 04:06:08 +07:00
mostafaqanbaryan 15d287919d Update __init__.py
Add clear_step_handler() for resetting bot
2017-08-21 14:40:47 +04:30
Fumycat af991ea76e Fix optional parameter 2017-08-20 01:36:08 +07:00
FrankWang 064b84ad3d Merge pull request #377 from GabrielRF/master
Update README.md
2017-08-13 00:40:50 +08:00
Gabriel R F 39b4f0a068 Merge branch 'master' into master 2017-08-10 15:03:39 -03:00
FrankWang 246e7e31d7 Update README.md 2017-08-08 21:50:54 +08:00
eternnoir 48bfb7b84f Update version. 2017-08-06 15:47:59 +08: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
eternnoir aefd666062 Update sticker set. 2017-08-06 12:00:26 +08:00
FrankWang 23d66afbb0 Merge pull request #381 from noirgif/master
change the documentation of TeleBot.polling in readme
2017-08-01 09:31:01 +08:00
noirgif ed29f9316f change the documentation of TeleBot.polling in readme 2017-07-30 23:24:30 -07:00
Gabriel R F e92dc3717e Update README.md 2017-07-24 14:28:27 -03:00
FrankWang c91ce6036b Merge pull request #372 from Kylmakalle/master
Async Methods for API v3.1
2017-07-23 15:50:02 +08:00
FrankWang cb60a1256f Merge pull request #374 from the31k/per_thread_requests_sessions
Per-thread requests sessions
2017-07-23 15:49:42 +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
the31k 1a80fc5a0e Per-thread singletons 2017-07-19 01:50:04 +03:00
FrankWang 488fb745b7 Merge pull request #359 from Yolley/master
Informative exception message for better exception handling
2017-07-07 10:45:23 +08:00
Kylmakalle 08d6ab549d Aync Methods for v3.1 2017-07-07 00:54:18 +03:00
Kylmakalle f718c36ea7 Merge remote-tracking branch 'refs/remotes/eternnoir/master' 2017-07-07 00:29:40 +03:00
Kylmakalle ed88939110 Merge remote-tracking branch 'refs/remotes/eternnoir/master' 2017-07-07 00:25:13 +03:00
eternnoir 0632cfb9b0 Fix new chat members. 2017-07-02 21:24:19 +08:00
eternnoir 4979589faf Fix not require args. #369 2017-07-02 21:08:36 +08:00
Yolley 242456d92b Update util.py 2017-06-20 15:45:18 +03:00
Yolley 328cabead6 Update util.py 2017-06-20 15:45:01 +03:00
183 changed files with 70923 additions and 3224 deletions

14
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,14 @@
## Description
Include changes, new features and etc:
## Describe your tests
How did you test your change?
Python version:
OS:
## Checklist:
- [ ] I added/edited example on new feature/change (if exists)
- [ ] My changes won't break backward compatibility
- [ ] I made changes both for sync and async

35
.github/workflows/setup_python.yml vendored Normal file
View File

@ -0,0 +1,35 @@
# This is a basic workflow to help you get started with Actions
name: Setup
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
#workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
all-setups:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9']
name: ${{ matrix.python-version }} and tests
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: |
pip3 install -r requirements.txt
python setup.py install
cd tests && py.test

11
.gitignore vendored
View File

@ -25,6 +25,7 @@ var/
.idea/
venv/
.venv/
# PyInstaller
# Usually these files are written by a python script from a template
@ -58,4 +59,12 @@ docs/_build/
# PyBuilder
target/
testMain.py
testMain.py
#VS Code
.vscode/
.DS_Store
*.code-workspace
# documentation
_build/

22
.readthedocs.yaml Normal file
View File

@ -0,0 +1,22 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.9"
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt

19
.readthedocs.yml Normal file
View File

@ -0,0 +1,19 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# Optionally build your docs in additional formats such as PDF and ePub
formats: all
# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: doc_req.txt

View File

@ -1,11 +1,10 @@
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "pypy"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "pypy3"
install: "pip install -r requirements.txt"
script:

588
README.md
View File

@ -1,11 +1,23 @@
[![PyPi Package Version](https://img.shields.io/pypi/v/pyTelegramBotAPI.svg)](https://pypi.python.org/pypi/pyTelegramBotAPI)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/pyTelegramBotAPI.svg)](https://pypi.python.org/pypi/pyTelegramBotAPI)
[![Documentation Status](https://readthedocs.org/projects/pytba/badge/?version=latest)](https://pytba.readthedocs.io/en/latest/?badge=latest)
[![PyPi downloads](https://img.shields.io/pypi/dm/pyTelegramBotAPI.svg)](https://pypi.org/project/pyTelegramBotAPI/)
[![PyPi status](https://img.shields.io/pypi/status/pytelegrambotapi.svg?style=flat-square)](https://pypi.python.org/pypi/pytelegrambotapi)
# <p align="center">pyTelegramBotAPI
<p align="center">A simple, but extensible Python implementation for the <a href="https://core.telegram.org/bots/api">Telegram Bot API</a>.
<p align="center">A simple, but extensible Python implementation for the <a href="https://core.telegram.org/bots/api">Telegram Bot API</a>.</p>
<p align="center">Both synchronous and asynchronous.</p>
[![Download Month](https://img.shields.io/pypi/v/pyTelegramBotAPI.svg)](https://pypi.python.org/pypi/pyTelegramBotAPI)
[![Build Status](https://travis-ci.org/eternnoir/pyTelegramBotAPI.svg?branch=master)](https://travis-ci.org/eternnoir/pyTelegramBotAPI)
## <p align="center">Supported Bot API version: <a href="https://core.telegram.org/bots/api#april-21-2023">6.7</a>!
* [Getting started.](#getting-started)
<h2><a href='https://pytba.readthedocs.io/en/latest/index.html'>Official documentation</a></h2>
<h2><a href='https://pytba.readthedocs.io/ru/latest/index.html'>Official ru documentation</a></h2>
## Contents
* [Getting started](#getting-started)
* [Writing your first bot](#writing-your-first-bot)
* [Prerequisites](#prerequisites)
* [A simple echo bot](#a-simple-echo-bot)
@ -14,31 +26,53 @@
* [Methods](#methods)
* [General use of the API](#general-use-of-the-api)
* [Message handlers](#message-handlers)
* [Edited Message handler](#edited-message-handler)
* [Channel Post handler](#channel-post-handler)
* [Edited Channel Post handler](#edited-channel-post-handler)
* [Callback Query handlers](#callback-query-handler)
* [Shipping Query Handler](#shipping-query-handler)
* [Pre Checkout Query Handler](#pre-checkout-query-handler)
* [Poll Handler](#poll-handler)
* [Poll Answer Handler](#poll-answer-handler)
* [My Chat Member Handler](#my-chat-member-handler)
* [Chat Member Handler](#chat-member-handler)
* [Chat Join request handler](#chat-join-request-handler)
* [Inline Mode](#inline-mode)
* [Inline handler](#inline-handler)
* [Chosen Inline handler](#chosen-inline-handler)
* [Answer Inline Query](#answer-inline-query)
* [Additional API features](#additional-api-features)
* [Middleware handlers](#middleware-handlers)
* [Custom filters](#custom-filters)
* [TeleBot](#telebot)
* [Reply markup](#reply-markup)
* [Inline Mode](#inline-mode)
* [Advanced use of the API](#advanced-use-of-the-api)
* [Asynchronous delivery of messages](#asynchronous-delivery-of-messages)
* [Using local Bot API Server](#using-local-bot-api-sever)
* [Asynchronous TeleBot](#asynchronous-telebot)
* [Sending large text messages](#sending-large-text-messages)
* [Controlling the amount of Threads used by TeleBot](#controlling-the-amount-of-threads-used-by-telebot)
* [The listener mechanism](#the-listener-mechanism)
* [Using web hooks](#using-web-hooks)
* [Logging](#logging)
* [Proxy](#proxy)
* [Testing](#testing)
* [API conformance limitations](#api-conformance-limitations)
* [AsyncTeleBot](#asynctelebot)
* [F.A.Q.](#faq)
* [Bot 2.0](#bot-20)
* [How can I distinguish a User and a GroupChat in message.chat?](#how-can-i-distinguish-a-user-and-a-groupchat-in-messagechat)
* [How can I handle reocurring ConnectionResetErrors?](#how-can-i-handle-reocurring-connectionreseterrors)
* [The Telegram Chat Group](#the-telegram-chat-group)
* [Telegram Channel](#telegram-channel)
* [More examples](#more-examples)
* [Bots using this API](#bots-using-this-api)
* [Code Template](#code-template)
* [Bots using this library](#bots-using-this-library)
## Getting started.
## Getting started
This API is tested with Python 2.6, Python 2.7, Python 3.4, Pypy and Pypy 3.
This API is tested with Python 3.7-3.11 and Pypy 3.
There are two ways to install the library:
* Installation using pip (a Python package manager)*:
* Installation using pip (a Python package manager):
```
$ pip install pyTelegramBotAPI
@ -50,10 +84,17 @@ $ git clone https://github.com/eternnoir/pyTelegramBotAPI.git
$ cd pyTelegramBotAPI
$ python setup.py install
```
or:
```
$ pip install git+https://github.com/eternnoir/pyTelegramBotAPI.git
```
It is generally recommended to use the first option.
**While the API is production-ready, it is still under development and it has regular updates, do not forget to update it regularly by calling `pip install pytelegrambotapi --upgrade`*
*While the API is production-ready, it is still under development and it has regular updates, do not forget to update it regularly by calling*
```
pip install pytelegrambotapi --upgrade
```
## Writing your first bot
@ -71,7 +112,7 @@ Then, open the file and create an instance of the TeleBot class.
```python
import telebot
bot = telebot.TeleBot("TOKEN")
bot = telebot.TeleBot("TOKEN", parse_mode=None) # You can set parse_mode by default. HTML or MARKDOWN
```
*Note: Make sure to actually replace TOKEN with your own API token.*
@ -97,13 +138,13 @@ This one echoes all incoming text messages back to the sender. It uses a lambda
We now have a basic bot which replies a static message to "/start" and "/help" commands and which echoes the rest of the sent messages. To start the bot, add the following to our source file:
```python
bot.polling()
bot.infinity_polling()
```
Alright, that's it! Our source file now looks like this:
```python
import telebot
bot = telebot.TeleBot("TOKEN")
bot = telebot.TeleBot("YOUR_BOT_TOKEN")
@bot.message_handler(commands=['start', 'help'])
def send_welcome(message):
@ -113,7 +154,7 @@ def send_welcome(message):
def echo_all(message):
bot.reply_to(message, message.text)
bot.polling()
bot.infinity_polling()
```
To start the bot, simply open up a terminal and enter `python echo_bot.py` to run the bot! Test it by sending commands ('/start' and '/help') and arbitrary text messages.
@ -124,7 +165,7 @@ To start the bot, simply open up a terminal and enter `python echo_bot.py` to ru
All types are defined in types.py. They are all completely in line with the [Telegram API's definition of the types](https://core.telegram.org/bots/api#available-types), except for the Message's `from` field, which is renamed to `from_user` (because `from` is a Python reserved token). Thus, attributes such as `message_id` can be accessed directly with `message.message_id`. Note that `message.chat` can be either an instance of `User` or `GroupChat` (see [How can I distinguish a User and a GroupChat in message.chat?](#how-can-i-distinguish-a-user-and-a-groupchat-in-messagechat)).
The Message object also has a `content_type`attribute, which defines the type of the Message. `content_type` can be one of the following strings:
`text`, `audio`, `document`, `photo`, `sticker`, `video`, `video_note`, `voice`, `location`, `contact`, `new_chat_member`, `left_chat_member`, `new_chat_title`, `new_chat_photo`, `delete_chat_photo`, `group_chat_created`, `supergroup_chat_created`, `channel_chat_created`, `migrate_to_chat_id`, `migrate_from_chat_id`, `pinned_message`.
`text`, `audio`, `document`, `photo`, `sticker`, `video`, `video_note`, `voice`, `location`, `contact`, `new_chat_members`, `left_chat_member`, `new_chat_title`, `new_chat_photo`, `delete_chat_photo`, `group_chat_created`, `supergroup_chat_created`, `channel_chat_created`, `migrate_to_chat_id`, `migrate_from_chat_id`, `pinned_message`, `web_app_data`.
You can use some types in one function. Example:
@ -140,7 +181,7 @@ Outlined below are some general use cases of the API.
#### Message handlers
A message handler is a function that is decorated with the `message_handler` decorator of a TeleBot instance. Message handlers consist of one or multiple filters.
Each filter much return True for a certain message in order for a message handler to become eligible to handle that message. A message handler is declared in the following way (provided `bot` is an instance of TeleBot):
Each filter must return True for a certain message in order for a message handler to become eligible to handle that message. A message handler is declared in the following way (provided `bot` is an instance of TeleBot):
```python
@bot.message_handler(filters)
def function_name(message):
@ -154,10 +195,11 @@ TeleBot supports the following filters:
|name|argument(s)|Condition|
|:---:|---| ---|
|content_types|list of strings (default `['text']`)|`True` if message.content_type is in the list of strings.|
|regexp|a regular expression as a string|`True` if `re.search(regexp_arg)` returns `True` and `message.content_type == 'text'` (See [Python Regular Expressions](https://docs.python.org/2/library/re.html)|
|regexp|a regular expression as a string|`True` if `re.search(regexp_arg)` returns `True` and `message.content_type == 'text'` (See [Python Regular Expressions](https://docs.python.org/2/library/re.html))|
|commands|list of strings|`True` if `message.content_type == 'text'` and `message.text` starts with a command that is in the list of strings.|
|func|a function (lambda or function reference)|`True` if the lambda or function reference returns `True`
|chat_types|list of chat types|`True` if `message.chat.type` in your filter|
|func|a function (lambda or function reference)|`True` if the lambda or function reference returns `True`|
Here are some examples of using the filters and message handlers:
```python
@ -179,17 +221,17 @@ def handle_docs_audio(message):
def handle_message(message):
pass
#Handles all messages for which the lambda returns True
# Handles all messages for which the lambda returns True
@bot.message_handler(func=lambda message: message.document.mime_type == 'text/plain', content_types=['document'])
def handle_text_doc(message):
pass
#Which could also be defined as:
# Which could also be defined as:
def test_message(message):
return message.document.mime_type == 'text/plain'
@bot.message_handler(func=test_message, content_types=['document'])
def handle_text_doc(message)
def handle_text_doc(message):
pass
# Handlers can be stacked to create a function which will be called if either message_handler is eligible
@ -201,28 +243,177 @@ def send_something(message):
```
**Important: all handlers are tested in the order in which they were declared**
#### Edited Message handlers
#### Edited Message handler
Handle edited messages
`@bot.edited_message_handler(filters) # <- passes a Message type object to your function`
Same as Message handlers
#### Channel Post handler
Handle channel post messages
`@bot.channel_post_handler(filters) # <- passes a Message type object to your function`
#### channel_post_handler
Same as Message handlers
#### edited_channel_post_handler
Same as Message handlers
#### Edited Channel Post handler
Handle edited channel post messages
`@bot.edited_channel_post_handler(filters) # <- passes a Message type object to your function`
#### Callback Query Handler
In bot2.0 update. You can get `callback_query` in update object. In telebot use `callback_query_handler` to process callback_querys.
Handle callback queries
```python
@bot.callback_query_handler(func=lambda call: True)
def test_callback(call):
def test_callback(call): # <- passes a CallbackQuery type object to your function
logger.info(call)
```
#### Shipping Query Handler
Handle shipping queries
`@bot.shipping_query_handler() # <- passes a ShippingQuery type object to your function`
#### Pre Checkout Query Handler
Handle pre checkoupt queries
`@bot.pre_checkout_query_handler() # <- passes a PreCheckoutQuery type object to your function`
#### Poll Handler
Handle poll updates
`@bot.poll_handler() # <- passes a Poll type object to your function`
#### Poll Answer Handler
Handle poll answers
`@bot.poll_answer_handler() # <- passes a PollAnswer type object to your function`
#### My Chat Member Handler
Handle updates of a the bot's member status in a chat
`@bot.my_chat_member_handler() # <- passes a ChatMemberUpdated type object to your function`
#### Chat Member Handler
Handle updates of a chat member's status in a chat
`@bot.chat_member_handler() # <- passes a ChatMemberUpdated type object to your function`
*Note: "chat_member" updates are not requested by default. If you want to allow all update types, set `allowed_updates` in `bot.polling()` / `bot.infinity_polling()` to `util.update_types`*
#### Chat Join Request Handler
Handle chat join requests using:
`@bot.chat_join_request_handler() # <- passes ChatInviteLink type object to your function`
### Inline Mode
More information about [Inline mode](https://core.telegram.org/bots/inline).
#### Inline handler
Now, you can use inline_handler to get inline queries in telebot.
```python
@bot.inline_handler(lambda query: query.query == 'text')
def query_text(inline_query):
# Query message is text
```
#### Chosen Inline handler
Use chosen_inline_handler to get chosen_inline_result in telebot. Don't forgot add the /setinlinefeedback
command for @Botfather.
More information : [collecting-feedback](https://core.telegram.org/bots/inline#collecting-feedback)
```python
@bot.chosen_inline_handler(func=lambda chosen_inline_result: True)
def test_chosen(chosen_inline_result):
# Process all chosen_inline_result.
```
#### Answer Inline Query
```python
@bot.inline_handler(lambda query: query.query == 'text')
def query_text(inline_query):
try:
r = types.InlineQueryResultArticle('1', 'Result', types.InputTextMessageContent('Result message.'))
r2 = types.InlineQueryResultArticle('2', 'Result2', types.InputTextMessageContent('Result message2.'))
bot.answer_inline_query(inline_query.id, [r, r2])
except Exception as e:
print(e)
```
### Additional API features
#### Middleware Handlers
A middleware handler is a function that allows you to modify requests or the bot context as they pass through the
Telegram to the bot. You can imagine middleware as a chain of logic connection handled before any other handlers are
executed. Middleware processing is disabled by default, enable it by setting `apihelper.ENABLE_MIDDLEWARE = True`.
```python
apihelper.ENABLE_MIDDLEWARE = True
@bot.middleware_handler(update_types=['message'])
def modify_message(bot_instance, message):
# modifying the message before it reaches any other handler
message.another_text = message.text + ':changed'
@bot.message_handler(commands=['start'])
def start(message):
# the message is already modified when it reaches message handler
assert message.another_text == message.text + ':changed'
```
There are other examples using middleware handler in the [examples/middleware](examples/middleware) directory.
#### Class-based middlewares
There are class-based middlewares.
Basic class-based middleware looks like this:
```python
class Middleware(BaseMiddleware):
def __init__(self):
self.update_types = ['message']
def pre_process(self, message, data):
data['foo'] = 'Hello' # just for example
# we edited the data. now, this data is passed to handler.
# return SkipHandler() -> this will skip handler
# return CancelUpdate() -> this will cancel update
def post_process(self, message, data, exception=None):
print(data['foo'])
if exception: # check for exception
print(exception)
```
Class-based middleware should have to functions: post and pre process.
So, as you can see, class-based middlewares work before and after handler execution.
For more, check out in [examples](https://github.com/eternnoir/pyTelegramBotAPI/tree/master/examples/middleware/class_based)
#### Custom filters
Also, you can use built-in custom filters. Or, you can create your own filter.
[Example of custom filter](https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/custom_filters/general_custom_filters.py)
Also, we have examples on them. Check this links:
You can check some built-in filters in source [code](https://github.com/eternnoir/pyTelegramBotAPI/blob/master/telebot/custom_filters.py)
Example of [filtering by id](https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/custom_filters/id_filter_example.py)
Example of [filtering by text](https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/custom_filters/text_filter_example.py)
If you want to add some built-in filter, you are welcome to add it in custom_filters.py file.
Here is example of creating filter-class:
```python
class IsAdmin(telebot.custom_filters.SimpleCustomFilter):
# Class will check whether the user is admin or creator in group or not
key='is_chat_admin'
@staticmethod
def check(message: telebot.types.Message):
return bot.get_chat_member(message.chat.id,message.from_user.id).status in ['administrator','creator']
# To register filter, you need to use method add_custom_filter.
bot.add_custom_filter(IsAdmin())
# Now, you can use it in handler.
@bot.message_handler(is_chat_admin=True)
def admin_of_group(message):
bot.send_message(message.chat.id, 'You are admin of this group!')
```
#### TeleBot
```python
import telebot
@ -231,11 +422,10 @@ TOKEN = '<token_string>'
tb = telebot.TeleBot(TOKEN) #create a new Telegram Bot object
# Upon calling this function, TeleBot starts polling the Telegram servers for new messages.
# - none_stop: True/False (default False) - Don't stop polling when receiving an error from the Telegram servers
# - interval: True/False (default False) - The interval between polling requests
# Note: Editing this parameter harms the bot's response time
# - block: True/False (default True) - Blocks upon calling this function
tb.polling(none_stop=False, interval=0, block=True)
# - interval: int (default 0) - The interval between polling requests
# - timeout: integer (default 20) - Timeout in seconds for long polling.
# - allowed_updates: List of Strings (default None) - List of update types to request
tb.infinity_polling(interval=0, timeout=20)
# getMe
user = tb.get_me()
@ -247,10 +437,14 @@ tb.remove_webhook()
# getUpdates
updates = tb.get_updates()
# or
updates = tb.get_updates(1234,100,20) #get_Updates(offset, limit, timeout):
# sendMessage
tb.send_message(chatid, text)
tb.send_message(chat_id, text)
# editMessageText
tb.edit_message_text(new_text, chat_id, message_id)
# forwardMessage
tb.forward_message(to_chat_id, from_chat_id, message_id)
@ -291,8 +485,8 @@ tb.send_video(chat_id, "FILEID")
# sendVideoNote
videonote = open('/tmp/videonote.mp4', 'rb')
tb.send_video(chat_id, videonote)
tb.send_video(chat_id, "FILEID")
tb.send_video_note(chat_id, videonote)
tb.send_video_note(chat_id, "FILEID")
# sendLocation
tb.send_location(chat_id, lat, lon)
@ -365,49 +559,8 @@ ForceReply:
![ForceReply](https://farm4.staticflickr.com/3809/32418726814_d1baec0fc2_o_d.jpg "ForceReply")
### Inline Mode
More information about [Inline mode](https://core.telegram.org/bots/inline).
#### inline_handler
Now, you can use inline_handler to get inline_query in telebot.
```python
@bot.inline_handler(lambda query: query.query == 'text')
def query_text(inline_query):
# Query message is text
```
#### chosen_inline_handler
Use chosen_inline_handler to get chosen_inline_result in telebot. Don't forgot add the /setinlinefeedback
command for @Botfather.
More information : [collecting-feedback](https://core.telegram.org/bots/inline#collecting-feedback)
```python
@bot.chosen_inline_handler(func=lambda chosen_inline_result: True)
def test_chosen(chosen_inline_result):
# Process all chosen_inline_result.
```
#### answer_inline_query
```python
@bot.inline_handler(lambda query: query.query == 'text')
def query_text(inline_query):
try:
r = types.InlineQueryResultArticle('1', 'Result', types.InputTextMessageContent('Result message.'))
r2 = types.InlineQueryResultArticle('2', 'Result2', types.InputTextMessageContent('Result message2.'))
bot.answer_inline_query(inline_query.id, [r, r2])
except Exception as e:
print(e)
```
### Working with entities:
### Working with entities
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
Attributes:
* `type`
@ -425,26 +578,38 @@ Refer [Bot Api](https://core.telegram.org/bots/api#messageentity) for extra deta
## Advanced use of the API
### Asynchronous delivery of messages
There exists an implementation of TeleBot which executes all `send_xyz` and the `get_me` functions asynchronously. This can speed up you bot __significantly__, but it has unwanted side effects if used without caution.
### Using local Bot API Sever
Since version 5.0 of the Bot API, you have the possibility to run your own [Local Bot API Server](https://core.telegram.org/bots/api#using-a-local-bot-api-server).
pyTelegramBotAPI also supports this feature.
```python
from telebot import apihelper
apihelper.API_URL = "http://localhost:4200/bot{0}/{1}"
```
**Important: Like described [here](https://core.telegram.org/bots/api#logout), you have to log out your bot from the Telegram server before switching to your local API server. in pyTelegramBotAPI use `bot.log_out()`**
*Note: 4200 is an example port*
### Asynchronous TeleBot
New: There is an asynchronous implementation of telebot.
To enable this behaviour, create an instance of AsyncTeleBot instead of TeleBot.
```python
tb = telebot.AsyncTeleBot("TOKEN")
```
Now, every function that calls the Telegram API is executed in a separate Thread. The functions are modified to return an AsyncTask instance (defined in util.py). Using AsyncTeleBot allows you to do the following:
Now, every function that calls the Telegram API is executed in a separate asynchronous task.
Using AsyncTeleBot allows you to do the following:
```python
import telebot
tb = telebot.AsyncTeleBot("TOKEN")
task = tb.get_me() # Execute an API call
# Do some other operations...
a = 0
for a in range(100):
a += 10
result = task.wait() # Get the result of the execution
@tb.message_handler(commands=['start'])
async def start_message(message):
await bot.send_message(message.chat.id, 'Hello!')
```
*Note: if you execute send_xyz functions after eachother without calling wait(), the order in which messages are delivered might be wrong.*
See more in [examples](https://github.com/eternnoir/pyTelegramBotAPI/tree/master/examples/asynchronous_telebot)
### Sending large text messages
Sometimes you must send messages that exceed 5000 characters. The Telegram API can not handle that many characters in one request, so we need to split the message in multiples. Here is how to do that using the API:
@ -455,6 +620,19 @@ large_text = open("large_text.txt", "rb").read()
# Split the text each 3000 characters.
# split_string returns a list with the splitted text.
splitted_text = util.split_string(large_text, 3000)
for text in splitted_text:
tb.send_message(chat_id, text)
```
Or you can use the new `smart_split` function to get more meaningful substrings:
```python
from telebot import util
large_text = open("large_text.txt", "rb").read()
# Splits one string into multiple strings, with a maximum amount of `chars_per_string` (max. 4096)
# Splits by last '\n', '. ' or ' ' in exactly this priority.
# smart_split returns a list with the splitted text.
splitted_text = util.smart_split(large_text, chars_per_string=3000)
for text in splitted_text:
tb.send_message(chat_id, text)
```
@ -465,7 +643,10 @@ The TeleBot constructor takes the following optional arguments:
TeleBot should execute message handlers on it's polling Thread.
### The listener mechanism
As an alternative to the message handlers, one can also register a function as a listener to TeleBot. Example:
As an alternative to the message handlers, one can also register a function as a listener to TeleBot.
NOTICE: handlers won't disappear! Your message will be processed both by handlers and listeners. Also, it's impossible to predict which will work at first because of threading. If you use threaded=False, custom listeners will work earlier, after them handlers will be called.
Example:
```python
def handle_messages(messages):
for message in messages:
@ -473,16 +654,15 @@ def handle_messages(messages):
bot.reply_to(message, 'Hi')
bot.set_update_listener(handle_messages)
bot.polling()
bot.infinity_polling()
```
### Using web hooks
When using webhooks telegram sends one Update per call, for processing it you should call process_new_messages([update.message]) when you recieve it.
There are some examples using webhooks in the *examples/webhook_examples* directory.
There are some examples using webhooks in the [examples/webhook_examples](examples/webhook_examples) directory.
### Logging
You can use the Telebot module logger to log debug info about Telebot. Use `telebot.logger` to get the logger of the TeleBot module.
It is possible to add custom logging Handlers to the logger. Refer to the [Python logging module page](https://docs.python.org/2/library/logging.html) for more info.
@ -494,91 +674,223 @@ telebot.logger.setLevel(logging.DEBUG) # Outputs debug messages to console.
```
### Proxy
For sync:
You can use proxy for request. `apihelper.proxy` object will use by call `requests` proxies argument.
```python
from telebot import apihelper
apihelper.proxy = {'http', 'http://10.10.1.10:3128'}
apihelper.proxy = {'http':'http://127.0.0.1:3128'}
```
If you want to use socket5 proxy you need install dependency `pip install requests[socks]`.
If you want to use socket5 proxy you need install dependency `pip install requests[socks]` and make sure, that you have the latest version of `gunicorn`, `PySocks`, `pyTelegramBotAPI`, `requests` and `urllib3`.
```python
proxies = {
'http': 'socks5://user:pass@host:port',
'https': 'socks5://user:pass@host:port'
}
apihelper.proxy = {'https':'socks5://userproxy:password@proxy_address:port'}
```
For async:
```python
from telebot import asyncio_helper
asyncio_helper.proxy = 'http://127.0.0.1:3128' #url
```
### Testing
You can disable or change the interaction with real Telegram server by using
```python
apihelper.CUSTOM_REQUEST_SENDER = your_handler
```
parameter. You can pass there your own function that will be called instead of _requests.request_.
For example:
```python
def custom_sender(method, url, **kwargs):
print("custom_sender. method: {}, url: {}, params: {}".format(method, url, kwargs.get("params")))
result = util.CustomRequestResponse('{"ok":true,"result":{"message_id": 1, "date": 1, "chat": {"id": 1, "type": "private"}}}')
return result
```
Then you can use API and proceed requests in your handler code.
```python
apihelper.CUSTOM_REQUEST_SENDER = custom_sender
tb = TeleBot("test")
res = tb.send_message(123, "Test")
```
Result will be:
`custom_sender. method: post, url: https://api.telegram.org/botololo/sendMessage, params: {'chat_id': '123', 'text': 'Test'}`
## API conformance limitations
* [Bot API 4.5](https://core.telegram.org/bots/api-changelog#december-31-2019) - No nested MessageEntities and Markdown2 support
* [Bot API 4.1](https://core.telegram.org/bots/api-changelog#august-27-2018) - No Passport support
* [Bot API 4.0](https://core.telegram.org/bots/api-changelog#july-26-2018) - No Passport support
## AsyncTeleBot
### Asynchronous version of telebot
We have a fully asynchronous version of TeleBot.
This class is not controlled by threads. Asyncio tasks are created to execute all the stuff.
### EchoBot
Echo Bot example on AsyncTeleBot:
```python
# This is a simple echo bot using the decorator mechanism.
# It echoes any incoming text messages.
from telebot.async_telebot import AsyncTeleBot
import asyncio
bot = AsyncTeleBot('TOKEN')
# Handle '/start' and '/help'
@bot.message_handler(commands=['help', 'start'])
async def send_welcome(message):
await bot.reply_to(message, """\
Hi there, I am EchoBot.
I am here to echo your kind words back to you. Just say anything nice and I'll say the exact same thing to you!\
""")
# Handle all other messages with content_type 'text' (content_types defaults to ['text'])
@bot.message_handler(func=lambda message: True)
async def echo_message(message):
await bot.reply_to(message, message.text)
asyncio.run(bot.polling())
```
As you can see here, keywords are await and async.
### Why should I use async?
Asynchronous tasks depend on processor performance. Many asynchronous tasks can run parallelly, while thread tasks will block each other.
### Differences in AsyncTeleBot
AsyncTeleBot is asynchronous. It uses aiohttp instead of requests module.
### Examples
See more examples in our [examples](https://github.com/eternnoir/pyTelegramBotAPI/tree/master/examples/asynchronous_telebot) folder
## F.A.Q.
### Bot 2.0
April 9,2016 Telegram release new bot 2.0 API, which has a drastic revision especially for the change of method's interface.If you want to update to the latest version, please make sure you've switched bot's code to bot 2.0 method interface.
[More information about pyTelegramBotAPI support bot2.0](https://github.com/eternnoir/pyTelegramBotAPI/issues/130)
### How can I distinguish a User and a GroupChat in message.chat?
Telegram Bot API support new type Chat for message.chat.
- Check the ```type``` attribute in ```Chat``` object:
-
```python
if message.chat.type == “private”:
# private chat message
if message.chat.type == "private":
# private chat message
if message.chat.type == “group”:
if message.chat.type == "group":
# group chat message
if message.chat.type == “supergroup”:
if message.chat.type == "supergroup":
# supergroup chat message
if message.chat.type == “channel”:
if message.chat.type == "channel":
# channel message
```
### How can I handle reocurring ConnectionResetErrors?
Bot instances that were idle for a long time might be rejected by the server when sending a message due to a timeout of the last used session. Add `apihelper.SESSION_TIME_TO_LIVE = 5 * 60` to your initialisation to force recreation after 5 minutes without any activity.
## The Telegram Chat Group
Get help. Discuss. Chat.
* Join the [pyTelegramBotAPI Telegram Chat Group](https://telegram.me/joinchat/Bn4ixj84FIZVkwhk2jag6A)
* We now have a Telegram Channel as well! Keep yourself up to date with API changes, and [join it](https://telegram.me/pytelegrambotapi).
## Telegram Channel
Join the [News channel](https://t.me/pyTelegramBotAPI). Here we will post releases and updates.
## More examples
* [Echo Bot](https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/echo_bot.py)
* [Deep Linking](https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/deep_linking.py)
* [next_step_handler Example](https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/step_example.py)
## Bots using this API
## Code Template
Template is a ready folder that contains architecture of basic project.
Here are some examples of template:
* [AsyncTeleBot template](https://github.com/coder2020official/asynctelebot_template)
* [TeleBot template](https://github.com/coder2020official/telebot_template)
## Bots using this library
* [SiteAlert bot](https://telegram.me/SiteAlert_bot) ([source](https://github.com/ilteoood/SiteAlert-Python)) by *ilteoood* - Monitors websites and sends a notification on changes
* [TelegramLoggingBot](https://github.com/aRandomStranger/TelegramLoggingBot) by *aRandomStranger*
* [Send to Kindle Bot](https://telegram.me/Send2KindleBot) by *GabrielRF* - Send to Kindle files or links to files.
* [Telegram LMGTFY_bot](https://github.com/GabrielRF/telegram-lmgtfy_bot) ([source](https://github.com/GabrielRF/telegram-lmgtfy_bot)) by *GabrielRF* - Let me Google that for you.
* [Telegram UrlProBot](https://github.com/GabrielRF/telegram-urlprobot) ([source](https://github.com/GabrielRF/telegram-urlprobot)) by *GabrielRF* - URL shortener and URL expander.
* [Telegram Proxy Bot](https://bitbucket.org/master_groosha/telegram-proxy-bot) by *Groosha* - A simple BITM (bot-in-the-middle) for Telegram acting as some kind of "proxy".
* [Telegram Proxy Bot](https://github.com/mrgigabyte/proxybot) by *mrgigabyte* - `Credits for the original version of this bot goes to` **Groosha** `, simply added certain features which I thought were needed`.
* [Telegram LMGTFY_bot](https://github.com/GabrielRF/telegram-lmgtfy_bot) by *GabrielRF* - Let me Google that for you.
* [Telegram Proxy Bot](https://github.com/mrgigabyte/proxybot) by *mrgigabyte*
* [RadRetroRobot](https://github.com/Tronikart/RadRetroRobot) by *Tronikart* - Multifunctional Telegram Bot RadRetroRobot.
* [League of Legends bot](https://telegram.me/League_of_Legends_bot) ([source](https://github.com/i32ropie/lol)) by *i32ropie*
* [NeoBot](https://github.com/neoranger/NeoBot) by *neoranger*
* [TagAlertBot](https://github.com/pitasi/TagAlertBot) by *pitasi*
* [NeoBot](https://github.com/neoranger/NeoBot) by [@NeoRanger](https://github.com/neoranger)
* [ColorCodeBot](https://t.me/colorcodebot) ([source](https://github.com/andydecleyre/colorcodebot)) - Share code snippets as beautifully syntax-highlighted HTML and/or images.
* [ComedoresUGRbot](http://telegram.me/ComedoresUGRbot) ([source](https://github.com/alejandrocq/ComedoresUGRbot)) by [*alejandrocq*](https://github.com/alejandrocq) - Telegram bot to check the menu of Universidad de Granada dining hall.
* [picpingbot](https://web.telegram.org/#/im?p=%40picpingbot) - Fun anonymous photo exchange by Boogie Muffin.
* [TheZigZagProject](https://github.com/WebShark025/TheZigZagProject) - The 'All In One' bot for Telegram! by WebShark025
* [proxybot](https://github.com/p-hash/proxybot) - Simple Proxy Bot for Telegram. by p-hash
* [DonantesMalagaBot](https://github.com/vfranch/DonantesMalagaBot)- DonantesMalagaBot facilitates information to Malaga blood donors about the places where they can donate today or in the incoming days. It also records the date of the last donation so that it helps the donors to know when they can donate again. - by vfranch
* [DonantesMalagaBot](https://github.com/vfranch/DonantesMalagaBot) - DonantesMalagaBot facilitates information to Malaga blood donors about the places where they can donate today or in the incoming days. It also records the date of the last donation so that it helps the donors to know when they can donate again. - by vfranch
* [DuttyBot](https://github.com/DmytryiStriletskyi/DuttyBot) by *Dmytryi Striletskyi* - Timetable for one university in Kiev.
* [dailypepebot](https://telegram.me/dailypepebot) by [*Jaime*](https://github.com/jiwidi/Dailypepe) - Get's you random pepe images and gives you their id, then you can call this image with the number.
* [DailyQwertee](https://t.me/DailyQwertee) by [*Jaime*](https://github.com/jiwidi/DailyQwertee) - Bot that manages a channel that sends qwertee daily tshirts every day at 00:00
* [wat-bridge](https://github.com/rmed/wat-bridge) by [*rmed*](https://github.com/rmed) - Send and receive messages to/from WhatsApp through Telegram
* [flibusta_bot](https://github.com/Kurbezz/flibusta_bot) by [*Kurbezz*](https://github.com/Kurbezz)
* [EmaProject](https://github.com/halkliff/emaproject) by [*halkliff*](https://github.com/halkliff) - Ema - Eastern Media Assistant was made thinking on the ease-to-use feature. Coding here is simple, as much as is fast and powerful.
* [filmratingbot](http://t.me/filmratingbot)([source](https://github.com/jcolladosp/film-rating-bot)) by [*jcolladosp*](https://github.com/jcolladosp) - Telegram bot using the Python API that gets films rating from IMDb and metacritic
* [you2mp3bot](http://t.me/you2mp3bot)([link](https://storebot.me/bot/you2mp3bot)) - This bot can convert a Youtube video to Mp3. All you need is send the URL video.
* [areajugonesbot](http://t.me/areajugonesbot)([link](http://t.me/areajugonesbot)) - The areajugonesbot sends news published on the videogames blog Areajugones to Telegram.
* [Send2Kindlebot](http://t.me/Send2KindleBot) ([source](https://github.com/GabrielRF/Send2KindleBot)) by *GabrielRF* - Send to Kindle service.
* [RastreioBot](http://t.me/RastreioBot) ([source](https://github.com/GabrielRF/RastreioBot)) by *GabrielRF* - Bot used to track packages on the Brazilian Mail Service.
* [Spbu4UBot](http://t.me/Spbu4UBot)([link](https://github.com/EeOneDown/spbu4u)) by *EeOneDown* - Bot with timetables for SPbU students.
* [SmartySBot](http://t.me/ZDU_bot)([link](https://github.com/0xVK/SmartySBot)) by *0xVK* - Telegram timetable bot, for Zhytomyr Ivan Franko State University students.
* [LearnIt](https://t.me/LearnItbot)([link](https://github.com/tiagonapoli/LearnIt)) - A Telegram Bot created to help people to memorize other languages vocabulary.
* [Bot-Telegram-Shodan ](https://github.com/rubenleon/Bot-Telegram-Shodan) by [rubenleon](https://github.com/rubenleon)
* [VigoBusTelegramBot](https://t.me/vigobusbot) ([GitHub](https://github.com/Pythoneiro/VigoBus-TelegramBot)) - Bot that provides buses coming to a certain stop and their remaining time for the city of Vigo (Galicia - Spain)
* [kaishnik-bot](https://t.me/kaishnik_bot) ([source](https://github.com/airatk/kaishnik-bot)) by *airatk* - bot which shows all the necessary information to KNTRU-KAI students.
* [Robbie](https://t.me/romdeliverybot) ([source](https://github.com/FacuM/romdeliverybot_support)) by @FacuM - Support Telegram bot for developers and maintainers.
* [AsadovBot](https://t.me/asadov_bot) ([source](https://github.com/desexcile/BotApi)) by @DesExcile - Сatalog of poems by Eduard Asadov.
* [thesaurus_com_bot](https://t.me/thesaurus_com_bot) ([source](https://github.com/LeoSvalov/words-i-learn-bot)) by @LeoSvalov - words and synonyms from [dictionary.com](https://www.dictionary.com) and [thesaurus.com](https://www.thesaurus.com) in the telegram.
* [InfoBot](https://t.me/info2019_bot) ([source](https://github.com/irevenko/info-bot)) by @irevenko - An all-round bot that displays some statistics (weather, time, crypto etc...)
* [FoodBot](https://t.me/ChensonUz_bot) ([source](https://github.com/Fliego/old_restaurant_telegram_chatbot)) by @Fliego - a simple bot for food ordering
* [Sporty](https://t.me/SportydBot) ([source](https://github.com/0xnu/sporty)) by @0xnu - Telegram bot for displaying the latest news, sports schedules and injury updates.
* [JoinGroup Silencer Bot](https://t.me/joingroup_silencer_bot) ([source](https://github.com/zeph1997/Telegram-Group-Silencer-Bot)) by [@zeph1997](https://github.com/zeph1997) - A Telegram Bot to remove "join group" and "removed from group" notifications.
* [TasksListsBot](https://t.me/TasksListsBot) ([source](https://github.com/Pablo-Davila/TasksListsBot)) by [@Pablo-Davila](https://github.com/Pablo-Davila) - A (tasks) lists manager bot for Telegram.
* [MyElizaPsychologistBot](https://t.me/TasksListsBot) ([source](https://github.com/Pablo-Davila/MyElizaPsychologistBot)) by [@Pablo-Davila](https://github.com/Pablo-Davila) - An implementation of the famous Eliza psychologist chatbot.
* [Frcstbot](https://t.me/frcstbot) ([source](https://github.com/Mrsqd/frcstbot_public)) by [Mrsqd](https://github.com/Mrsqd). A Telegram bot that will always be happy to show you the weather forecast.
* [MineGramBot](https://github.com/ModischFabrications/MineGramBot) by [ModischFabrications](https://github.com/ModischFabrications). This bot can start, stop and monitor a minecraft server.
* [Tabletop DiceBot](https://github.com/dexpiper/tabletopdicebot) by [dexpiper](https://github.com/dexpiper). This bot can roll multiple dices for RPG-like games, add positive and negative modifiers and show short descriptions to the rolls.
* [BarnameKon](https://t.me/BarnameKonBot) by [Anvaari](https://github.com/anvaari). This Bot make "Add to google calendar" link for your events. It give information about event and return link. It work for Jalali calendar and in Tehran Time. [Source code](https://github.com/anvaari/BarnameKon)
* [Translator bot](https://github.com/AREEG94FAHAD/translate_text_bot) by Areeg Fahad. This bot can be used to translate texts.
* [Digital Cryptocurrency bot](https://github.com/AREEG94FAHAD/currencies_bot) by Areeg Fahad. With this bot, you can now monitor the prices of more than 12 digital Cryptocurrency.
* [Anti-Tracking Bot](https://t.me/AntiTrackingBot) by Leon Heess [(source)](https://github.com/leonheess/AntiTrackingBot). Send any link, and the bot tries its best to remove all tracking from the link you sent.
* [Developer Bot](https://t.me/IndDeveloper_bot) by [Vishal Singh](https://github.com/vishal2376) [(source code)](https://github.com/vishal2376/telegram-bot) This telegram bot can do tasks like GitHub search & clone,provide c++ learning resources ,Stackoverflow search, Codeforces(profile visualizer,random problems)
* [oneIPO bot](https://github.com/aaditya2200/IPO-proj) by [Aadithya](https://github.com/aaditya2200) & [Amol Soans](https://github.com/AmolDerickSoans) This Telegram bot provides live updates , data and documents on current and upcoming IPOs(Initial Public Offerings)
* [CoronaGraphsBot](https://t.me/CovidGraph_bot) ([source](https://github.com/TrevorWinstral/CoronaGraphsBot)) by *TrevorWinstral* - Gets live COVID Country data, plots it, and briefs the user
* [ETHLectureBot](https://t.me/ETHLectureBot) ([source](https://github.com/TrevorWinstral/ETHLectureBot)) by *TrevorWinstral* - Notifies ETH students when their lectures have been uploaded
* [Vlun Finder Bot](https://github.com/resinprotein2333/Vlun-Finder-bot) by [Resinprotein2333](https://github.com/resinprotein2333). This bot can help you to find The information of CVE vulnerabilities.
* [ETHGasFeeTrackerBot](https://t.me/ETHGasFeeTrackerBot) ([Source](https://github.com/DevAdvik/ETHGasFeeTrackerBot]) by *DevAdvik* - Get Live Ethereum Gas Fees in GWEI
* [Google Sheet Bot](https://github.com/JoachimStanislaus/Tele_Sheet_bot) by [JoachimStanislaus](https://github.com/JoachimStanislaus). This bot can help you to track your expenses by uploading your bot entries to your google sheet.
* [GrandQuiz Bot](https://github.com/Carlosma7/TFM-GrandQuiz) by [Carlosma7](https://github.com/Carlosma7). This bot is a trivia game that allows you to play with people from different ages. This project addresses the use of a system through chatbots to carry out a social and intergenerational game as an alternative to traditional game development.
* [Diccionario de la RAE](https://t.me/dleraebot) ([source](https://github.com/studentenherz/dleraebot)) This bot lets you find difinitions of words in Spanish using [RAE's dictionary](https://dle.rae.es/). It features direct message and inline search.
* [remoteTelegramShell](https://github.com/EnriqueMoran/remoteTelegramShell) by [EnriqueMoran](https://github.com/EnriqueMoran). Control your LinuxOS computer through Telegram.
* [Commerce Telegram Bot](https://github.com/ayitinya/commerce-telegram-bot/). Make purchases of items in a store with an Admin panel for data control and notifications.
* [Pyfram-telegram-bot](https://github.com/skelly37/pyfram-telegram-bot) Query wolframalpha.com and make use of its API through Telegram.
* [TranslateThisVideoBot](https://gitlab.com/WuerfelDev/translatethisvideo) This Bot can understand spoken text in videos and translate it to English
* [Zyprexa](https://t.me/mathemathicsBot) ([source](https://github.com/atif5/zyprexa)) Zyprexa can solve, help you solve any mathematical problem you encounter and convert your regular mathematical expressions into beautiful imagery using LaTeX.
* [Bincode-telegram-bot](https://github.com/tusharhero/bincode-telegram-bot) by [tusharhero](https://github.com/tusharhero) - Makes [bincodes](https://github.com/tusharhero/bincode) from text provides and also converts them back to text.
* [hydrolib_bot](https://github.com/Mayson90/hydrolib_bot) Toolset for Hydrophilia tabletop game (game cards, rules, structure...).
* [Gugumoe-bot](http://t.me/gugumoe_bot) ([source](https://github.com/GooGuJiang/Gugumoe-bot)) by [咕谷酱](https://gmoe.cc) GuXiaoJiang is a multi-functional robot, such as OSU game information query, IP test, animation screenshot search and other functions.
* [Feedback-bot](https://github.com/coder2020official/feedbackbot) A feedback bot for user-admin communication. Made on AsyncTeleBot, using [template](https://github.com/coder2020official/asynctelebot_template).
* [TeleServ](https://github.com/ablakely/TeleServ) by [ablakely](https://github.com/ablakely) This is a Telegram to IRC bridge which links as an IRC server and makes Telegram users appear as native IRC users.
* [Simple Store Bot](https://github.com/AntonGlyzin/myshopbot) by [Anton Glyzin](https://github.com/AntonGlyzin) This is a simple telegram-store with an admin panel. Designed according to a template.
* [Media Rating Bot](https://t.me/mediaratingbot) ([source](https://github.com/CommanderCRM/MediaRatingBot))by [CommanderCRM](https://github.com/CommanderCRM). This bot aggregates media (movies, TV series, etc.) ratings from IMDb, Rotten Tomatoes, Metacritic, TheMovieDB, FilmAffinity and also provides number of votes of said media on IMDb.
* [Spot Seek Bot](https://t.me/SpotSeekBot) ([source](https://github.com/arashnm80/spot-seek-bot)) by [Arashnm80](https://github.com/arashnm80). This is a free & open source telegram bot for downloading tracks, albums or playlists from spotify.
* [CalendarIT Bot](https://t.me/calendarit_bot) ([source](https://github.com/codebyzen/CalendarIT_Telegram_Bot))by [CodeByZen](https://github.com/codebyzen). A simple, but extensible Python Telegram bot, can post acquainted with what is happening today, tomorrow or what happened 20 years ago to channel.
* [DownloadMusicBOT](https://github.com/fcoagz/DownloadMusicBOT) by *Francisco Griman* - It is a simple bot that downloads audio from YouTube videos on Telegram.
* [AwesomeChatGPTBot](https://github.com/Kourva/AwesomeChatGPTBot) - Simple ChatGTP-3.5 bot. It is FREE and can remember chat history for a while With pre-defined roles!
Want to have your bot listed here? Send a Telegram message to @eternnoir or @pevdh.
**Want to have your bot listed here? Just make a pull request. Only bots with public source code are accepted.**

View File

@ -1,807 +0,0 @@
#
.. raw:: html
<p align="center">
pyTelegramBotAPI
.. raw:: html
<p align="center">
A simple, but extensible Python implementation for the `Telegram Bot
API <https://core.telegram.org/bots/api>`__.
|Download Month| |Build Status| |Download Month|
- `Getting started. <#getting-started>`__
- `Writing your first bot <#writing-your-first-bot>`__
- `Prerequisites <#prerequisites>`__
- `A simple echo bot <#a-simple-echo-bot>`__
- `General API Documentation <#general-api-documentation>`__
- `Types <#types>`__
- `Methods <#methods>`__
- `General use of the API <#general-use-of-the-api>`__
- `Message handlers <#message-handlers>`__
- `Callback Query handlers <#callback-query-handler>`__
- `TeleBot <#telebot>`__
- `Reply markup <#reply-markup>`__
- `Inline Mode <#inline-mode>`__
- `Advanced use of the API <#advanced-use-of-the-api>`__
- `Asynchronous delivery of
messages <#asynchronous-delivery-of-messages>`__
- `Sending large text messages <#sending-large-text-messages>`__
- `Controlling the amount of Threads used by
TeleBot <#controlling-the-amount-of-threads-used-by-telebot>`__
- `The listener mechanism <#the-listener-mechanism>`__
- `Using web hooks <#using-web-hooks>`__
- `Logging <#logging>`__
- `F.A.Q. <#faq>`__
- `Bot 2.0 <#bot-20>`__
- `How can I distinguish a User and a GroupChat in
message.chat? <#how-can-i-distinguish-a-user-and-a-groupchat-in-messagechat>`__
- `The Telegram Chat Group <#the-telegram-chat-group>`__
- `More examples <#more-examples>`__
- `Bots using this API <#bots-using-this-api>`__
Getting started.
----------------
This API is tested with Python 2.6, Python 2.7, Python 3.4, Pypy and
Pypy 3. There are two ways to install the library:
- Installation using pip (a Python package manager)\*:
::
$ pip install pyTelegramBotAPI
- Installation from source (requires git):
::
$ git clone https://github.com/eternnoir/pyTelegramBotAPI.git
$ cd pyTelegramBotAPI
$ python setup.py install
It is generally recommended to use the first option.
\*\*While the API is production-ready, it is still under development and
it has regular updates, do not forget to update it regularly by calling
``pip install pytelegrambotapi --upgrade``\ \*
Writing your first bot
----------------------
Prerequisites
~~~~~~~~~~~~~
It is presumed that you [have obtained an API token with
@BotFather](https://core.telegram.org/bots#botfather). We will call this
token ``TOKEN``. Furthermore, you have basic knowledge of the Python
programming language and more importantly `the Telegram Bot
API <https://core.telegram.org/bots/api>`__.
A simple echo bot
~~~~~~~~~~~~~~~~~
The TeleBot class (defined in \_\_init\_\_.py) encapsulates all API
calls in a single class. It provides functions such as ``send_xyz``
(``send_message``, ``send_document`` etc.) and several ways to listen
for incoming messages.
Create a file called ``echo_bot.py``. Then, open the file and create an
instance of the TeleBot class.
.. code:: python
import telebot
bot = telebot.TeleBot("TOKEN")
*Note: Make sure to actually replace TOKEN with your own API token.*
After that declaration, we need to register some so-called message
handlers. Message handlers define filters which a message must pass. If
a message passes the filter, the decorated function is called and the
incoming message is passed as an argument.
Let's define a message handler which handles incoming ``/start`` and
``/help`` commands.
.. code:: python
@bot.message_handler(commands=['start', 'help'])
def send_welcome(message):
bot.reply_to(message, "Howdy, how are you doing?")
A function which is decorated by a message handler **can have an
arbitrary name, however, it must have only one parameter (the
message)**.
Let's add another handler:
.. code:: python
@bot.message_handler(func=lambda m: True)
def echo_all(message):
bot.reply_to(message, message.text)
This one echoes all incoming text messages back to the sender. It uses a
lambda function to test a message. If the lambda returns True, the
message is handled by the decorated function. Since we want all messages
to be handled by this function, we simply always return True.
*Note: all handlers are tested in the order in which they were declared*
We now have a basic bot which replies a static message to "/start" and
"/help" commands and which echoes the rest of the sent messages. To
start the bot, add the following to our source file:
.. code:: python
bot.polling()
Alright, that's it! Our source file now looks like this:
.. code:: python
import telebot
bot = telebot.TeleBot("TOKEN")
@bot.message_handler(commands=['start', 'help'])
def send_welcome(message):
bot.reply_to(message, "Howdy, how are you doing?")
@bot.message_handler(func=lambda message: True)
def echo_all(message):
bot.reply_to(message, message.text)
bot.polling()
To start the bot, simply open up a terminal and enter
``python echo_bot.py`` to run the bot! Test it by sending commands
('/start' and '/help') and arbitrary text messages.
General API Documentation
-------------------------
Types
~~~~~
All types are defined in types.py. They are all completely in line with
the `Telegram API's definition of the
types <https://core.telegram.org/bots/api#available-types>`__, except
for the Message's ``from`` field, which is renamed to ``from_user``
(because ``from`` is a Python reserved token). Thus, attributes such as
``message_id`` can be accessed directly with ``message.message_id``.
Note that ``message.chat`` can be either an instance of ``User`` or
``GroupChat`` (see `How can I distinguish a User and a GroupChat in
message.chat? <#how-can-i-distinguish-a-user-and-a-groupchat-in-messagechat>`__).
The Message object also has a ``content_types``\ attribute, which
defines the type of the Message. ``content_types`` can be one of the
following strings: 'text', 'audio', 'document', 'photo', 'sticker',
'video', 'voice', 'location', 'contact', 'new\_chat\_participant',
'left\_chat\_participant', 'new\_chat\_title', 'new\_chat\_photo',
'delete\_chat\_photo', 'group\_chat\_created'.
Methods
~~~~~~~
All `API
methods <https://core.telegram.org/bots/api#available-methods>`__ are
located in the TeleBot class. They are renamed to follow common Python
naming conventions. E.g. ``getMe`` is renamed to ``get_me`` and
``sendMessage`` to ``send_message``.
General use of the API
~~~~~~~~~~~~~~~~~~~~~~
Outlined below are some general use cases of the API.
Message handlers
^^^^^^^^^^^^^^^^
A message handler is a function that is decorated with the
``message_handler`` decorator of a TeleBot instance. Message handlers
consist of one or multiple filters. Each filter much return True for a
certain message in order for a message handler to become eligible to
handle that message. A message handler is declared in the following way
(provided ``bot`` is an instance of TeleBot):
.. code:: python
@bot.message_handler(filters)
def function_name(message):
bot.reply_to(message, "This is a message handler")
``function_name`` is not bound to any restrictions. Any function name is
permitted with message handlers. The function must accept at most one
argument, which will be the message that the function must handle.
``filters`` is a list of keyword arguments. A filter is declared in the
following manner: ``name=argument``. One handler may have multiple
filters. TeleBot supports the following filters:
+--------+------+------+
| name | argu | Cond |
| | ment | itio |
| | (s) | n |
+========+======+======+
| conten | list | ``Tr |
| t\_typ | of | ue`` |
| es | stri | if |
| | ngs | mess |
| | (def | age. |
| | ault | cont |
| | ``[' | ent\ |
| | text | _typ |
| | ']`` | e |
| | ) | is |
| | | in |
| | | the |
| | | list |
| | | of |
| | | stri |
| | | ngs. |
+--------+------+------+
| regexp | a | ``Tr |
| | regu | ue`` |
| | lar | if |
| | expr | ``re |
| | essi | .sea |
| | on | rch( |
| | as a | rege |
| | stri | xp_a |
| | ng | rg)` |
| | | ` |
| | | retu |
| | | rns |
| | | ``Tr |
| | | ue`` |
| | | and |
| | | ``me |
| | | ssag |
| | | e.co |
| | | nten |
| | | t_ty |
| | | pe = |
| | | = 't |
| | | ext' |
| | | `` |
| | | (See |
| | | `Pyt |
| | | hon |
| | | Regu |
| | | lar |
| | | Expr |
| | | essi |
| | | ons |
| | | <htt |
| | | ps:/ |
| | | /doc |
| | | s.py |
| | | thon |
| | | .org |
| | | /2/l |
| | | ibra |
| | | ry/r |
| | | e.ht |
| | | ml>` |
| | | __ |
+--------+------+------+
| comman | list | ``Tr |
| ds | of | ue`` |
| | stri | if |
| | ngs | ``me |
| | | ssag |
| | | e.co |
| | | nten |
| | | t_ty |
| | | pe = |
| | | = 't |
| | | ext' |
| | | `` |
| | | and |
| | | ``me |
| | | ssag |
| | | e.te |
| | | xt`` |
| | | star |
| | | ts |
| | | with |
| | | a |
| | | comm |
| | | and |
| | | that |
| | | is |
| | | in |
| | | the |
| | | list |
| | | of |
| | | stri |
| | | ngs. |
+--------+------+------+
| func | a | ``Tr |
| | func | ue`` |
| | tion | if |
| | (lam | the |
| | bda | lamb |
| | or | da |
| | func | or |
| | tion | func |
| | refe | tion |
| | renc | refe |
| | e) | renc |
| | | e |
| | | retu |
| | | rns |
| | | ``Tr |
| | | ue`` |
+--------+------+------+
Here are some examples of using the filters and message handlers:
.. code:: python
import telebot
bot = telebot.TeleBot("TOKEN")
# Handles all text messages that contains the commands '/start' or '/help'.
@bot.message_handler(commands=['start', 'help'])
def handle_start_help(message):
pass
# Handles all sent documents and audio files
@bot.message_handler(content_types=['document', 'audio'])
def handle_docs_audio(message):
pass
# Handles all text messages that match the regular expression
@bot.message_handler(regexp="SOME_REGEXP")
def handle_message(message):
pass
#Handles all messages for which the lambda returns True
@bot.message_handler(func=lambda message: message.document.mime_type == 'text/plain', content_types=['document'])
def handle_text_doc(message):
pass
#Which could also be defined as:
def test_message(message):
return message.document.mime_type == 'text/plan'
@bot.message_handler(func=test_message, content_types=['document'])
def handle_text_doc(message)
pass
# Handlers can be stacked to create a function which will be called if either message_handler is eligible
# This handler will be called if the message starts with '/hello' OR is some emoji
@bot.message_handler(commands=['hello'])
@bot.message_handler(func=lambda msg: msg.text.encode("utf-8") == SOME_FANCY_EMOJI)
def send_something(message):
pass
**Important: all handlers are tested in the order in which they were
declared**
Callback Query Handler
^^^^^^^^^^^^^^^^^^^^^^
In bot2.0 update. You can get ``callback_query`` in update object. In
telebot use ``callback_query_handler`` to process callback\_querys.
.. code:: python
@bot.callback_query_handler(func=lambda call: True)
def test_callback(call):
logger.info(call)
TeleBot
^^^^^^^
.. code:: python
import telebot
TOKEN = '<token_string>'
tb = telebot.TeleBot(TOKEN) #create a new Telegram Bot object
# Upon calling this function, TeleBot starts polling the Telegram servers for new messages.
# - none_stop: True/False (default False) - Don't stop polling when receiving an error from the Telegram servers
# - interval: True/False (default False) - The interval between polling requests
# Note: Editing this parameter harms the bot's response time
# - block: True/False (default True) - Blocks upon calling this function
tb.polling(none_stop=False, interval=0, block=True)
# getMe
user = tb.get_me()
# setWebhook
tb.set_webhook(url="http://example.com", certificate=open('mycert.pem'))
# unset webhook
tb.remove_webhook()
# getUpdates
updates = tb.get_updates()
updates = tb.get_updates(1234,100,20) #get_Updates(offset, limit, timeout):
# sendMessage
tb.send_message(chatid, text)
# forwardMessage
tb.forward_message(to_chat_id, from_chat_id, message_id)
# All send_xyz functions which can take a file as an argument, can also take a file_id instead of a file.
# sendPhoto
photo = open('/tmp/photo.png', 'rb')
tb.send_photo(chat_id, photo)
tb.send_photo(chat_id, "FILEID")
# sendAudio
audio = open('/tmp/audio.mp3', 'rb')
tb.send_audio(chat_id, audio)
tb.send_audio(chat_id, "FILEID")
## sendAudio with duration, performer and title.
tb.send_audio(CHAT_ID, file_data, 1, 'eternnoir', 'pyTelegram')
# sendVoice
voice = open('/tmp/voice.ogg', 'rb')
tb.send_voice(chat_id, voice)
tb.send_voice(chat_id, "FILEID")
# sendDocument
doc = open('/tmp/file.txt', 'rb')
tb.send_document(chat_id, doc)
tb.send_document(chat_id, "FILEID")
# sendSticker
sti = open('/tmp/sti.webp', 'rb')
tb.send_sticker(chat_id, sti)
tb.send_sticker(chat_id, "FILEID")
# sendVideo
video = open('/tmp/video.mp4', 'rb')
tb.send_video(chat_id, video)
tb.send_video(chat_id, "FILEID")
# sendLocation
tb.send_location(chat_id, lat, lon)
# sendChatAction
# action_string can be one of the following strings: 'typing', 'upload_photo', 'record_video', 'upload_video',
# 'record_audio', 'upload_audio', 'upload_document' or 'find_location'.
tb.send_chat_action(chat_id, action_string)
# getFile
# Downloading a file is straightforward
# Returns a File object
import requests
file_info = tb.get_file(file_id)
file = requests.get('https://api.telegram.org/file/bot{0}/{1}'.format(API_TOKEN, file_info.file_path))
Reply markup
^^^^^^^^^^^^
All ``send_xyz`` functions of TeleBot take an optional ``reply_markup``
argument. This argument must be an instance of ``ReplyKeyboardMarkup``,
``ReplyKeyboardRemove`` or ``ForceReply``, which are defined in types.py.
.. code:: python
from telebot import types
# Using the ReplyKeyboardMarkup class
# It's constructor can take the following optional arguments:
# - resize_keyboard: True/False (default False)
# - one_time_keyboard: True/False (default False)
# - selective: True/False (default False)
# - row_width: integer (default 3)
# row_width is used in combination with the add() function.
# It defines how many buttons are fit on each row before continuing on the next row.
markup = types.ReplyKeyboardMarkup(row_width=2)
itembtn1 = types.KeyboardButton('a')
itembtn2 = types.KeyboardButton('v')
itembtn3 = types.KeyboardButton('d')
markup.add(itembtn1, itembtn2, itembtn3)
tb.send_message(chat_id, "Choose one letter:", reply_markup=markup)
# or add strings one row at a time:
markup = types.ReplyKeyboardMarkup()
itembtna = types.KeyboardButton('a')
itembtnv = types.KeyboardButton('v')
itembtnc = types.KeyboardButton('c')
itembtnd = types.KeyboardButton('d')
itembtne = types.KeyboardButton('e')
markup.row(itembtna, itembtnv)
markup.row(itembtnc, itembtnd, itembtne)
tb.send_message(chat_id, "Choose one letter:", reply_markup=markup)
The last example yields this result:
.. figure:: https://pp.vk.me/c624430/v624430512/473e5/_mxxW7FPe4U.jpg
:alt: ReplyKeyboardMarkup
ReplyKeyboardMarkup
.. code:: python
# ReplyKeyboardRemove: hides a previously sent ReplyKeyboardMarkup
# Takes an optional selective argument (True/False, default False)
markup = types.ReplyKeyboardRemove(selective=False)
tb.send_message(chat_id, message, reply_markup=markup)
.. code:: python
# ForceReply: forces a user to reply to a message
# Takes an optional selective argument (True/False, default False)
markup = types.ForceReply(selective=False)
tb.send_message(chat_id, "Send me another word:", reply_markup=markup)
ForceReply:
.. figure:: https://pp.vk.me/c624430/v624430512/473ec/602byyWUHcs.jpg
:alt: ForceReply
ForceReply
Inline Mode
~~~~~~~~~~~
More information about `Inline
mode <https://core.telegram.org/bots/inline>`__.
inline\_handler
^^^^^^^^^^^^^^^
Now, you can use inline\_handler to get inline\_query in telebot.
.. code:: python
@bot.inline_handler(lambda query: query.query == 'text')
def query_text(inline_query):
# Query message is text
chosen\_inline\_handler
^^^^^^^^^^^^^^^^^^^^^^^
Use chosen\_inline\_handler to get chosen\_inline\_result in telebot.
Don't forgot add the /setinlinefeedback command for @Botfather.
More information :
`collecting-feedback <https://core.telegram.org/bots/inline#collecting-feedback>`__
.. code:: python
@bot.chosen_inline_handler(func=lambda chosen_inline_result: True)
def test_chosen(chosen_inline_result):
# Process all chosen_inline_result.
answer\_inline\_query
^^^^^^^^^^^^^^^^^^^^^
.. code:: python
@bot.inline_handler(lambda query: query.query == 'text')
def query_text(inline_query):
try:
r = types.InlineQueryResultArticle('1', 'Result', 'Result message.')
r2 = types.InlineQueryResultArticle('2', 'Result2', 'Result message2.')
bot.answer_inline_query(inline_query.id, [r, r2])
except Exception as e:
print(e)
Advanced use of the API
-----------------------
Asynchronous delivery of messages
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There exists an implementation of TeleBot which executes all
``send_xyz`` and the ``get_me`` functions asynchronously. This can speed
up you bot **significantly**, but it has unwanted side effects if used
without caution. To enable this behaviour, create an instance of
AsyncTeleBot instead of TeleBot.
.. code:: python
tb = telebot.AsyncTeleBot("TOKEN")
Now, every function that calls the Telegram API is executed in a
separate Thread. The functions are modified to return an AsyncTask
instance (defined in util.py). Using AsyncTeleBot allows you to do the
following:
.. code:: python
import telebot
tb = telebot.AsyncTeleBot("TOKEN")
task = tb.get_me() # Execute an API call
# Do some other operations...
a = 0
for a in range(100):
a += 10
result = task.wait() # Get the result of the execution
*Note: if you execute send\_xyz functions after eachother without
calling wait(), the order in which messages are delivered might be
wrong.*
Sending large text messages
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sometimes you must send messages that exceed 5000 characters. The
Telegram API can not handle that many characters in one request, so we
need to split the message in multiples. Here is how to do that using the
API:
.. code:: python
from telebot import util
large_text = open("large_text.txt", "rb").read()
# Split the text each 3000 characters.
# split_string returns a list with the splitted text.
splitted_text = util.split_string(large_text, 3000)
for text in splitted_text:
tb.send_message(chat_id, text)
Controlling the amount of Threads used by TeleBot
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The TeleBot constructor takes the following optional arguments:
- create\_threads: True/False (default True). A flag to indicate
whether TeleBot should execute message handlers on it's polling
Thread.
- num\_threads: integer (default 4). Controls the amount of
WorkerThreads created for the internal thread pool that TeleBot uses
to execute message handlers. Is not used when create\_threads is
False.
The listener mechanism
~~~~~~~~~~~~~~~~~~~~~~
As an alternative to the message handlers, one can also register a
function as a listener to TeleBot. Example:
.. code:: python
def handle_messages(messages):
for message in messsages:
# Do something with the message
bot.reply_to(message, 'Hi')
bot.set_update_listener(handle_messages)
bot.polling()
Using webhooks
~~~~~~~~~~~~~~
When using webhooks telegram sends one Update per call, for processing
it you should call process\_new\_messages([update.message]) when you
recieve it.
There are some examples using webhooks in the
*examples/webhook\_examples* directory.
Logging
~~~~~~~
You can use the Telebot module logger to log debug info about Telebot.
Use ``telebot.logger`` to get the logger of the TeleBot module. It is
possible to add custom logging Handlers to the logger. Refer to the
`Python logging module
page <https://docs.python.org/2/library/logging.html>`__ for more info.
.. code:: python
import logging
logger = telebot.logger
telebot.logger.setLevel(logging.DEBUG) # Outputs debug messages to console.
F.A.Q.
------
Bot 2.0
~~~~~~~
April 9,2016 Telegram release new bot 2.0 API, which has a drastic
revision especially for the change of method's interface.If you want to
update to the latest version, please make sure you've switched bot's
code to bot 2.0 method interface.
`More information about pyTelegramBotAPI support
bot2.0 <https://github.com/eternnoir/pyTelegramBotAPI/issues/130>`__
How can I distinguish a User and a GroupChat in message.chat?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Telegram Bot API support new type Chat for message.chat.
- Check the ``type`` attribute in ``Chat`` object:
- \`\`\`python if message.chat.type == “private”: # private chat
message
if message.chat.type == “group”: # group chat message
if message.chat.type == “supergroup”: # supergroup chat message
if message.chat.type == “channel”: # channel message
\`\`\`
The Telegram Chat Group
-----------------------
Get help. Discuss. Chat.
- Join the pyTelegramBotAPI Telegram Chat Group
- Messge to @eternnoir by telegram for Invitation.
- We now have a Telegram Channel as well! Keep yourself up to date with
API changes, and `join it <https://telegram.me/pytelegrambotapi>`__.
More examples
-------------
- `Echo
Bot <https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/echo_bot.py>`__
- `Deep
Linking <https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/deep_linking.py>`__
- `next\_step\_handler
Example <https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/step_example.py>`__
Bots using this API
-------------------
- `SiteAlert bot <https://telegram.me/SiteAlert_bot>`__
(`source <https://github.com/ilteoood/SiteAlert-Python>`__) by
*ilteoood* - Monitors websites and sends a notification on changes
- `TelegramLoggingBot <https://github.com/aRandomStranger/TelegramLoggingBot>`__
by *aRandomStranger*
- `Telegram
LMGTFY\_bot <https://github.com/GabrielRF/telegram-lmgtfy_bot>`__ by
*GabrielRF*
- `Telegram
UrlProBot <https://github.com/GabrielRF/telegram-urlprobot>`__ by
*GabrielRF*
- `Telegram Proxy
Bot <https://bitbucket.org/master_groosha/telegram-proxy-bot>`__ by
*Groosha* - A simple BITM (bot-in-the-middle) for Telegram acting as
some kind of "proxy".
- `Telegram Proxy Bot <https://github.com/mrgigabyte/proxybot>`__ by
*mrgigabyte* -
``Credits for the original version of this bot goes to`` **Groosha**
``, simply added certain features which I thought were needed``.
- `RadRetroRobot <https://github.com/Tronikart/RadRetroRobot>`__ by
*Tronikart* - Multifunctional Telegram Bot RadRetroRobot.
- `League of Legends bot <https://telegram.me/League_of_Legends_bot>`__
(`source <https://github.com/i32ropie/lol>`__) by *i32ropie*
- `NeoBot <https://github.com/neoranger/NeoBot>`__ by *neoranger*
- `TagAlertBot <https://github.com/pitasi/TagAlertBot>`__ by *pitasi*
Want to have your bot listed here? Send a Telegram message to @eternnoir
or @pevdh.
.. |Download Month| image:: https://img.shields.io/pypi/v/pyTelegramBotAPI.svg
:target: https://pypi.python.org/pypi/pyTelegramBotAPI
.. |Build Status| image:: https://travis-ci.org/eternnoir/pyTelegramBotAPI.svg?branch=master
:target: https://travis-ci.org/eternnoir/pyTelegramBotAPI
.. |Download Month| image:: https://img.shields.io/pypi/dm/pyTelegramBotAPI.svg
:target: https://pypi.python.org/pypi/pyTelegramBotAPI

5
doc_req.txt Normal file
View File

@ -0,0 +1,5 @@
-r requirements.txt
furo
sphinx_copybutton
git+https://github.com/eternnoir/pyTelegramBotAPI.git

20
docs/Makefile Normal file
View File

@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -0,0 +1,48 @@
====================
AsyncTeleBot
====================
.. meta::
:description: Asynchronous pyTelegramBotAPI
:keywords: ptba, pytba, pyTelegramBotAPI, asynctelebot, documentation
AsyncTeleBot methods
--------------------
.. automodule:: telebot.async_telebot
:members:
:undoc-members:
:show-inheritance:
Asyncio filters
---------------
.. automodule:: telebot.asyncio_filters
:members:
:undoc-members:
:show-inheritance:
Asyncio handler backends
------------------------
.. automodule:: telebot.asyncio_handler_backends
:members:
:undoc-members:
:show-inheritance:
Extensions
------------------------
.. automodule:: telebot.ext.aio.webhooks
:members:
:undoc-members:
:show-inheritance:

17
docs/source/calldata.rst Normal file
View File

@ -0,0 +1,17 @@
=====================
Callback data factory
=====================
.. meta::
:description: Callback data factory in pyTelegramBotAPI
:keywords: ptba, pytba, pyTelegramBotAPI, callbackdatafactory, guide, callbackdata, factory
callback\_data file
-----------------------------
.. automodule:: telebot.callback_data
:members:
:undoc-members:
:show-inheritance:

72
docs/source/conf.py Normal file
View File

@ -0,0 +1,72 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
project = 'pyTelegramBotAPI Documentation'
copyright = '2022-2023, coder2020official'
author = 'coder2020official'
# The full version, including alpha/beta/rc tags
release = '4.12.0'
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autosectionlabel',
'sphinx.ext.autodoc',
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinx_copybutton",
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'furo'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
#html_logo = 'logo.png'
html_theme_options = {
"light_css_variables": {
"color-brand-primary": "#7C4DFF",
"color-brand-content": "#7C4DFF",
},
"light_logo": "logo.png",
"dark_logo": "logo2.png",
}
locale_dirs = ["locales/"]

View File

@ -0,0 +1,12 @@
==================
Formatting options
==================
.. meta::
:description: Formatting options in pyTelegramBotAPI
:keywords: html, markdown, parse_mode, formatting, ptba, pytba, pyTelegramBotAPI
.. automodule:: telebot.formatting
:members:
:undoc-members:
:show-inheritance:

69
docs/source/index.rst Normal file
View File

@ -0,0 +1,69 @@
.. pyTelegramBotAPI documentation master file, created by
sphinx-quickstart on Fri Feb 18 20:58:37 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to pyTelegramBotAPI's documentation!
============================================
.. meta::
:description: Official documentation of pyTelegramBotAPI
:keywords: ptba, pytba, pyTelegramBotAPI, documentation, guide
=======
TeleBot
=======
TeleBot is synchronous and asynchronous implementation of `Telegram Bot API <https://core.telegram.org/bots/api>`_.
Chats
-----
English chat: `Private chat <https://telegram.me/joinchat/Bn4ixj84FIZVkwhk2jag6A>`__
Russian chat: `@pytelegrambotapi_talks_ru <https://t.me/pytelegrambotapi_talks_ru>`__
News: `@pyTelegramBotAPI <https://t.me/pytelegrambotapi>`__
Pypi: `Pypi <https://pypi.org/project/pyTelegramBotAPI/>`__
Source: `Github repository <https://github.com/eternnoir/pyTelegramBotAPI>`__
Some features:
--------------
Easy to learn and use.
Easy to understand.
Both sync and async.
Examples on features.
States
And more...
Content
--------
.. toctree::
install
quick_start
types
sync_version/index
async_version/index
calldata
util
formatting
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

45
docs/source/install.rst Normal file
View File

@ -0,0 +1,45 @@
==================
Installation Guide
==================
.. meta::
:description: Installation of pyTelegramBotAPI
:keywords: ptba, pytba, pyTelegramBotAPI, installation, guide
Using PIP
----------
.. code-block:: bash
$ pip install pyTelegramBotAPI
Using pipenv
------------
.. code-block:: bash
$ pipenv install pyTelegramBotAPI
By cloning repository
---------------------
.. code-block:: bash
$ git clone https://github.com/eternnoir/pyTelegramBotAPI.git
$ cd pyTelegramBotAPI
$ python setup.py install
Directly using pip
------------------
.. code-block:: bash
$ pip install git+https://github.com/eternnoir/pyTelegramBotAPI.git
It is generally recommended to use the first option.
While the API is production-ready, it is still under development and it has regular updates, do not forget to update it regularly by calling:
.. code-block:: bash
$ pip install pytelegrambotapi --upgrade

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,127 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, coder2020official
# This file is distributed under the same license as the pyTelegramBotAPI
# Documentation package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pyTelegramBotAPI Documentation \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-29 14:44+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: ../../calldata.rst:4
msgid "Callback data factory"
msgstr ""
#: ../../calldata.rst:6
msgid "Callback data factory in pyTelegramBotAPI"
msgstr ""
#: ../../calldata.rst:6
msgid ""
"ptba, pytba, pyTelegramBotAPI, callbackdatafactory, guide, callbackdata, "
"factory"
msgstr ""
#: ../../calldata.rst:12
msgid "callback\\_data file"
msgstr ""
#: of telebot.callback_data:1
msgid "Callback data factory's file."
msgstr ""
#: of telebot.callback_data.CallbackData:1
#: telebot.callback_data.CallbackDataFilter:1
msgid "Bases: :py:class:`object`"
msgstr ""
#: of telebot.callback_data.CallbackData:1
msgid "Callback data factory This class will help you to work with CallbackQuery"
msgstr ""
#: of telebot.callback_data.CallbackData.filter:1
msgid "Generate filter"
msgstr ""
#: of telebot.callback_data.CallbackData.filter
#: telebot.callback_data.CallbackData.new
#: telebot.callback_data.CallbackData.parse
#: telebot.callback_data.CallbackDataFilter.check
msgid "Parameters"
msgstr ""
#: of telebot.callback_data.CallbackData.filter:3
msgid "specified named parameters will be checked with CallbackQuery.data"
msgstr ""
#: of telebot.callback_data.CallbackData.filter
#: telebot.callback_data.CallbackData.new
#: telebot.callback_data.CallbackData.parse
#: telebot.callback_data.CallbackDataFilter.check
msgid "Returns"
msgstr ""
#: of telebot.callback_data.CallbackData.filter:4
msgid "CallbackDataFilter class"
msgstr ""
#: of telebot.callback_data.CallbackData.new:1
msgid "Generate callback data"
msgstr ""
#: of telebot.callback_data.CallbackData.new:3
msgid "positional parameters of CallbackData instance parts"
msgstr ""
#: of telebot.callback_data.CallbackData.new:4
msgid "named parameters"
msgstr ""
#: of telebot.callback_data.CallbackData.new:5
msgid "str"
msgstr ""
#: of telebot.callback_data.CallbackData.parse:1
msgid "Parse data from the callback data"
msgstr ""
#: of telebot.callback_data.CallbackData.parse:3
msgid ""
"string, use to telebot.types.CallbackQuery to parse it from string to a "
"dict"
msgstr ""
#: of telebot.callback_data.CallbackData.parse:4
msgid "dict parsed from callback data"
msgstr ""
#: of telebot.callback_data.CallbackDataFilter:1
msgid "Filter for CallbackData."
msgstr ""
#: of telebot.callback_data.CallbackDataFilter.check:1
msgid "Checks if query.data appropriates to specified config"
msgstr ""
#: of telebot.callback_data.CallbackDataFilter.check:3
msgid "telebot.types.CallbackQuery"
msgstr ""
#: of telebot.callback_data.CallbackDataFilter.check:6
msgid "True if query.data appropriates to specified config"
msgstr ""
#: of telebot.callback_data.CallbackDataFilter.check
msgid "Return type"
msgstr ""

View File

@ -0,0 +1,251 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, coder2020official
# This file is distributed under the same license as the pyTelegramBotAPI
# Documentation package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pyTelegramBotAPI Documentation \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-29 14:44+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: ../../formatting.rst:3
msgid "Formatting options"
msgstr ""
#: ../../formatting.rst:5
msgid "Formatting options in pyTelegramBotAPI"
msgstr ""
#: ../../formatting.rst:5
msgid "html, markdown, parse_mode, formatting, ptba, pytba, pyTelegramBotAPI"
msgstr ""
#: of telebot.formatting:1
msgid "Markdown & HTML formatting functions."
msgstr ""
#: of telebot.formatting.escape_html:1
msgid "Escapes HTML characters in a string of HTML."
msgstr ""
#: of telebot.formatting.escape_html telebot.formatting.escape_markdown
#: telebot.formatting.format_text telebot.formatting.hbold
#: telebot.formatting.hcode telebot.formatting.hide_link
#: telebot.formatting.hitalic telebot.formatting.hlink telebot.formatting.hpre
#: telebot.formatting.hspoiler telebot.formatting.hstrikethrough
#: telebot.formatting.hunderline telebot.formatting.mbold
#: telebot.formatting.mcode telebot.formatting.mitalic telebot.formatting.mlink
#: telebot.formatting.mspoiler telebot.formatting.mstrikethrough
#: telebot.formatting.munderline
msgid "Parameters"
msgstr ""
#: of telebot.formatting.escape_html:3
msgid "The string of HTML to escape."
msgstr ""
#: of telebot.formatting.escape_html telebot.formatting.escape_markdown
#: telebot.formatting.format_text telebot.formatting.hbold
#: telebot.formatting.hcode telebot.formatting.hide_link
#: telebot.formatting.hitalic telebot.formatting.hlink telebot.formatting.hpre
#: telebot.formatting.hspoiler telebot.formatting.hstrikethrough
#: telebot.formatting.hunderline telebot.formatting.mbold
#: telebot.formatting.mcode telebot.formatting.mitalic telebot.formatting.mlink
#: telebot.formatting.mspoiler telebot.formatting.mstrikethrough
#: telebot.formatting.munderline
msgid "Returns"
msgstr ""
#: of telebot.formatting.escape_html:6 telebot.formatting.escape_markdown:8
msgid "The escaped string."
msgstr ""
#: of telebot.formatting.escape_html telebot.formatting.escape_markdown
#: telebot.formatting.format_text telebot.formatting.hbold
#: telebot.formatting.hcode telebot.formatting.hide_link
#: telebot.formatting.hitalic telebot.formatting.hlink telebot.formatting.hpre
#: telebot.formatting.hspoiler telebot.formatting.hstrikethrough
#: telebot.formatting.hunderline telebot.formatting.mbold
#: telebot.formatting.mcode telebot.formatting.mitalic telebot.formatting.mlink
#: telebot.formatting.mspoiler telebot.formatting.mstrikethrough
#: telebot.formatting.munderline
msgid "Return type"
msgstr ""
#: of telebot.formatting.escape_html:7 telebot.formatting.escape_markdown:9
#: telebot.formatting.format_text:17 telebot.formatting.hbold:10
#: telebot.formatting.hcode:10 telebot.formatting.hide_link:7
#: telebot.formatting.hitalic:10 telebot.formatting.hlink:13
#: telebot.formatting.hpre:10 telebot.formatting.hspoiler:10
#: telebot.formatting.hstrikethrough:10 telebot.formatting.hunderline:10
#: telebot.formatting.mbold:10 telebot.formatting.mcode:10
#: telebot.formatting.mitalic:10 telebot.formatting.mlink:13
#: telebot.formatting.mspoiler:10 telebot.formatting.mstrikethrough:10
#: telebot.formatting.munderline:10
msgid ":obj:`str`"
msgstr ""
#: of telebot.formatting.escape_markdown:1
msgid "Escapes Markdown characters in a string of Markdown."
msgstr ""
#: of telebot.formatting.escape_markdown:3
msgid "Credits to: simonsmh"
msgstr ""
#: of telebot.formatting.escape_markdown:5
msgid "The string of Markdown to escape."
msgstr ""
#: of telebot.formatting.format_text:1
msgid "Formats a list of strings into a single string."
msgstr ""
#: of telebot.formatting.format_text:10
msgid "Strings to format."
msgstr ""
#: of telebot.formatting.format_text:13
msgid "The separator to use between each string."
msgstr ""
#: of telebot.formatting.format_text:16 telebot.formatting.hbold:9
#: telebot.formatting.hcode:9 telebot.formatting.hitalic:9
#: telebot.formatting.hlink:12 telebot.formatting.hpre:9
#: telebot.formatting.hspoiler:9 telebot.formatting.hstrikethrough:9
#: telebot.formatting.hunderline:9 telebot.formatting.mbold:9
#: telebot.formatting.mcode:9 telebot.formatting.mitalic:9
#: telebot.formatting.mlink:12 telebot.formatting.mspoiler:9
#: telebot.formatting.mstrikethrough:9 telebot.formatting.munderline:9
msgid "The formatted string."
msgstr ""
#: of telebot.formatting.hbold:1
msgid "Returns an HTML-formatted bold string."
msgstr ""
#: of telebot.formatting.hbold:3 telebot.formatting.mbold:3
msgid "The string to bold."
msgstr ""
#: of telebot.formatting.hbold:6 telebot.formatting.hcode:6
#: telebot.formatting.hitalic:6 telebot.formatting.hlink:9
#: telebot.formatting.hpre:6 telebot.formatting.hspoiler:6
#: telebot.formatting.hstrikethrough:6 telebot.formatting.hunderline:6
#: telebot.formatting.mbold:6 telebot.formatting.mcode:6
#: telebot.formatting.mitalic:6 telebot.formatting.mlink:9
#: telebot.formatting.mspoiler:6 telebot.formatting.mstrikethrough:6
#: telebot.formatting.munderline:6
msgid "True if you need to escape special characters. Defaults to True."
msgstr ""
#: of telebot.formatting.hcode:1
msgid "Returns an HTML-formatted code string."
msgstr ""
#: of telebot.formatting.hcode:3 telebot.formatting.mcode:3
msgid "The string to code."
msgstr ""
#: of telebot.formatting.hide_link:1
msgid "Hide url of an image."
msgstr ""
#: of telebot.formatting.hide_link:3
msgid "The url of the image."
msgstr ""
#: of telebot.formatting.hide_link:6
msgid "The hidden url."
msgstr ""
#: of telebot.formatting.hitalic:1
msgid "Returns an HTML-formatted italic string."
msgstr ""
#: of telebot.formatting.hitalic:3 telebot.formatting.mitalic:3
msgid "The string to italicize."
msgstr ""
#: of telebot.formatting.hlink:1
msgid "Returns an HTML-formatted link string."
msgstr ""
#: of telebot.formatting.hlink:3 telebot.formatting.mlink:3
msgid "The string to link."
msgstr ""
#: of telebot.formatting.hlink:6 telebot.formatting.mlink:6
msgid "The URL to link to."
msgstr ""
#: of telebot.formatting.hpre:1
msgid "Returns an HTML-formatted preformatted string."
msgstr ""
#: of telebot.formatting.hpre:3
msgid "The string to preformatted."
msgstr ""
#: of telebot.formatting.hspoiler:1
msgid "Returns an HTML-formatted spoiler string."
msgstr ""
#: of telebot.formatting.hspoiler:3 telebot.formatting.mspoiler:3
msgid "The string to spoiler."
msgstr ""
#: of telebot.formatting.hstrikethrough:1
msgid "Returns an HTML-formatted strikethrough string."
msgstr ""
#: of telebot.formatting.hstrikethrough:3 telebot.formatting.mstrikethrough:3
msgid "The string to strikethrough."
msgstr ""
#: of telebot.formatting.hunderline:1
msgid "Returns an HTML-formatted underline string."
msgstr ""
#: of telebot.formatting.hunderline:3 telebot.formatting.munderline:3
msgid "The string to underline."
msgstr ""
#: of telebot.formatting.mbold:1
msgid "Returns a Markdown-formatted bold string."
msgstr ""
#: of telebot.formatting.mcode:1
msgid "Returns a Markdown-formatted code string."
msgstr ""
#: of telebot.formatting.mitalic:1
msgid "Returns a Markdown-formatted italic string."
msgstr ""
#: of telebot.formatting.mlink:1
msgid "Returns a Markdown-formatted link string."
msgstr ""
#: of telebot.formatting.mspoiler:1
msgid "Returns a Markdown-formatted spoiler string."
msgstr ""
#: of telebot.formatting.mstrikethrough:1
msgid "Returns a Markdown-formatted strikethrough string."
msgstr ""
#: of telebot.formatting.munderline:1
msgid "Returns a Markdown-formatted underline string."
msgstr ""

View File

@ -0,0 +1,120 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, coder2020official
# This file is distributed under the same license as the pyTelegramBotAPI
# Documentation package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pyTelegramBotAPI Documentation \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-29 14:44+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: ../../index.rst:8
msgid "Welcome to pyTelegramBotAPI's documentation!"
msgstr ""
#: ../../index.rst:10
msgid "Official documentation of pyTelegramBotAPI"
msgstr ""
#: ../../index.rst:10
msgid "ptba, pytba, pyTelegramBotAPI, documentation, guide"
msgstr ""
#: ../../index.rst:17
msgid "TeleBot"
msgstr ""
#: ../../index.rst:18
msgid ""
"TeleBot is synchronous and asynchronous implementation of `Telegram Bot "
"API <https://core.telegram.org/bots/api>`_."
msgstr ""
#: ../../index.rst:21
msgid "Chats"
msgstr ""
#: ../../index.rst:22
msgid ""
"English chat: `Private chat "
"<https://telegram.me/joinchat/Bn4ixj84FIZVkwhk2jag6A>`__"
msgstr ""
#: ../../index.rst:24
msgid ""
"Russian chat: `@pytelegrambotapi_talks_ru "
"<https://t.me/pytelegrambotapi_talks_ru>`__"
msgstr ""
#: ../../index.rst:26
msgid "News: `@pyTelegramBotAPI <https://t.me/pytelegrambotapi>`__"
msgstr ""
#: ../../index.rst:28
msgid "Pypi: `Pypi <https://pypi.org/project/pyTelegramBotAPI/>`__"
msgstr ""
#: ../../index.rst:30
msgid ""
"Source: `Github repository "
"<https://github.com/eternnoir/pyTelegramBotAPI>`__"
msgstr ""
#: ../../index.rst:33
msgid "Some features:"
msgstr ""
#: ../../index.rst:34
msgid "Easy to learn and use."
msgstr ""
#: ../../index.rst:36
msgid "Easy to understand."
msgstr ""
#: ../../index.rst:38
msgid "Both sync and async."
msgstr ""
#: ../../index.rst:40
msgid "Examples on features."
msgstr ""
#: ../../index.rst:42
msgid "States"
msgstr ""
#: ../../index.rst:44
msgid "And more..."
msgstr ""
#: ../../index.rst:47
msgid "Content"
msgstr ""
#: ../../index.rst:63
msgid "Indices and tables"
msgstr ""
#: ../../index.rst:65
msgid ":ref:`genindex`"
msgstr ""
#: ../../index.rst:66
msgid ":ref:`modindex`"
msgstr ""
#: ../../index.rst:67
msgid ":ref:`search`"
msgstr ""

View File

@ -0,0 +1,58 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, coder2020official
# This file is distributed under the same license as the pyTelegramBotAPI
# Documentation package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pyTelegramBotAPI Documentation \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-29 14:44+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: ../../install.rst:3
msgid "Installation Guide"
msgstr ""
#: ../../install.rst:5
msgid "Installation of pyTelegramBotAPI"
msgstr ""
#: ../../install.rst:5
msgid "ptba, pytba, pyTelegramBotAPI, installation, guide"
msgstr ""
#: ../../install.rst:11
msgid "Using PIP"
msgstr ""
#: ../../install.rst:17
msgid "Using pipenv"
msgstr ""
#: ../../install.rst:23
msgid "By cloning repository"
msgstr ""
#: ../../install.rst:31
msgid "Directly using pip"
msgstr ""
#: ../../install.rst:37
msgid "It is generally recommended to use the first option."
msgstr ""
#: ../../install.rst:39
msgid ""
"While the API is production-ready, it is still under development and it "
"has regular updates, do not forget to update it regularly by calling:"
msgstr ""

View File

@ -0,0 +1,40 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, coder2020official
# This file is distributed under the same license as the pyTelegramBotAPI
# Documentation package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pyTelegramBotAPI Documentation \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-29 14:44+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: ../../quick_start.rst:4
msgid "Quick start"
msgstr ""
#: ../../quick_start.rst:6
msgid "Quickstart guide"
msgstr ""
#: ../../quick_start.rst:6
msgid "ptba, pytba, pyTelegramBotAPI, quickstart, guide"
msgstr ""
#: ../../quick_start.rst:11
msgid "Synchronous TeleBot"
msgstr ""
#: ../../quick_start.rst:16
msgid "Asynchronous TeleBot"
msgstr ""

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,355 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, coder2020official
# This file is distributed under the same license as the pyTelegramBotAPI
# Documentation package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pyTelegramBotAPI Documentation \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-08 23:07+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: ../../source/util.rst:3
msgid "Utils"
msgstr ""
#: ../../source/util.rst:5
msgid "Utils in pyTelegramBotAPI"
msgstr ""
#: ../../source/util.rst:5
msgid "ptba, pytba, pyTelegramBotAPI, utils, guide"
msgstr ""
#: ../../source/util.rst:11
msgid "util file"
msgstr ""
#: of telebot.util.antiflood:1
msgid ""
"Use this function inside loops in order to avoid getting TooManyRequests "
"error. Example:"
msgstr ""
#: of telebot.service_utils.is_bytes telebot.service_utils.is_dict
#: telebot.service_utils.is_pil_image telebot.util.antiflood
#: telebot.util.escape telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.is_command
#: telebot.util.parse_web_app_data telebot.util.quick_markup
#: telebot.util.smart_split telebot.util.split_string telebot.util.user_link
#: telebot.util.validate_web_app_data telebot.util.webhook_google_functions
msgid "Parameters"
msgstr ""
#: of telebot.util.antiflood:10
msgid "The function to call"
msgstr ""
#: of telebot.util.antiflood:13
msgid "Number of retries to send"
msgstr ""
#: of telebot.util.antiflood:16
msgid "The arguments to pass to the function"
msgstr ""
#: of telebot.util.antiflood:19
msgid "The keyword arguments to pass to the function"
msgstr ""
#: of telebot.service_utils.generate_random_token
#: telebot.service_utils.is_bytes telebot.service_utils.is_dict
#: telebot.service_utils.is_pil_image telebot.util.antiflood
#: telebot.util.escape telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.is_command
#: telebot.util.parse_web_app_data telebot.util.quick_markup
#: telebot.util.smart_split telebot.util.split_string telebot.util.user_link
#: telebot.util.validate_web_app_data telebot.util.webhook_google_functions
msgid "Returns"
msgstr ""
#: of telebot.util.antiflood:22
msgid "None"
msgstr ""
#: of telebot.service_utils.chunks:1
msgid "Yield successive n-sized chunks from lst."
msgstr ""
#: ../../docstring of telebot.util.content_type_media:1
msgid "Contains all media content types."
msgstr ""
#: ../../docstring of telebot.util.content_type_service:1
msgid "Contains all service content types such as `User joined the group`."
msgstr ""
#: of telebot.util.escape:1
msgid ""
"Replaces the following chars in `text` ('&' with '&amp;', '<' with '&lt;'"
" and '>' with '&gt;')."
msgstr ""
#: of telebot.util.escape:3
msgid "the text to escape"
msgstr ""
#: of telebot.util.escape:4
msgid "the escaped text"
msgstr ""
#: of telebot.util.extract_arguments:1
msgid "Returns the argument after the command."
msgstr ""
#: of telebot.util.extract_arguments:3 telebot.util.extract_command:4
msgid "Examples:"
msgstr ""
#: of telebot.util.extract_arguments:10
msgid "String to extract the arguments from a command"
msgstr ""
#: of telebot.util.extract_arguments:13
msgid "the arguments if `text` is a command (according to is_command), else None."
msgstr ""
#: of telebot.service_utils.generate_random_token
#: telebot.service_utils.is_bytes telebot.service_utils.is_dict
#: telebot.service_utils.is_pil_image telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.is_command
#: telebot.util.quick_markup telebot.util.smart_split telebot.util.split_string
#: telebot.util.user_link
msgid "Return type"
msgstr ""
#: of telebot.util.extract_arguments:14 telebot.util.extract_command:16
msgid ":obj:`str` or :obj:`None`"
msgstr ""
#: of telebot.util.extract_command:1
msgid ""
"Extracts the command from `text` (minus the '/') if `text` is a command "
"(see is_command). If `text` is not a command, this function returns None."
msgstr ""
#: of telebot.util.extract_command:12
msgid "String to extract the command from"
msgstr ""
#: of telebot.util.extract_command:15
msgid "the command if `text` is a command (according to is_command), else None."
msgstr ""
#: of telebot.service_utils.generate_random_token:1
msgid ""
"Generates a random token consisting of letters and digits, 16 characters "
"long."
msgstr ""
#: of telebot.service_utils.generate_random_token:3
msgid "a random token"
msgstr ""
#: of telebot.service_utils.generate_random_token:4 telebot.util.user_link:22
msgid ":obj:`str`"
msgstr ""
#: of telebot.service_utils.is_bytes:1
msgid "Returns True if the given object is a bytes object."
msgstr ""
#: of telebot.service_utils.is_bytes:3 telebot.service_utils.is_dict:3
#: telebot.service_utils.is_pil_image:3
msgid "object to be checked"
msgstr ""
#: of telebot.service_utils.is_bytes:6
msgid "True if the given object is a bytes object."
msgstr ""
#: of telebot.service_utils.is_bytes:7 telebot.service_utils.is_dict:7
#: telebot.service_utils.is_pil_image:7 telebot.util.is_command:7
msgid ":obj:`bool`"
msgstr ""
#: of telebot.util.is_command:1
msgid ""
"Checks if `text` is a command. Telegram chat commands start with the '/' "
"character."
msgstr ""
#: of telebot.util.is_command:3
msgid "Text to check."
msgstr ""
#: of telebot.util.is_command:6
msgid "True if `text` is a command, else False."
msgstr ""
#: of telebot.service_utils.is_dict:1
msgid "Returns True if the given object is a dictionary."
msgstr ""
#: of telebot.service_utils.is_dict:6
msgid "True if the given object is a dictionary."
msgstr ""
#: of telebot.service_utils.is_pil_image:1
msgid "Returns True if the given object is a PIL.Image.Image object."
msgstr ""
#: of telebot.service_utils.is_pil_image:6
msgid "True if the given object is a PIL.Image.Image object."
msgstr ""
#: of telebot.service_utils.is_string:1
msgid "Returns True if the given object is a string."
msgstr ""
#: of telebot.util.parse_web_app_data:1
msgid "Parses web app data."
msgstr ""
#: of telebot.util.parse_web_app_data:3 telebot.util.validate_web_app_data:3
msgid "The bot token"
msgstr ""
#: of telebot.util.parse_web_app_data:6 telebot.util.validate_web_app_data:6
msgid "The raw init data"
msgstr ""
#: of telebot.util.parse_web_app_data:9 telebot.util.validate_web_app_data:9
msgid "The parsed init data"
msgstr ""
#: of telebot.util.quick_markup:1
msgid ""
"Returns a reply markup from a dict in this format: {'text': kwargs} This "
"is useful to avoid always typing 'btn1 = InlineKeyboardButton(...)' 'btn2"
" = InlineKeyboardButton(...)'"
msgstr ""
#: of telebot.util.quick_markup:4 telebot.util.user_link:5
msgid "Example:"
msgstr ""
#: of telebot.util.quick_markup:6
msgid "Using quick_markup:"
msgstr ""
#: of telebot.util.quick_markup:31
msgid ""
"a dict containing all buttons to create in this format: {text: kwargs} "
"{str:}"
msgstr ""
#: of telebot.util.quick_markup:34
msgid "number of :class:`telebot.types.InlineKeyboardButton` objects on each row"
msgstr ""
#: of telebot.util.quick_markup:37
msgid "InlineKeyboardMarkup"
msgstr ""
#: of telebot.util.quick_markup:38
msgid ":obj:`types.InlineKeyboardMarkup`"
msgstr ""
#: of telebot.util.smart_split:1
msgid ""
"Splits one string into multiple strings, with a maximum amount of "
"`chars_per_string` characters per string. This is very useful for "
"splitting one giant message into multiples. If `chars_per_string` > 4096:"
" `chars_per_string` = 4096. Splits by '\\n', '. ' or ' ' in exactly this "
"priority."
msgstr ""
#: of telebot.util.smart_split:6 telebot.util.split_string:4
msgid "The text to split"
msgstr ""
#: of telebot.util.smart_split:9
msgid "The number of maximum characters per part the text is split to."
msgstr ""
#: of telebot.util.smart_split:12 telebot.util.split_string:10
msgid "The splitted text as a list of strings."
msgstr ""
#: of telebot.util.smart_split:13 telebot.util.split_string:11
msgid ":obj:`list` of :obj:`str`"
msgstr ""
#: of telebot.util.split_string:1
msgid ""
"Splits one string into multiple strings, with a maximum amount of "
"`chars_per_string` characters per string. This is very useful for "
"splitting one giant message into multiples."
msgstr ""
#: of telebot.util.split_string:7
msgid "The number of characters per line the text is split into."
msgstr ""
#: ../../docstring of telebot.util.update_types:1
msgid "All update types, should be used for allowed_updates parameter in polling."
msgstr ""
#: of telebot.util.user_link:1
msgid ""
"Returns an HTML user link. This is useful for reports. Attention: Don't "
"forget to set parse_mode to 'HTML'!"
msgstr ""
#: of telebot.util.user_link:11
msgid ""
"You can use formatting.* for all other formatting options(bold, italic, "
"links, and etc.) This method is kept for backward compatibility, and it "
"is recommended to use formatting.* for more options."
msgstr ""
#: of telebot.util.user_link:15
msgid "the user (not the user_id)"
msgstr ""
#: of telebot.util.user_link:18
msgid "include the user_id"
msgstr ""
#: of telebot.util.user_link:21
msgid "HTML user link"
msgstr ""
#: of telebot.util.validate_web_app_data:1
msgid "Validates web app data."
msgstr ""
#: of telebot.util.webhook_google_functions:1
msgid "A webhook endpoint for Google Cloud Functions FaaS."
msgstr ""
#: of telebot.util.webhook_google_functions:3
msgid "The bot instance"
msgstr ""
#: of telebot.util.webhook_google_functions:6
msgid "The request object"
msgstr ""
#: of telebot.util.webhook_google_functions:9
msgid "The response object"
msgstr ""
#~ msgid "int row width"
#~ msgstr ""

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,130 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, coder2020official
# This file is distributed under the same license as the pyTelegramBotAPI
# Documentation package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pyTelegramBotAPI Documentation \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-29 14:44+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: ../../calldata.rst:4
msgid "Callback data factory"
msgstr "Фабрика callback data"
#: ../../calldata.rst:6
msgid "Callback data factory in pyTelegramBotAPI"
msgstr "Фабрика callback data в pyTelegramBotAPI"
#: ../../calldata.rst:6
msgid ""
"ptba, pytba, pyTelegramBotAPI, callbackdatafactory, guide, callbackdata, "
"factory"
msgstr ""
"ptba, pytba, pyTelegramBotAPI, callbackdatafactory, гайд, callbackdata, "
"фабрика"
#: ../../calldata.rst:12
msgid "callback\\_data file"
msgstr "Файл callback\\_data"
#: of telebot.callback_data:1
msgid "Callback data factory's file."
msgstr "Файл фабрики callback data."
#: of telebot.callback_data.CallbackData:1
#: telebot.callback_data.CallbackDataFilter:1
msgid "Bases: :py:class:`object`"
msgstr "Базовые классы: :py:class:`object`"
#: of telebot.callback_data.CallbackData:1
msgid "Callback data factory This class will help you to work with CallbackQuery"
msgstr "Фабрика Callback data. Этот класс поможет вам в работе с CallbackQuery"
#: of telebot.callback_data.CallbackData.filter:1
msgid "Generate filter"
msgstr "Сгенерировать фильтр"
#: of telebot.callback_data.CallbackData.filter
#: telebot.callback_data.CallbackData.new
#: telebot.callback_data.CallbackData.parse
#: telebot.callback_data.CallbackDataFilter.check
msgid "Parameters"
msgstr ""
#: of telebot.callback_data.CallbackData.filter:3
msgid "specified named parameters will be checked with CallbackQuery.data"
msgstr "заданные именованные параметры будут проверены в CallbackQuery.data"
#: of telebot.callback_data.CallbackData.filter
#: telebot.callback_data.CallbackData.new
#: telebot.callback_data.CallbackData.parse
#: telebot.callback_data.CallbackDataFilter.check
msgid "Returns"
msgstr ""
#: of telebot.callback_data.CallbackData.filter:4
msgid "CallbackDataFilter class"
msgstr "Класс CallbackDataFilter"
#: of telebot.callback_data.CallbackData.new:1
msgid "Generate callback data"
msgstr "Сгенерировать callback data"
#: of telebot.callback_data.CallbackData.new:3
msgid "positional parameters of CallbackData instance parts"
msgstr "позиционные параметры экземпляра CallbackData"
#: of telebot.callback_data.CallbackData.new:4
msgid "named parameters"
msgstr "именованные параметры"
#: of telebot.callback_data.CallbackData.new:5
msgid "str"
msgstr ""
#: of telebot.callback_data.CallbackData.parse:1
msgid "Parse data from the callback data"
msgstr "Получить данные из callback data"
#: of telebot.callback_data.CallbackData.parse:3
msgid ""
"string, use to telebot.types.CallbackQuery to parse it from string to a "
"dict"
msgstr ""
"string, примените к telebot.types.CallbackQuery, чтобы преобразовать "
"callback_data из строки (str) в словарь (dict)"
#: of telebot.callback_data.CallbackData.parse:4
msgid "dict parsed from callback data"
msgstr "словарь (dict), полученный из callback data"
#: of telebot.callback_data.CallbackDataFilter:1
msgid "Filter for CallbackData."
msgstr "Фильтр для CallbackData."
#: of telebot.callback_data.CallbackDataFilter.check:1
msgid "Checks if query.data appropriates to specified config"
msgstr "Проверяет, соответствует ли query.data заданной конфигурации"
#: of telebot.callback_data.CallbackDataFilter.check:3
msgid "telebot.types.CallbackQuery"
msgstr ""
#: of telebot.callback_data.CallbackDataFilter.check:6
msgid "True if query.data appropriates to specified config"
msgstr "True, если query.data соответствует заданной конфигурации"
#: of telebot.callback_data.CallbackDataFilter.check
msgid "Return type"
msgstr ""

View File

@ -0,0 +1,251 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, coder2020official
# This file is distributed under the same license as the pyTelegramBotAPI
# Documentation package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pyTelegramBotAPI Documentation \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-29 14:44+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: ../../formatting.rst:3
msgid "Formatting options"
msgstr "Параметры форматирования"
#: ../../formatting.rst:5
msgid "Formatting options in pyTelegramBotAPI"
msgstr "Параметры форматирования в pyTelegramBotAPI"
#: ../../formatting.rst:5
msgid "html, markdown, parse_mode, formatting, ptba, pytba, pyTelegramBotAPI"
msgstr "html, markdown, parse_mode, форматирование, ptba, pytba, pyTelegramBotAPI"
#: of telebot.formatting:1
msgid "Markdown & HTML formatting functions."
msgstr "Функции форматирования Markdown & HTML."
#: of telebot.formatting.escape_html:1
msgid "Escapes HTML characters in a string of HTML."
msgstr "Пропускает HTML символы в HTML строке."
#: of telebot.formatting.escape_html telebot.formatting.escape_markdown
#: telebot.formatting.format_text telebot.formatting.hbold
#: telebot.formatting.hcode telebot.formatting.hide_link
#: telebot.formatting.hitalic telebot.formatting.hlink telebot.formatting.hpre
#: telebot.formatting.hspoiler telebot.formatting.hstrikethrough
#: telebot.formatting.hunderline telebot.formatting.mbold
#: telebot.formatting.mcode telebot.formatting.mitalic telebot.formatting.mlink
#: telebot.formatting.mspoiler telebot.formatting.mstrikethrough
#: telebot.formatting.munderline
msgid "Parameters"
msgstr ""
#: of telebot.formatting.escape_html:3
msgid "The string of HTML to escape."
msgstr "HTML строка, которую нужно пропустить."
#: of telebot.formatting.escape_html telebot.formatting.escape_markdown
#: telebot.formatting.format_text telebot.formatting.hbold
#: telebot.formatting.hcode telebot.formatting.hide_link
#: telebot.formatting.hitalic telebot.formatting.hlink telebot.formatting.hpre
#: telebot.formatting.hspoiler telebot.formatting.hstrikethrough
#: telebot.formatting.hunderline telebot.formatting.mbold
#: telebot.formatting.mcode telebot.formatting.mitalic telebot.formatting.mlink
#: telebot.formatting.mspoiler telebot.formatting.mstrikethrough
#: telebot.formatting.munderline
msgid "Returns"
msgstr ""
#: of telebot.formatting.escape_html:6 telebot.formatting.escape_markdown:8
msgid "The escaped string."
msgstr "Пропускаемая строка."
#: of telebot.formatting.escape_html telebot.formatting.escape_markdown
#: telebot.formatting.format_text telebot.formatting.hbold
#: telebot.formatting.hcode telebot.formatting.hide_link
#: telebot.formatting.hitalic telebot.formatting.hlink telebot.formatting.hpre
#: telebot.formatting.hspoiler telebot.formatting.hstrikethrough
#: telebot.formatting.hunderline telebot.formatting.mbold
#: telebot.formatting.mcode telebot.formatting.mitalic telebot.formatting.mlink
#: telebot.formatting.mspoiler telebot.formatting.mstrikethrough
#: telebot.formatting.munderline
msgid "Return type"
msgstr ""
#: of telebot.formatting.escape_html:7 telebot.formatting.escape_markdown:9
#: telebot.formatting.format_text:17 telebot.formatting.hbold:10
#: telebot.formatting.hcode:10 telebot.formatting.hide_link:7
#: telebot.formatting.hitalic:10 telebot.formatting.hlink:13
#: telebot.formatting.hpre:10 telebot.formatting.hspoiler:10
#: telebot.formatting.hstrikethrough:10 telebot.formatting.hunderline:10
#: telebot.formatting.mbold:10 telebot.formatting.mcode:10
#: telebot.formatting.mitalic:10 telebot.formatting.mlink:13
#: telebot.formatting.mspoiler:10 telebot.formatting.mstrikethrough:10
#: telebot.formatting.munderline:10
msgid ":obj:`str`"
msgstr ""
#: of telebot.formatting.escape_markdown:1
msgid "Escapes Markdown characters in a string of Markdown."
msgstr "Пропускает Markdown символы в Markdown строке."
#: of telebot.formatting.escape_markdown:3
msgid "Credits to: simonsmh"
msgstr ""
#: of telebot.formatting.escape_markdown:5
msgid "The string of Markdown to escape."
msgstr "Markdown строка, которую нужно пропустить."
#: of telebot.formatting.format_text:1
msgid "Formats a list of strings into a single string."
msgstr "Преобразовывает набор строк в одну."
#: of telebot.formatting.format_text:10
msgid "Strings to format."
msgstr "Строки для преобразования."
#: of telebot.formatting.format_text:13
msgid "The separator to use between each string."
msgstr "Символ для разделения строк."
#: of telebot.formatting.format_text:16 telebot.formatting.hbold:9
#: telebot.formatting.hcode:9 telebot.formatting.hitalic:9
#: telebot.formatting.hlink:12 telebot.formatting.hpre:9
#: telebot.formatting.hspoiler:9 telebot.formatting.hstrikethrough:9
#: telebot.formatting.hunderline:9 telebot.formatting.mbold:9
#: telebot.formatting.mcode:9 telebot.formatting.mitalic:9
#: telebot.formatting.mlink:12 telebot.formatting.mspoiler:9
#: telebot.formatting.mstrikethrough:9 telebot.formatting.munderline:9
msgid "The formatted string."
msgstr "Преобразованная строка."
#: of telebot.formatting.hbold:1
msgid "Returns an HTML-formatted bold string."
msgstr "Возвращает выделенную жирным шрифтом HTML строку."
#: of telebot.formatting.hbold:3 telebot.formatting.mbold:3
msgid "The string to bold."
msgstr "Строка для выделения жирным шрифтом."
#: of telebot.formatting.hbold:6 telebot.formatting.hcode:6
#: telebot.formatting.hitalic:6 telebot.formatting.hlink:9
#: telebot.formatting.hpre:6 telebot.formatting.hspoiler:6
#: telebot.formatting.hstrikethrough:6 telebot.formatting.hunderline:6
#: telebot.formatting.mbold:6 telebot.formatting.mcode:6
#: telebot.formatting.mitalic:6 telebot.formatting.mlink:9
#: telebot.formatting.mspoiler:6 telebot.formatting.mstrikethrough:6
#: telebot.formatting.munderline:6
msgid "True if you need to escape special characters. Defaults to True."
msgstr "True если вам нужно пропустить спец. символы. По умолчанию True."
#: of telebot.formatting.hcode:1
msgid "Returns an HTML-formatted code string."
msgstr "Возвращает выделенную как код HTML строку."
#: of telebot.formatting.hcode:3 telebot.formatting.mcode:3
msgid "The string to code."
msgstr "Строка для выделения как код."
#: of telebot.formatting.hide_link:1
msgid "Hide url of an image."
msgstr "Делает невидимым URL изображения."
#: of telebot.formatting.hide_link:3
msgid "The url of the image."
msgstr "URL изображения."
#: of telebot.formatting.hide_link:6
msgid "The hidden url."
msgstr "Невидимый URL."
#: of telebot.formatting.hitalic:1
msgid "Returns an HTML-formatted italic string."
msgstr "Возвращает выделенную курсивом HTML строку."
#: of telebot.formatting.hitalic:3 telebot.formatting.mitalic:3
msgid "The string to italicize."
msgstr "Строка для выделения курсивом."
#: of telebot.formatting.hlink:1
msgid "Returns an HTML-formatted link string."
msgstr "Возвращает HTML строку с гиперссылкой."
#: of telebot.formatting.hlink:3 telebot.formatting.mlink:3
msgid "The string to link."
msgstr "Строка для добавления гиперссылки."
#: of telebot.formatting.hlink:6 telebot.formatting.mlink:6
msgid "The URL to link to."
msgstr "URL для создания гиперссылки."
#: of telebot.formatting.hpre:1
msgid "Returns an HTML-formatted preformatted string."
msgstr "Возвращает предварительно отформатированную HTML строку."
#: of telebot.formatting.hpre:3
msgid "The string to preformatted."
msgstr "Строка для предварительного форматирования."
#: of telebot.formatting.hspoiler:1
msgid "Returns an HTML-formatted spoiler string."
msgstr "Возвращает выделенную как спойлер HTML строку."
#: of telebot.formatting.hspoiler:3 telebot.formatting.mspoiler:3
msgid "The string to spoiler."
msgstr "Строка для выделения как спойлер."
#: of telebot.formatting.hstrikethrough:1
msgid "Returns an HTML-formatted strikethrough string."
msgstr "Возвращает зачеркнутую HTML строку."
#: of telebot.formatting.hstrikethrough:3 telebot.formatting.mstrikethrough:3
msgid "The string to strikethrough."
msgstr "Строка для зачеркивания."
#: of telebot.formatting.hunderline:1
msgid "Returns an HTML-formatted underline string."
msgstr "Возвращает подчеркнутую HTML строку."
#: of telebot.formatting.hunderline:3 telebot.formatting.munderline:3
msgid "The string to underline."
msgstr "Строка для подчёркивания."
#: of telebot.formatting.mbold:1
msgid "Returns a Markdown-formatted bold string."
msgstr "Возвращает выделенную жирным шрифтом Markdown строку."
#: of telebot.formatting.mcode:1
msgid "Returns a Markdown-formatted code string."
msgstr "Возвращает выделенную как код Markdown строку."
#: of telebot.formatting.mitalic:1
msgid "Returns a Markdown-formatted italic string."
msgstr "Возвращает выделенную курсивом Markdown строку."
#: of telebot.formatting.mlink:1
msgid "Returns a Markdown-formatted link string."
msgstr "Возвращает Markdown строку с гиперссылкой."
#: of telebot.formatting.mspoiler:1
msgid "Returns a Markdown-formatted spoiler string."
msgstr "Возвращает выделенную как спойлер Markdown строку."
#: of telebot.formatting.mstrikethrough:1
msgid "Returns a Markdown-formatted strikethrough string."
msgstr "Возвращает зачеркнутую Markdown строку."
#: of telebot.formatting.munderline:1
msgid "Returns a Markdown-formatted underline string."
msgstr "Возвращает подчеркнутую Markdown строку."

View File

@ -0,0 +1,128 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, coder2020official
# This file is distributed under the same license as the pyTelegramBotAPI
# Documentation package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pyTelegramBotAPI Documentation \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-29 14:44+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: ../../index.rst:8
msgid "Welcome to pyTelegramBotAPI's documentation!"
msgstr "Добро пожаловать в документацию pyTelegramBotAPI!"
#: ../../index.rst:10
msgid "Official documentation of pyTelegramBotAPI"
msgstr "Официальная документация pyTelegramBotAPI"
#: ../../index.rst:10
msgid "ptba, pytba, pyTelegramBotAPI, documentation, guide"
msgstr "ptba, pytba, pyTelegramBotAPI, документация, гайд"
#: ../../index.rst:17
msgid "TeleBot"
msgstr ""
#: ../../index.rst:18
msgid ""
"TeleBot is synchronous and asynchronous implementation of `Telegram Bot "
"API <https://core.telegram.org/bots/api>`_."
msgstr ""
"TeleBot это синхронная и асинхронная реализация `Telegram Bot "
"API <https://core.telegram.org/bots/api>`_."
#: ../../index.rst:21
msgid "Chats"
msgstr "Чаты"
#: ../../index.rst:22
msgid ""
"English chat: `Private chat "
"<https://telegram.me/joinchat/Bn4ixj84FIZVkwhk2jag6A>`__"
msgstr ""
"Англоязычный чат: `Private chat "
"<https://telegram.me/joinchat/Bn4ixj84FIZVkwhk2jag6A>`__"
#: ../../index.rst:24
msgid ""
"Russian chat: `@pytelegrambotapi_talks_ru "
"<https://t.me/pytelegrambotapi_talks_ru>`__"
msgstr ""
"Русскоязычный чат: `@pytelegrambotapi_talks_ru "
"<https://t.me/pytelegrambotapi_talks_ru>`__"
#: ../../index.rst:26
msgid "News: `@pyTelegramBotAPI <https://t.me/pytelegrambotapi>`__"
msgstr "Новости: `@pyTelegramBotAPI <https://t.me/pytelegrambotapi>`__"
#: ../../index.rst:28
msgid "Pypi: `Pypi <https://pypi.org/project/pyTelegramBotAPI/>`__"
msgstr ""
#: ../../index.rst:30
msgid ""
"Source: `Github repository "
"<https://github.com/eternnoir/pyTelegramBotAPI>`__"
msgstr ""
"Исходники: `Github repository "
"<https://github.com/eternnoir/pyTelegramBotAPI>`__"
#: ../../index.rst:33
msgid "Some features:"
msgstr "Некоторые особенности:"
#: ../../index.rst:34
msgid "Easy to learn and use."
msgstr "Простой в изучении и использовании."
#: ../../index.rst:36
msgid "Easy to understand."
msgstr "Простой в понимании."
#: ../../index.rst:38
msgid "Both sync and async."
msgstr "И синхронный, и асинхронный."
#: ../../index.rst:40
msgid "Examples on features."
msgstr "Примеры возможностей."
#: ../../index.rst:42
msgid "States"
msgstr "Состояния (стейты, FSM)"
#: ../../index.rst:44
msgid "And more..."
msgstr "И другое..."
#: ../../index.rst:47
msgid "Content"
msgstr "Содержимое"
#: ../../index.rst:63
msgid "Indices and tables"
msgstr "Ссылки"
#: ../../index.rst:65
msgid ":ref:`genindex`"
msgstr ""
#: ../../index.rst:66
msgid ":ref:`modindex`"
msgstr ""
#: ../../index.rst:67
msgid ":ref:`search`"
msgstr ""

View File

@ -0,0 +1,59 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, coder2020official
# This file is distributed under the same license as the pyTelegramBotAPI
# Documentation package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pyTelegramBotAPI Documentation \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-29 14:44+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: ../../install.rst:3
msgid "Installation Guide"
msgstr "Гайд по установке"
#: ../../install.rst:5
msgid "Installation of pyTelegramBotAPI"
msgstr "Установка pyTelegramBotAPI"
#: ../../install.rst:5
msgid "ptba, pytba, pyTelegramBotAPI, installation, guide"
msgstr "ptba, pytba, pyTelegramBotAPI, установка, гайд"
#: ../../install.rst:11
msgid "Using PIP"
msgstr "Используя PIP"
#: ../../install.rst:17
msgid "Using pipenv"
msgstr "Используя pipenv"
#: ../../install.rst:23
msgid "By cloning repository"
msgstr "Клонируя репозиторий"
#: ../../install.rst:31
msgid "Directly using pip"
msgstr "Напрямую используя pip"
#: ../../install.rst:37
msgid "It is generally recommended to use the first option."
msgstr "Рекомендуется использовать первый вариант."
#: ../../install.rst:39
msgid ""
"While the API is production-ready, it is still under development and it "
"has regular updates, do not forget to update it regularly by calling:"
msgstr "Новые версии библиотеки имеют больше фич, улучшений и баг фиксов. Не забывайте"
" обновляться вызывая:"

View File

@ -0,0 +1,40 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, coder2020official
# This file is distributed under the same license as the pyTelegramBotAPI
# Documentation package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pyTelegramBotAPI Documentation \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-29 14:44+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: ../../quick_start.rst:4
msgid "Quick start"
msgstr "Быстрый старт"
#: ../../quick_start.rst:6
msgid "Quickstart guide"
msgstr "Быстрый старт - гайд"
#: ../../quick_start.rst:6
msgid "ptba, pytba, pyTelegramBotAPI, quickstart, guide"
msgstr "ptba, pytba, pyTelegramBotAPI, быстрый старт, гайд"
#: ../../quick_start.rst:11
msgid "Synchronous TeleBot"
msgstr "Синхронный телебот"
#: ../../quick_start.rst:16
msgid "Asynchronous TeleBot"
msgstr "Асинхронный телебот"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,393 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, coder2020official
# This file is distributed under the same license as the pyTelegramBotAPI
# Documentation package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pyTelegramBotAPI Documentation \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-08 23:07+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: ../../source/util.rst:3
msgid "Utils"
msgstr "Утилиты"
#: ../../source/util.rst:5
msgid "Utils in pyTelegramBotAPI"
msgstr "Утилиты в pyTelegramBotAPI"
#: ../../source/util.rst:5
msgid "ptba, pytba, pyTelegramBotAPI, utils, guide"
msgstr "ptba, pytba, pyTelegramBotAPI, утилиты, гайд"
#: ../../source/util.rst:11
msgid "util file"
msgstr "Файл util"
#: of telebot.util.antiflood:1
msgid ""
"Use this function inside loops in order to avoid getting TooManyRequests "
"error. Example:"
msgstr ""
"Используйте эту функцию в циклах, чтобы избежать ошибки TooManyRequests. "
"Пример:"
#: of telebot.service_utils.is_bytes telebot.service_utils.is_dict
#: telebot.service_utils.is_pil_image telebot.util.antiflood
#: telebot.util.escape telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.is_command
#: telebot.util.parse_web_app_data telebot.util.quick_markup
#: telebot.util.smart_split telebot.util.split_string telebot.util.user_link
#: telebot.util.validate_web_app_data telebot.util.webhook_google_functions
msgid "Parameters"
msgstr ""
#: of telebot.util.antiflood:10
msgid "The function to call"
msgstr "Вызываемая функция"
#: of telebot.util.antiflood:13
msgid "Number of retries to send"
msgstr ""
#: of telebot.util.antiflood:16
msgid "The arguments to pass to the function"
msgstr "Аргументы, для передачи в функцию"
#: of telebot.util.antiflood:19
msgid "The keyword arguments to pass to the function"
msgstr "Именованные аргументы для передачи в функцию"
#: of telebot.service_utils.generate_random_token
#: telebot.service_utils.is_bytes telebot.service_utils.is_dict
#: telebot.service_utils.is_pil_image telebot.util.antiflood
#: telebot.util.escape telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.is_command
#: telebot.util.parse_web_app_data telebot.util.quick_markup
#: telebot.util.smart_split telebot.util.split_string telebot.util.user_link
#: telebot.util.validate_web_app_data telebot.util.webhook_google_functions
msgid "Returns"
msgstr ""
#: of telebot.util.antiflood:22
msgid "None"
msgstr ""
#: of telebot.service_utils.chunks:1
msgid "Yield successive n-sized chunks from lst."
msgstr "Генерирует последовательные части списка, состоящие из n элементов."
#: ../../docstring of telebot.util.content_type_media:1
msgid "Contains all media content types."
msgstr "Содержит все виды медиа."
#: ../../docstring of telebot.util.content_type_service:1
msgid "Contains all service content types such as `User joined the group`."
msgstr "Содержит все виды сервисных сообщений, такие как `User joined the group`."
#: of telebot.util.escape:1
msgid ""
"Replaces the following chars in `text` ('&' with '&amp;', '<' with '&lt;'"
" and '>' with '&gt;')."
msgstr ""
"Заменяет следующие символы в `text` ('&' на '&amp;', '<' на '&lt;' и '>' "
"на '&gt;')."
#: of telebot.util.escape:3
msgid "the text to escape"
msgstr "Текст для замены символов"
#: of telebot.util.escape:4
msgid "the escaped text"
msgstr "Отформатированный текст"
#: of telebot.util.extract_arguments:1
msgid "Returns the argument after the command."
msgstr "Возвращает аргументы команды."
#: of telebot.util.extract_arguments:3 telebot.util.extract_command:4
msgid "Examples:"
msgstr "Примеры:"
#: of telebot.util.extract_arguments:10
msgid "String to extract the arguments from a command"
msgstr "Строка для извлечения аргументов команды"
#: of telebot.util.extract_arguments:13
msgid "the arguments if `text` is a command (according to is_command), else None."
msgstr ""
"Аргументы, если `text` является командой (согласно is_command), в "
"остальных случаях None."
#: of telebot.service_utils.generate_random_token
#: telebot.service_utils.is_bytes telebot.service_utils.is_dict
#: telebot.service_utils.is_pil_image telebot.util.extract_arguments
#: telebot.util.extract_command telebot.util.is_command
#: telebot.util.quick_markup telebot.util.smart_split telebot.util.split_string
#: telebot.util.user_link
msgid "Return type"
msgstr ""
#: of telebot.util.extract_arguments:14 telebot.util.extract_command:16
msgid ":obj:`str` or :obj:`None`"
msgstr ":obj:`str` или :obj:`None`"
#: of telebot.util.extract_command:1
msgid ""
"Extracts the command from `text` (minus the '/') if `text` is a command "
"(see is_command). If `text` is not a command, this function returns None."
msgstr ""
"Извлекает команду из `text` (исключает '/') если `text` является командой"
" (см. is_command). Если `text` не является командой, эта функция "
"возвращает None."
#: of telebot.util.extract_command:12
msgid "String to extract the command from"
msgstr "Строка, из которой нужно извлечь команду"
#: of telebot.util.extract_command:15
msgid "the command if `text` is a command (according to is_command), else None."
msgstr ""
"Команда, если `text` является командой (согласно is_command), в остальных"
" случаях None."
#: of telebot.service_utils.generate_random_token:1
msgid ""
"Generates a random token consisting of letters and digits, 16 characters "
"long."
msgstr ""
"Генерирует рандомный токен, состоящий из латинских букв и цифр длиной 16 "
"символов."
#: of telebot.service_utils.generate_random_token:3
msgid "a random token"
msgstr "Сгенерированный токен"
#: of telebot.service_utils.generate_random_token:4 telebot.util.user_link:22
msgid ":obj:`str`"
msgstr ""
#: of telebot.service_utils.is_bytes:1
msgid "Returns True if the given object is a bytes object."
msgstr "Возвращает True если полученный объект является bytes."
#: of telebot.service_utils.is_bytes:3 telebot.service_utils.is_dict:3
#: telebot.service_utils.is_pil_image:3
msgid "object to be checked"
msgstr "Объект для проверки"
#: of telebot.service_utils.is_bytes:6
msgid "True if the given object is a bytes object."
msgstr "True, если полученный объект является bytes."
#: of telebot.service_utils.is_bytes:7 telebot.service_utils.is_dict:7
#: telebot.service_utils.is_pil_image:7 telebot.util.is_command:7
msgid ":obj:`bool`"
msgstr ""
#: of telebot.util.is_command:1
msgid ""
"Checks if `text` is a command. Telegram chat commands start with the '/' "
"character."
msgstr ""
"Проверяет, является ли `text` командой. Команды в Telegram начинаются с "
"символа '/'."
#: of telebot.util.is_command:3
msgid "Text to check."
msgstr "Текст для проверки."
#: of telebot.util.is_command:6
msgid "True if `text` is a command, else False."
msgstr "True, если `text` является командой, иначе False."
#: of telebot.service_utils.is_dict:1
msgid "Returns True if the given object is a dictionary."
msgstr "Возвращает True, если полученный объект является словарём (dict)."
#: of telebot.service_utils.is_dict:6
msgid "True if the given object is a dictionary."
msgstr "True, если полученный объект является словарём (dict)."
#: of telebot.service_utils.is_pil_image:1
msgid "Returns True if the given object is a PIL.Image.Image object."
msgstr "Возвращает True, если полученный объект является PIL.Image.Image."
#: of telebot.service_utils.is_pil_image:6
msgid "True if the given object is a PIL.Image.Image object."
msgstr "True, если полученный объект является PIL.Image.Image."
#: of telebot.service_utils.is_string:1
msgid "Returns True if the given object is a string."
msgstr "Возвращает True, если полученный объект является строкой (str)."
#: of telebot.util.parse_web_app_data:1
msgid "Parses web app data."
msgstr "Обрабатывает данные, полученные от web app."
#: of telebot.util.parse_web_app_data:3 telebot.util.validate_web_app_data:3
msgid "The bot token"
msgstr "Токен бота"
#: of telebot.util.parse_web_app_data:6 telebot.util.validate_web_app_data:6
msgid "The raw init data"
msgstr "Необработанные данные"
#: of telebot.util.parse_web_app_data:9 telebot.util.validate_web_app_data:9
msgid "The parsed init data"
msgstr "Обработанные данные"
#: of telebot.util.quick_markup:1
msgid ""
"Returns a reply markup from a dict in this format: {'text': kwargs} This "
"is useful to avoid always typing 'btn1 = InlineKeyboardButton(...)' 'btn2"
" = InlineKeyboardButton(...)'"
msgstr ""
"Возвращает reply markup из словаря следующего формата: {'text': kwargs}. "
"Удобно использовать вместо постоянного использования 'btn1 = "
"InlineKeyboardButton(...)' 'btn2 = InlineKeyboardButton(...)'"
#: of telebot.util.quick_markup:4 telebot.util.user_link:5
msgid "Example:"
msgstr "Пример:"
#: of telebot.util.quick_markup:6
msgid "Using quick_markup:"
msgstr "Используя quick_markup:"
#: of telebot.util.quick_markup:31
msgid ""
"a dict containing all buttons to create in this format: {text: kwargs} "
"{str:}"
msgstr ""
"Словарь, содержащий все кнопки для создания reply markup в следующем "
"формате: {text: kwargs} {str:}"
#: of telebot.util.quick_markup:34
msgid "number of :class:`telebot.types.InlineKeyboardButton` objects on each row"
msgstr ""
#: of telebot.util.quick_markup:37
msgid "InlineKeyboardMarkup"
msgstr ""
#: of telebot.util.quick_markup:38
msgid ":obj:`types.InlineKeyboardMarkup`"
msgstr ""
#: of telebot.util.smart_split:1
msgid ""
"Splits one string into multiple strings, with a maximum amount of "
"`chars_per_string` characters per string. This is very useful for "
"splitting one giant message into multiples. If `chars_per_string` > 4096:"
" `chars_per_string` = 4096. Splits by '\\n', '. ' or ' ' in exactly this "
"priority."
msgstr ""
"Разбивает строку на несколько, каждая из которых будет не длиннее "
"`characters_per_string`. Удобно использовать для разбиения одного "
"гигантского сообщения на несколько. Если `chars_per_string` > 4096: "
"`chars_per_string` = 4096. Разбивает строку по '\\n', '. ' или ' ' именно"
" в таком порядке."
#: of telebot.util.smart_split:6 telebot.util.split_string:4
msgid "The text to split"
msgstr "Текст для разбиения"
#: of telebot.util.smart_split:9
msgid "The number of maximum characters per part the text is split to."
msgstr ""
"Максимальное количество символов в части текста, на которые он будет "
"разбит."
#: of telebot.util.smart_split:12 telebot.util.split_string:10
msgid "The splitted text as a list of strings."
msgstr "Список частей разбитого текста."
#: of telebot.util.smart_split:13 telebot.util.split_string:11
msgid ":obj:`list` of :obj:`str`"
msgstr ""
#: of telebot.util.split_string:1
msgid ""
"Splits one string into multiple strings, with a maximum amount of "
"`chars_per_string` characters per string. This is very useful for "
"splitting one giant message into multiples."
msgstr ""
"Разбивает одну строку на несколько, каждая из которых будет не длиннее "
"`characters_per_string`. Удобно использовать для разбиения одного "
"гигантского сообщения на несколько."
#: of telebot.util.split_string:7
msgid "The number of characters per line the text is split into."
msgstr "Количество символов в одной строке, на которые будет разбит текст."
#: ../../docstring of telebot.util.update_types:1
msgid "All update types, should be used for allowed_updates parameter in polling."
msgstr ""
"Все виды апдейтов, рекомендуется использовать в качестве параметра "
"allowed_updates функции polling."
#: of telebot.util.user_link:1
msgid ""
"Returns an HTML user link. This is useful for reports. Attention: Don't "
"forget to set parse_mode to 'HTML'!"
msgstr ""
"Возвращает HTML ссылку на пользователя. Удобно использовать для отчетов. "
"Важно: Не забудьте установить значение 'HTML' в parse_mode!"
#: of telebot.util.user_link:11
msgid ""
"You can use formatting.* for all other formatting options(bold, italic, "
"links, and etc.) This method is kept for backward compatibility, and it "
"is recommended to use formatting.* for more options."
msgstr ""
"Вы можете использовать formatting.* во всех остальных вариантах "
"форматирования(bold, italic, links, и прочее). Этот метод сохранён для "
"обратной совместимости, рекомендуется использовать formatting.* для "
"большего количества вариантов."
#: of telebot.util.user_link:15
msgid "the user (not the user_id)"
msgstr "Пользователь (не id пользователя)"
#: of telebot.util.user_link:18
msgid "include the user_id"
msgstr "Добавить id пользователя"
#: of telebot.util.user_link:21
msgid "HTML user link"
msgstr "Ссылка на пользователя в формате HTML"
#: of telebot.util.validate_web_app_data:1
msgid "Validates web app data."
msgstr "Проверяет данные, полученные от web app."
#: of telebot.util.webhook_google_functions:1
msgid "A webhook endpoint for Google Cloud Functions FaaS."
msgstr "Endpoint вебхука для Google Cloud Functions FaaS."
#: of telebot.util.webhook_google_functions:3
msgid "The bot instance"
msgstr "Инстанс бота"
#: of telebot.util.webhook_google_functions:6
msgid "The request object"
msgstr "HTTP-запрос"
#: of telebot.util.webhook_google_functions:9
msgid "The response object"
msgstr "Объект, полученный в качестве ответа"
#~ msgid "int row width"
#~ msgstr "Количество кнопок в одной строке, int"

View File

@ -0,0 +1,20 @@
===========
Quick start
===========
.. meta::
:description: Quickstart guide
:keywords: ptba, pytba, pyTelegramBotAPI, quickstart, guide
Synchronous TeleBot
-------------------
.. literalinclude:: ../../examples/echo_bot.py
:language: python
Asynchronous TeleBot
--------------------
.. literalinclude:: ../../examples/asynchronous_telebot/echo_bot.py
:language: python

View File

@ -0,0 +1,41 @@
===============
TeleBot version
===============
.. meta::
:description: Synchronous pyTelegramBotAPI documentation
:keywords: ptba, pytba, pyTelegramBotAPI, methods, guide, files, sync
TeleBot methods
---------------
.. automodule:: telebot
:members:
:undoc-members:
:show-inheritance:
custom_filters file
------------------------------
.. automodule:: telebot.custom_filters
:members:
:undoc-members:
:show-inheritance:
handler_backends file
--------------------------------
.. automodule:: telebot.handler_backends
:members:
:undoc-members:
:show-inheritance:
Extensions
------------------------
.. automodule:: telebot.ext.sync.webhooks
:members:
:undoc-members:
:show-inheritance:

10
docs/source/types.rst Normal file
View File

@ -0,0 +1,10 @@
============
Types of API
============
.. automodule:: telebot.types
:members:
:undoc-members:
:show-inheritance:

16
docs/source/util.rst Normal file
View File

@ -0,0 +1,16 @@
============
Utils
============
.. meta::
:description: Utils in pyTelegramBotAPI
:keywords: ptba, pytba, pyTelegramBotAPI, utils, guide
util file
-------------------
.. automodule:: telebot.util
:members:
:undoc-members:
:show-inheritance:

117
examples/anonymous_bot.py Normal file
View File

@ -0,0 +1,117 @@
# This bot is needed to connect two people and their subsequent anonymous communication
#
# Avaiable commands:
# `/start` - Just send you a messsage how to start
# `/find` - Find a person you can contact
# `/stop` - Stop active conversation
import telebot
from telebot import types
# Initialize bot with your token
bot = telebot.TeleBot('TOKEN')
# The `users` variable is needed to contain chat ids that are either in the search or in the active dialog, like {chat_id, chat_id}
users = {}
# The `freeid` variable is needed to contain chat id, that want to start conversation
# Or, in other words: chat id of user in the search
freeid = None
# `/start` command handler
#
# That command only sends you 'Just use /find command!'
@bot.message_handler(commands=['start'])
def start(message: types.Message):
bot.send_message(message.chat.id, 'Just use /find command!')
# `/find` command handler
#
# That command finds opponent for you
#
# That command according to the following principle:
# 1. You have written `/find` command
# 2. If you are already in the search or have an active dialog, bot sends you 'Shut up!'
# 3. If not:
# 3.1. Bot sends you 'Finding...'
# 3.2. If there is no user in the search:
# 3.2.2. `freeid` updated with `your_chat_id`
# 3.3. If there is user in the search:
# 3.3.1. Both you and the user in the search recieve the message 'Founded!'
# 3.3.2. `users` updated with a {user_in_the_search_chat_id, your_chat_id}
# 3.3.3. `users` updated with a {your_chat_id, user_in_the_search_id}
# 3.3.4. `freeid` updated with `None`
@bot.message_handler(commands=['find'])
def find(message: types.Message):
global freeid
if message.chat.id not in users:
bot.send_message(message.chat.id, 'Finding...')
if freeid is None:
freeid = message.chat.id
else:
# Question:
# Is there any way to simplify this like `bot.send_message([message.chat.id, freeid], 'Founded!')`?
bot.send_message(message.chat.id, 'Founded!')
bot.send_message(freeid, 'Founded!')
users[freeid] = message.chat.id
users[message.chat.id] = freeid
freeid = None
print(users, freeid) # Debug purpose, you can remove that line
else:
bot.send_message(message.chat.id, 'Shut up!')
# `/stop` command handler
#
# That command stops your current conversation (if it exist)
#
# That command according to the following principle:
# 1. You have written `/stop` command
# 2. If you are not have active dialog or you are not in search, bot sends you 'You are not in search!'
# 3. If you are in active dialog:
# 3.1. Bot sends you 'Stopping...'
# 3.2. Bot sends 'Your opponent is leavin`...' to your opponent
# 3.3. {your_opponent_chat_id, your_chat_id} removes from `users`
# 3.4. {your_chat_id, your_opponent_chat_id} removes from `users`
# 4. If you are only in search:
# 4.1. Bot sends you 'Stopping...'
# 4.2. `freeid` updated with `None`
@bot.message_handler(commands=['stop'])
def stop(message: types.Message):
global freeid
if message.chat.id in users:
bot.send_message(message.chat.id, 'Stopping...')
bot.send_message(users[message.chat.id], 'Your opponent is leavin`...')
del users[users[message.chat.id]]
del users[message.chat.id]
print(users, freeid) # Debug purpose, you can remove that line
elif message.chat.id == freeid:
bot.send_message(message.chat.id, 'Stopping...')
freeid = None
print(users, freeid) # Debug purpose, you can remove that line
else:
bot.send_message(message.chat.id, 'You are not in search!')
# message handler for conversation
#
# That handler needed to send message from one opponent to another
# If you are not in `users`, you will recieve a message 'No one can hear you...'
# Otherwise all your messages are sent to your opponent
#
# Questions:
# 1. Is there any way to improve readability like `content_types=['all']`?
# 2. Is there any way to register this message handler only when i found the opponent?
@bot.message_handler(content_types=['animation', 'audio', 'contact', 'dice', 'document', 'location', 'photo', 'poll', 'sticker', 'text', 'venue', 'video', 'video_note', 'voice'])
def chatting(message: types.Message):
if message.chat.id in users:
bot.copy_message(users[message.chat.id], users[users[message.chat.id]], message.id)
else:
bot.send_message(message.chat.id, 'No one can hear you...')
bot.infinity_polling(skip_pending=True)

View File

@ -0,0 +1,26 @@
from telebot import types
from telebot.async_telebot import AsyncTeleBot
from telebot.asyncio_filters import AdvancedCustomFilter
from telebot.callback_data import CallbackData, CallbackDataFilter
calendar_factory = CallbackData("year", "month", prefix="calendar")
calendar_zoom = CallbackData("year", prefix="calendar_zoom")
class CalendarCallbackFilter(AdvancedCustomFilter):
key = 'calendar_config'
async def check(self, call: types.CallbackQuery, config: CallbackDataFilter):
return config.check(query=call)
class CalendarZoomCallbackFilter(AdvancedCustomFilter):
key = 'calendar_zoom_config'
async def check(self, call: types.CallbackQuery, config: CallbackDataFilter):
return config.check(query=call)
def bind_filters(bot: AsyncTeleBot):
bot.add_custom_filter(CalendarCallbackFilter())
bot.add_custom_filter(CalendarZoomCallbackFilter())

View File

@ -0,0 +1,92 @@
import calendar
from datetime import date, timedelta
from filters import calendar_factory, calendar_zoom
from telebot.types import InlineKeyboardMarkup, InlineKeyboardButton
EMTPY_FIELD = '1'
WEEK_DAYS = [calendar.day_abbr[i] for i in range(7)]
MONTHS = [(i, calendar.month_name[i]) for i in range(1, 13)]
def generate_calendar_days(year: int, month: int):
keyboard = InlineKeyboardMarkup(row_width=7)
today = date.today()
keyboard.add(
InlineKeyboardButton(
text=date(year=year, month=month, day=1).strftime('%b %Y'),
callback_data=EMTPY_FIELD
)
)
keyboard.add(*[
InlineKeyboardButton(
text=day,
callback_data=EMTPY_FIELD
)
for day in WEEK_DAYS
])
for week in calendar.Calendar().monthdayscalendar(year=year, month=month):
week_buttons = []
for day in week:
day_name = ' '
if day == today.day and today.year == year and today.month == month:
day_name = '🔘'
elif day != 0:
day_name = str(day)
week_buttons.append(
InlineKeyboardButton(
text=day_name,
callback_data=EMTPY_FIELD
)
)
keyboard.add(*week_buttons)
previous_date = date(year=year, month=month, day=1) - timedelta(days=1)
next_date = date(year=year, month=month, day=1) + timedelta(days=31)
keyboard.add(
InlineKeyboardButton(
text='Previous month',
callback_data=calendar_factory.new(year=previous_date.year, month=previous_date.month)
),
InlineKeyboardButton(
text='Zoom out',
callback_data=calendar_zoom.new(year=year)
),
InlineKeyboardButton(
text='Next month',
callback_data=calendar_factory.new(year=next_date.year, month=next_date.month)
),
)
return keyboard
def generate_calendar_months(year: int):
keyboard = InlineKeyboardMarkup(row_width=3)
keyboard.add(
InlineKeyboardButton(
text=date(year=year, month=1, day=1).strftime('Year %Y'),
callback_data=EMTPY_FIELD
)
)
keyboard.add(*[
InlineKeyboardButton(
text=month,
callback_data=calendar_factory.new(year=year, month=month_number)
)
for month_number, month in MONTHS
])
keyboard.add(
InlineKeyboardButton(
text='Previous year',
callback_data=calendar_zoom.new(year=year - 1)
),
InlineKeyboardButton(
text='Next year',
callback_data=calendar_zoom.new(year=year + 1)
)
)
return keyboard

View File

@ -0,0 +1,57 @@
# -*- coding: utf-8 -*-
"""
This Example will show you an advanced usage of CallbackData.
In this example calendar was implemented
"""
import asyncio
from datetime import date
from filters import calendar_factory, calendar_zoom, bind_filters
from keyboards import generate_calendar_days, generate_calendar_months, EMTPY_FIELD
from telebot import types
from telebot.async_telebot import AsyncTeleBot
API_TOKEN = ''
bot = AsyncTeleBot(API_TOKEN)
@bot.message_handler(commands='start')
async def start_command_handler(message: types.Message):
await bot.send_message(message.chat.id,
f"Hello {message.from_user.first_name}. This bot is an example of calendar keyboard."
"\nPress /calendar to see it.")
@bot.message_handler(commands='calendar')
async def calendar_command_handler(message: types.Message):
now = date.today()
await bot.send_message(message.chat.id, 'Calendar',
reply_markup=generate_calendar_days(year=now.year, month=now.month))
@bot.callback_query_handler(func=None, calendar_config=calendar_factory.filter())
async def calendar_action_handler(call: types.CallbackQuery):
callback_data: dict = calendar_factory.parse(callback_data=call.data)
year, month = int(callback_data['year']), int(callback_data['month'])
await bot.edit_message_reply_markup(call.message.chat.id, call.message.id,
reply_markup=generate_calendar_days(year=year, month=month))
@bot.callback_query_handler(func=None, calendar_zoom_config=calendar_zoom.filter())
async def calendar_zoom_out_handler(call: types.CallbackQuery):
callback_data: dict = calendar_zoom.parse(callback_data=call.data)
year = int(callback_data.get('year'))
await bot.edit_message_reply_markup(call.message.chat.id, call.message.id,
reply_markup=generate_calendar_months(year=year))
@bot.callback_query_handler(func=lambda call: call.data == EMTPY_FIELD)
async def callback_empty_field_handler(call: types.CallbackQuery):
await bot.answer_callback_query(call.id)
if __name__ == '__main__':
bind_filters(bot)
asyncio.run(bot.infinity_polling())

View File

@ -0,0 +1,88 @@
# -*- coding: utf-8 -*-
"""
This Example will show you how to use CallbackData
"""
from telebot.callback_data import CallbackData, CallbackDataFilter
from telebot import types
from telebot.async_telebot import AsyncTeleBot
from telebot.asyncio_filters import AdvancedCustomFilter
API_TOKEN = 'TOKEN'
PRODUCTS = [
{'id': '0', 'name': 'xiaomi mi 10', 'price': 400},
{'id': '1', 'name': 'samsung s20', 'price': 800},
{'id': '2', 'name': 'iphone 13', 'price': 1300}
]
bot = AsyncTeleBot(API_TOKEN)
products_factory = CallbackData('product_id', prefix='products')
def products_keyboard():
return types.InlineKeyboardMarkup(
keyboard=[
[
types.InlineKeyboardButton(
text=product['name'],
callback_data=products_factory.new(product_id=product["id"])
)
]
for product in PRODUCTS
]
)
def back_keyboard():
return types.InlineKeyboardMarkup(
keyboard=[
[
types.InlineKeyboardButton(
text='',
callback_data='back'
)
]
]
)
class ProductsCallbackFilter(AdvancedCustomFilter):
key = 'config'
async def check(self, call: types.CallbackQuery, config: CallbackDataFilter):
return config.check(query=call)
@bot.message_handler(commands=['products'])
async def products_command_handler(message: types.Message):
await bot.send_message(message.chat.id, 'Products:', reply_markup=products_keyboard())
# Only product with field - product_id = 2
@bot.callback_query_handler(func=None, config=products_factory.filter(product_id='2'))
async def product_one_callback(call: types.CallbackQuery):
await bot.answer_callback_query(callback_query_id=call.id, text='Not available :(', show_alert=True)
# Any other products
@bot.callback_query_handler(func=None, config=products_factory.filter())
async def products_callback(call: types.CallbackQuery):
callback_data: dict = products_factory.parse(callback_data=call.data)
product_id = int(callback_data['product_id'])
product = PRODUCTS[product_id]
text = f"Product name: {product['name']}\n" \
f"Product price: {product['price']}"
await bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id,
text=text, reply_markup=back_keyboard())
@bot.callback_query_handler(func=lambda c: c.data == 'back')
async def back_callback(call: types.CallbackQuery):
await bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id,
text='Products:', reply_markup=products_keyboard())
bot.add_custom_filter(ProductsCallbackFilter())
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,12 @@
from telebot.async_telebot import AsyncTeleBot
import telebot
bot = AsyncTeleBot('TOKEN')
@bot.chat_join_request_handler()
async def make_some(message: telebot.types.ChatJoinRequest):
await bot.send_message(message.chat.id, 'I accepted a new user!')
await bot.approve_chat_join_request(message.chat.id, message.from_user.id)
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,34 @@
from telebot import types,util
from telebot.async_telebot import AsyncTeleBot
bot = AsyncTeleBot('TOKEN')
#chat_member_handler. When status changes, telegram gives update. check status from old_chat_member and new_chat_member.
@bot.chat_member_handler()
async def chat_m(message: types.ChatMemberUpdated):
old = message.old_chat_member
new = message.new_chat_member
if new.status == "member":
await bot.send_message(message.chat.id,"Hello {name}!".format(name=new.user.first_name)) # Welcome message
#if bot is added to group, this handler will work
@bot.my_chat_member_handler()
async def my_chat_m(message: types.ChatMemberUpdated):
old = message.old_chat_member
new = message.new_chat_member
if new.status == "member":
await bot.send_message(message.chat.id,"Somebody added me to group") # Welcome message, if bot was added to group
await bot.leave_chat(message.chat.id)
#content_Type_service is:
#'new_chat_members', 'left_chat_member', 'new_chat_title', 'new_chat_photo', 'delete_chat_photo', 'group_chat_created',
#'supergroup_chat_created', 'channel_chat_created', 'migrate_to_chat_id', 'migrate_from_chat_id', 'pinned_message',
#'proximity_alert_triggered', 'video_chat_scheduled', 'video_chat_started', 'video_chat_ended',
#'video_chat_participants_invited', 'message_auto_delete_timer_changed'
# this handler deletes service messages
@bot.message_handler(content_types=util.content_type_service)
async def delall(message: types.Message):
await bot.delete_message(message.chat.id,message.message_id)
import asyncio
asyncio.run(bot.polling(allowed_updates=util.update_types))

View File

@ -0,0 +1,27 @@
from telebot.async_telebot import AsyncTeleBot
from telebot.asyncio_handler_backends import ContinueHandling
bot = AsyncTeleBot('TOKEN')
@bot.message_handler(commands=['start'])
async def start(message):
await bot.send_message(message.chat.id, 'Hello World!')
return ContinueHandling()
@bot.message_handler(commands=['start'])
async def start2(message):
"""
This handler comes after the first one, but it will never be called.
But you can call it by returning ContinueHandling() in the first handler.
If you return ContinueHandling() in the first handler, the next
registered handler with appropriate filters will be called.
"""
await bot.send_message(message.chat.id, 'Hello World2!')
import asyncio
asyncio.run(bot.polling()) # just a reminder that infinity polling
# wraps polling into try/except block just as sync version,
# but you can use any of them because neither of them stops if you
# pass non_stop=True

View File

@ -0,0 +1,14 @@
from telebot.async_telebot import AsyncTeleBot
from telebot import asyncio_filters
bot = AsyncTeleBot('TOKEN')
# Handler
@bot.message_handler(chat_types=['supergroup'], is_chat_admin=True)
async def answer_for_admin(message):
await bot.send_message(message.chat.id,"hello my admin")
# Register filter
bot.add_custom_filter(asyncio_filters.IsAdminFilter(bot))
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,127 @@
# -*- coding: utf-8 -*-
"""
This Example will show you usage of TextFilter
In this example you will see how to use TextFilter
with (message_handler, callback_query_handler, poll_handler)
"""
import asyncio
from telebot import types
from telebot.async_telebot import AsyncTeleBot
from telebot.asyncio_filters import TextMatchFilter, TextFilter, IsReplyFilter
bot = AsyncTeleBot("")
@bot.message_handler(text=TextFilter(equals='hello'))
async def hello_handler(message: types.Message):
await bot.send_message(message.chat.id, message.text)
@bot.message_handler(text=TextFilter(equals='hello', ignore_case=True))
async def hello_handler_ignore_case(message: types.Message):
await bot.send_message(message.chat.id, message.text + ' ignore case')
@bot.message_handler(text=TextFilter(contains=['good', 'bad']))
async def contains_handler(message: types.Message):
await bot.send_message(message.chat.id, message.text)
@bot.message_handler(text=TextFilter(contains=['good', 'bad'], ignore_case=True))
async def contains_handler_ignore_case(message: types.Message):
await bot.send_message(message.chat.id, message.text + ' ignore case')
@bot.message_handler(text=TextFilter(starts_with='st')) # stArk, steve, stONE
async def starts_with_handler(message: types.Message):
await bot.send_message(message.chat.id, message.text)
@bot.message_handler(text=TextFilter(starts_with='st', ignore_case=True)) # STark, sTeve, stONE
async def starts_with_handler_ignore_case(message: types.Message):
await bot.send_message(message.chat.id, message.text + ' ignore case')
@bot.message_handler(text=TextFilter(ends_with='ay')) # wednesday, SUNday, WeekDay
async def ends_with_handler(message: types.Message):
await bot.send_message(message.chat.id, message.text)
@bot.message_handler(text=TextFilter(ends_with='ay', ignore_case=True)) # wednesdAY, sundAy, WeekdaY
async def ends_with_handler_ignore_case(message: types.Message):
await bot.send_message(message.chat.id, message.text + ' ignore case')
@bot.message_handler(text=TextFilter(equals='/callback'))
async def send_callback(message: types.Message):
keyboard = types.InlineKeyboardMarkup(
keyboard=[
[types.InlineKeyboardButton(text='callback data', callback_data='example')],
[types.InlineKeyboardButton(text='ignore case callback data', callback_data='ExAmPLe')]
]
)
await bot.send_message(message.chat.id, message.text, reply_markup=keyboard)
@bot.callback_query_handler(func=None, text=TextFilter(equals='example'))
async def callback_query_handler(call: types.CallbackQuery):
await bot.answer_callback_query(call.id, call.data, show_alert=True)
@bot.callback_query_handler(func=None, text=TextFilter(equals='example', ignore_case=True))
async def callback_query_handler_ignore_case(call: types.CallbackQuery):
await bot.answer_callback_query(call.id, call.data + " ignore case", show_alert=True)
@bot.message_handler(text=TextFilter(equals='/poll'))
async def send_poll(message: types.Message):
await bot.send_poll(message.chat.id, question='When do you prefer to work?', options=['Morning', 'Night'])
await bot.send_poll(message.chat.id, question='WHEN DO you pRefeR to worK?', options=['Morning', 'Night'])
@bot.poll_handler(func=None, text=TextFilter(equals='When do you prefer to work?'))
async def poll_question_handler(poll: types.Poll):
print(poll.question)
@bot.poll_handler(func=None, text=TextFilter(equals='When do you prefer to work?', ignore_case=True))
async def poll_question_handler_ignore_case(poll: types.Poll):
print(poll.question + ' ignore case')
# either hi or contains one of (привет, salom)
@bot.message_handler(text=TextFilter(equals="hi", contains=('привет', 'salom'), ignore_case=True))
async def multiple_patterns_handler(message: types.Message):
await bot.send_message(message.chat.id, message.text)
# starts with one of (mi, mea) for ex. minor, milk, meal, meat
@bot.message_handler(text=TextFilter(starts_with=['mi', 'mea'], ignore_case=True))
async def multiple_starts_with_handler(message: types.Message):
await bot.send_message(message.chat.id, message.text)
# ends with one of (es, on) for ex. Jones, Davies, Johnson, Wilson
@bot.message_handler(text=TextFilter(ends_with=['es', 'on'], ignore_case=True))
async def multiple_ends_with_handler(message: types.Message):
await bot.send_message(message.chat.id, message.text)
# !ban /ban .ban !бан /бан .бан
@bot.message_handler(is_reply=True,
text=TextFilter(starts_with=('!', '/', '.'), ends_with=['ban', 'бан'], ignore_case=True))
async def ban_command_handler(message: types.Message):
if len(message.text) == 4 and message.chat.type != 'private':
try:
await bot.ban_chat_member(message.chat.id, message.reply_to_message.from_user.id)
await bot.reply_to(message.reply_to_message, 'Banned.')
except Exception as err:
print(err.args)
return
if __name__ == '__main__':
bot.add_custom_filter(TextMatchFilter())
bot.add_custom_filter(IsReplyFilter())
asyncio.run(bot.polling())

View File

@ -0,0 +1,44 @@
from telebot.async_telebot import AsyncTeleBot
import telebot
bot = AsyncTeleBot('TOKEN')
# AdvancedCustomFilter is for list, string filter values
class MainFilter(telebot.asyncio_filters.AdvancedCustomFilter):
key='text'
@staticmethod
async def check(message, text):
return message.text in text
# SimpleCustomFilter is for boolean values, such as is_admin=True
class IsAdmin(telebot.asyncio_filters.SimpleCustomFilter):
key='is_admin'
@staticmethod
async def check(message: telebot.types.Message):
result = await bot.get_chat_member(message.chat.id,message.from_user.id)
return result.status in ['administrator','creator']
@bot.message_handler(is_admin=True, commands=['admin']) # Check if user is admin
async def admin_rep(message):
await bot.send_message(message.chat.id, "Hi admin")
@bot.message_handler(is_admin=False, commands=['admin']) # If user is not admin
async def not_admin(message):
await bot.send_message(message.chat.id, "You are not admin")
@bot.message_handler(text=['hi']) # Response to hi message
async def welcome_hi(message):
await bot.send_message(message.chat.id, 'You said hi')
@bot.message_handler(text=['bye']) # Response to bye message
async def bye_user(message):
await bot.send_message(message.chat.id, 'You said bye')
# Do not forget to register filters
bot.add_custom_filter(MainFilter())
bot.add_custom_filter(IsAdmin())
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,18 @@
from telebot.async_telebot import AsyncTeleBot
import telebot
bot = AsyncTeleBot('TOKEN')
# Chat id can be private or supergroups.
@bot.message_handler(chat_id=[12345678], commands=['admin']) # chat_id checks id corresponds to your list or not.
async def admin_rep(message):
await bot.send_message(message.chat.id, "You are allowed to use this command.")
@bot.message_handler(commands=['admin'])
async def not_admin(message):
await bot.send_message(message.chat.id, "You are not allowed to use this command")
# Do not forget to register
bot.add_custom_filter(telebot.asyncio_filters.ChatFilter())
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,23 @@
from telebot.async_telebot import AsyncTeleBot
import telebot
bot = AsyncTeleBot('TOKEN')
# Check if message is a reply
@bot.message_handler(is_reply=True)
async def start_filter(message):
await bot.send_message(message.chat.id, "Looks like you replied to my message.")
# Check if message was forwarded
@bot.message_handler(is_forwarded=True)
async def text_filter(message):
await bot.send_message(message.chat.id, "I do not accept forwarded messages!")
# Do not forget to register filters
bot.add_custom_filter(telebot.asyncio_filters.IsReplyFilter())
bot.add_custom_filter(telebot.asyncio_filters.ForwardFilter())
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,21 @@
from telebot.async_telebot import AsyncTeleBot
import telebot
bot = AsyncTeleBot('TOKEN')
# Check if message starts with @admin tag
@bot.message_handler(text_startswith="@admin")
async def start_filter(message):
await bot.send_message(message.chat.id, "Looks like you are calling admin, wait...")
# Check if text is hi or hello
@bot.message_handler(text=['hi','hello'])
async def text_filter(message):
await bot.send_message(message.chat.id, "Hi, {name}!".format(name=message.from_user.first_name))
# Do not forget to register filters
bot.add_custom_filter(telebot.asyncio_filters.TextMatchFilter())
bot.add_custom_filter(telebot.asyncio_filters.TextStartsFilter())
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,91 @@
from telebot import asyncio_filters
from telebot.async_telebot import AsyncTeleBot
# list of storages, you can use any storage
from telebot.asyncio_storage import StateMemoryStorage
# new feature for states.
from telebot.asyncio_handler_backends import State, StatesGroup
# default state storage is statememorystorage
bot = AsyncTeleBot('TOKEN', state_storage=StateMemoryStorage())
# Just create different statesgroup
class MyStates(StatesGroup):
name = State() # statesgroup should contain states
surname = State()
age = State()
# set_state -> sets a new state
# delete_state -> delets state if exists
# get_state -> returns state if exists
@bot.message_handler(commands=['start'])
async def start_ex(message):
"""
Start command. Here we are starting state
"""
await bot.set_state(message.from_user.id, MyStates.name, message.chat.id)
await bot.send_message(message.chat.id, 'Hi, write me a name')
@bot.message_handler(state="*", commands='cancel')
async def any_state(message):
"""
Cancel state
"""
await bot.send_message(message.chat.id, "Your state was cancelled.")
await bot.delete_state(message.from_user.id, message.chat.id)
@bot.message_handler(state=MyStates.name)
async def name_get(message):
"""
State 1. Will process when user's state is MyStates.name.
"""
await bot.send_message(message.chat.id, f'Now write me a surname')
await bot.set_state(message.from_user.id, MyStates.surname, message.chat.id)
async with bot.retrieve_data(message.from_user.id, message.chat.id) as data:
data['name'] = message.text
@bot.message_handler(state=MyStates.surname)
async def ask_age(message):
"""
State 2. Will process when user's state is MyStates.surname.
"""
await bot.send_message(message.chat.id, "What is your age?")
await bot.set_state(message.from_user.id, MyStates.age, message.chat.id)
async with bot.retrieve_data(message.from_user.id, message.chat.id) as data:
data['surname'] = message.text
# result
@bot.message_handler(state=MyStates.age, is_digit=True)
async def ready_for_answer(message):
"""
State 3. Will process when user's state is MyStates.age.
"""
async with bot.retrieve_data(message.from_user.id, message.chat.id) as data:
await bot.send_message(message.chat.id, "Ready, take a look:\n<b>Name: {name}\nSurname: {surname}\nAge: {age}</b>".format(name=data['name'], surname=data['surname'], age=message.text), parse_mode="html")
await bot.delete_state(message.from_user.id, message.chat.id)
#incorrect number
@bot.message_handler(state=MyStates.age, is_digit=False)
async def age_incorrect(message):
"""
Will process for wrong input when state is MyState.age
"""
await bot.send_message(message.chat.id, 'Looks like you are submitting a string in the field age. Please enter a number')
# register filters
bot.add_custom_filter(asyncio_filters.StateFilter(bot))
bot.add_custom_filter(asyncio_filters.IsDigitFilter())
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,28 @@
#!/usr/bin/python
# This is a simple echo bot using the decorator mechanism.
# It echoes any incoming text messages.
from telebot.async_telebot import AsyncTeleBot
bot = AsyncTeleBot('TOKEN')
# Handle '/start' and '/help'
@bot.message_handler(commands=['help', 'start'])
async def send_welcome(message):
await bot.reply_to(message, """\
Hi there, I am EchoBot.
I am here to echo your kind words back to you. Just say anything nice and I'll say the exact same thing to you!\
""")
# Handle all other messages with content_type 'text' (content_types defaults to ['text'])
@bot.message_handler(func=lambda message: True)
async def echo_message(message):
await bot.reply_to(message, message.text)
import asyncio
# only for versions 4.7.0+
asyncio.run(bot.polling(restart_on_change=True))

View File

@ -0,0 +1,21 @@
import telebot
from telebot.async_telebot import AsyncTeleBot
bot = AsyncTeleBot('TOKEN')
@bot.message_handler(content_types=['photo'])
async def new_message(message: telebot.types.Message):
result_message = await bot.send_message(message.chat.id, '<i>Downloading your photo...</i>', parse_mode='HTML', disable_web_page_preview=True)
file_path = await bot.get_file(message.photo[-1].file_id)
downloaded_file = await bot.download_file(file_path.file_path)
with open('file.jpg', 'wb') as new_file:
new_file.write(downloaded_file)
await bot.edit_message_text(chat_id=message.chat.id, message_id=result_message.id, text='<i>Done!</i>', parse_mode='HTML')
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,27 @@
#!/usr/bin/python
# This is a simple echo bot using the decorator mechanism.
# It echoes any incoming text messages.
from telebot.async_telebot import AsyncTeleBot
bot = AsyncTeleBot('TOKEN')
# Handle '/start' and '/help'
@bot.message_handler(commands=['help', 'start'])
async def send_welcome(message):
await bot.reply_to(message, """\
Hi there, I am EchoBot.
I am here to echo your kind words back to you. Just say anything nice and I'll say the exact same thing to you!\
""")
# Handle all other messages with content_type 'text' (content_types defaults to ['text'])
@bot.message_handler(func=lambda message: True)
async def echo_message(message):
await bot.reply_to(message, message.text)
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,28 @@
import telebot
from telebot.async_telebot import AsyncTeleBot
import logging
logger = telebot.logger
telebot.logger.setLevel(logging.DEBUG) # Outputs debug messages to console.
class ExceptionHandler(telebot.ExceptionHandler):
def handle(self, exception):
logger.error(exception)
bot = AsyncTeleBot('TOKEN',exception_handler=ExceptionHandler())
@bot.message_handler(commands=['photo'])
async def photo_send(message: telebot.types.Message):
await bot.send_message(message.chat.id, 'Hi, this is an example of exception handlers.')
raise Exception('test') # Exception goes to ExceptionHandler if it is set
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,54 @@
from telebot.async_telebot import AsyncTeleBot
from telebot import formatting
bot = AsyncTeleBot('token')
@bot.message_handler(commands=['start'])
async def start_message(message):
await bot.send_message(
message.chat.id,
# function which connects all strings
formatting.format_text(
formatting.mbold(message.from_user.first_name),
formatting.mitalic(message.from_user.first_name),
formatting.munderline(message.from_user.first_name),
formatting.mstrikethrough(message.from_user.first_name),
formatting.mcode(message.from_user.first_name),
separator=" " # separator separates all strings
),
parse_mode='MarkdownV2'
)
# just a bold text using markdownv2
await bot.send_message(
message.chat.id,
formatting.mbold(message.from_user.first_name),
parse_mode='MarkdownV2'
)
# html
await bot.send_message(
message.chat.id,
formatting.format_text(
formatting.hbold(message.from_user.first_name),
formatting.hitalic(message.from_user.first_name),
formatting.hunderline(message.from_user.first_name),
formatting.hstrikethrough(message.from_user.first_name),
formatting.hcode(message.from_user.first_name),
# hide_link is only for html
formatting.hide_link('https://telegra.ph/file/c158e3a6e2a26a160b253.jpg'),
separator=" "
),
parse_mode='HTML'
)
# just a bold text in html
await bot.send_message(
message.chat.id,
formatting.hbold(message.from_user.first_name),
parse_mode='HTML'
)
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,38 @@
# Just a little example of middleware handlers
from telebot.asyncio_handler_backends import BaseMiddleware, CancelUpdate
from telebot.async_telebot import AsyncTeleBot
bot = AsyncTeleBot('TOKEN')
class SimpleMiddleware(BaseMiddleware):
def __init__(self, limit) -> None:
self.last_time = {}
self.limit = limit
self.update_types = ['message']
# Always specify update types, otherwise middlewares won't work
async def pre_process(self, message, data):
if not message.from_user.id in self.last_time:
# User is not in a dict, so lets add and cancel this function
self.last_time[message.from_user.id] = message.date
return
if message.date - self.last_time[message.from_user.id] < self.limit:
# User is flooding
await bot.send_message(message.chat.id, 'You are making request too often')
return CancelUpdate()
self.last_time[message.from_user.id] = message.date
async def post_process(self, message, data, exception):
pass
bot.setup_middleware(SimpleMiddleware(2))
@bot.message_handler(commands=['start'])
async def start(message):
await bot.send_message(message.chat.id, 'Hello!')
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,49 @@
#!/usr/bin/python
# This example shows how to implement i18n (internationalization) l10n (localization) to create
# multi-language bots with middleware handler.
#
# Also, you could check language code in handler itself too.
# But this example just to show the work of middlewares.
import telebot
from telebot.async_telebot import AsyncTeleBot
from telebot import asyncio_handler_backends
import logging
logger = telebot.logger
telebot.logger.setLevel(logging.DEBUG) # Outputs debug messages to console.
TRANSLATIONS = {
'hello': {
'en': 'hello',
'ru': 'привет',
'uz': 'salom'
}
}
bot = AsyncTeleBot('TOKEN')
class LanguageMiddleware(asyncio_handler_backends.BaseMiddleware):
def __init__(self):
self.update_types = ['message'] # Update types that will be handled by this middleware.
async def pre_process(self, message, data):
data['response'] = TRANSLATIONS['hello'][message.from_user.language_code]
async def post_process(self, message, data, exception):
if exception: # You can get exception occured in handler.
logger.exception(str(exception))
bot.setup_middleware(LanguageMiddleware()) # do not forget to setup
@bot.message_handler(commands=['start'])
async def start(message, data: dict):
# you can get the data in handler too.
# Not necessary to create data parameter in handler function.
await bot.send_message(message.chat.id, data['response'])
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,120 @@
import contextvars
import gettext
import os
from telebot.asyncio_handler_backends import BaseMiddleware
try:
from babel.support import LazyProxy
babel_imported = True
except ImportError:
babel_imported = False
class I18N(BaseMiddleware):
"""
This middleware provides high-level tool for internationalization
It is based on gettext util.
"""
context_lang = contextvars.ContextVar('language', default=None)
def __init__(self, translations_path, domain_name: str):
super().__init__()
self.update_types = self.process_update_types()
self.path = translations_path
self.domain = domain_name
self.translations = self.find_translations()
@property
def available_translations(self):
return list(self.translations)
def gettext(self, text: str, lang: str = None):
"""
Singular translations
"""
if lang is None:
lang = self.context_lang.get()
if lang not in self.translations:
return text
translator = self.translations[lang]
return translator.gettext(text)
def ngettext(self, singular: str, plural: str, lang: str = None, n=1):
"""
Plural translations
"""
if lang is None:
lang = self.context_lang.get()
if lang not in self.translations:
if n == 1:
return singular
return plural
translator = self.translations[lang]
return translator.ngettext(singular, plural, n)
def lazy_gettext(self, text: str, lang: str = None):
if not babel_imported:
raise RuntimeError('babel module is not imported. Check that you installed it.')
return LazyProxy(self.gettext, text, lang, enable_cache=False)
def lazy_ngettext(self, singular: str, plural: str, lang: str = None, n=1):
if not babel_imported:
raise RuntimeError('babel module is not imported. Check that you installed it.')
return LazyProxy(self.ngettext, singular, plural, lang, n, enable_cache=False)
async def get_user_language(self, obj):
"""
You need to override this method and return user language
"""
raise NotImplementedError
def process_update_types(self) -> list:
"""
You need to override this method and return any update types which you want to be processed
"""
raise NotImplementedError
async def pre_process(self, message, data):
"""
context language variable will be set each time when update from 'process_update_types' comes
value is the result of 'get_user_language' method
"""
self.context_lang.set(await self.get_user_language(obj=message))
async def post_process(self, message, data, exception):
pass
def find_translations(self):
"""
Looks for translations with passed 'domain' in passed 'path'
"""
if not os.path.exists(self.path):
raise RuntimeError(f"Translations directory by path: {self.path!r} was not found")
result = {}
for name in os.listdir(self.path):
translations_path = os.path.join(self.path, name, 'LC_MESSAGES')
if not os.path.isdir(translations_path):
continue
po_file = os.path.join(translations_path, self.domain + '.po')
mo_file = po_file[:-2] + 'mo'
if os.path.isfile(po_file) and not os.path.isfile(mo_file):
raise FileNotFoundError(f"Translations for: {name!r} were not compiled!")
with open(mo_file, 'rb') as file:
result[name] = gettext.GNUTranslations(file)
return result

View File

@ -0,0 +1,34 @@
from telebot.types import InlineKeyboardMarkup, InlineKeyboardButton, ReplyKeyboardMarkup, KeyboardButton
def languages_keyboard():
return InlineKeyboardMarkup(
keyboard=[
[
InlineKeyboardButton(text="English", callback_data='en'),
InlineKeyboardButton(text="Русский", callback_data='ru'),
InlineKeyboardButton(text="O'zbekcha", callback_data='uz_Latn')
]
]
)
def clicker_keyboard(_):
return InlineKeyboardMarkup(
keyboard=[
[
InlineKeyboardButton(text=_("click"), callback_data='click'),
]
]
)
def menu_keyboard(_):
keyboard = ReplyKeyboardMarkup(resize_keyboard=True)
keyboard.add(
KeyboardButton(text=_("My user id")),
KeyboardButton(text=_("My user name")),
KeyboardButton(text=_("My first name"))
)
return keyboard

View File

@ -0,0 +1,81 @@
# English translations for PROJECT.
# Copyright (C) 2022 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2022-02-19 18:37+0500\n"
"PO-Revision-Date: 2022-02-18 16:22+0500\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en\n"
"Language-Team: en <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: keyboards.py:20
msgid "click"
msgstr ""
#: keyboards.py:29
msgid "My user id"
msgstr ""
#: keyboards.py:30
msgid "My user name"
msgstr ""
#: keyboards.py:31
msgid "My first name"
msgstr ""
#: main.py:97
msgid ""
"Hello, {user_fist_name}!\n"
"This is the example of multilanguage bot.\n"
"Available commands:\n"
"\n"
"/lang - change your language\n"
"/plural - pluralization example\n"
"/menu - text menu example"
msgstr ""
#: main.py:121
msgid "Language has been changed"
msgstr ""
#: main.py:130 main.py:150
#, fuzzy
msgid "You have {number} click"
msgid_plural "You have {number} clicks"
msgstr[0] ""
msgstr[1] ""
#: main.py:135 main.py:155
msgid ""
"This is clicker.\n"
"\n"
msgstr ""
#: main.py:163
msgid "This is ReplyKeyboardMarkup menu example in multilanguage bot."
msgstr ""
#: main.py:203
msgid "Seems you confused language"
msgstr ""
#~ msgid ""
#~ "Hello, {user_fist_name}!\n"
#~ "This is the example of multilanguage bot.\n"
#~ "Available commands:\n"
#~ "\n"
#~ "/lang - change your language\n"
#~ "/plural - pluralization example"
#~ msgstr ""

View File

@ -0,0 +1,82 @@
# Russian translations for PROJECT.
# Copyright (C) 2022 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2022-02-19 18:37+0500\n"
"PO-Revision-Date: 2022-02-18 16:22+0500\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: ru\n"
"Language-Team: ru <LL@li.org>\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: keyboards.py:20
msgid "click"
msgstr "Клик"
#: keyboards.py:29
msgid "My user id"
msgstr "Мой user id"
#: keyboards.py:30
msgid "My user name"
msgstr "Мой user name"
#: keyboards.py:31
msgid "My first name"
msgstr "Мой first name"
#: main.py:97
msgid ""
"Hello, {user_fist_name}!\n"
"This is the example of multilanguage bot.\n"
"Available commands:\n"
"\n"
"/lang - change your language\n"
"/plural - pluralization example\n"
"/menu - text menu example"
msgstr ""
"Привет, {user_fist_name}!\n"
"Это пример мультиязычного бота.\n"
"Доступные команды:\n"
"\n"
"/lang - изменить язык\n"
"/plural - пример плюрализации\n"
"/menu - Пример текстового меню"
#: main.py:121
msgid "Language has been changed"
msgstr "Язык был сменён"
#: main.py:130 main.py:150
msgid "You have {number} click"
msgid_plural "You have {number} clicks"
msgstr[0] "У вас {number} клик"
msgstr[1] "У вас {number} клика"
msgstr[2] "У вас {number} кликов"
#: main.py:135 main.py:155
msgid ""
"This is clicker.\n"
"\n"
msgstr ""
"Это кликер.\n"
"\n"
#: main.py:163
msgid "This is ReplyKeyboardMarkup menu example in multilanguage bot."
msgstr "Это пример ReplyKeyboardMarkup меню в мультиязычном боте."
#: main.py:203
msgid "Seems you confused language"
msgstr "Кажется, вы перепутали язык"

View File

@ -0,0 +1,80 @@
# Uzbek (Latin) translations for PROJECT.
# Copyright (C) 2022 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2022-02-19 18:37+0500\n"
"PO-Revision-Date: 2022-02-18 16:22+0500\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: uz_Latn\n"
"Language-Team: uz_Latn <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#: keyboards.py:20
msgid "click"
msgstr "clik"
#: keyboards.py:29
msgid "My user id"
msgstr "Mani user id"
#: keyboards.py:30
msgid "My user name"
msgstr "Mani user name"
#: keyboards.py:31
msgid "My first name"
msgstr "Mani first name"
#: main.py:97
msgid ""
"Hello, {user_fist_name}!\n"
"This is the example of multilanguage bot.\n"
"Available commands:\n"
"\n"
"/lang - change your language\n"
"/plural - pluralization example\n"
"/menu - text menu example"
msgstr ""
"Salom, {user_fist_name}!\n"
"Bu multilanguage bot misoli.\n"
"Mavjud buyruqlar:\n"
"\n"
"/lang - tilni ozgartirish\n"
"/plural - pluralizatsiya misoli\n"
"/menu - text menu misoli"
#: main.py:121
msgid "Language has been changed"
msgstr "Til ozgartirildi"
#: main.py:130 main.py:150
msgid "You have {number} click"
msgid_plural "You have {number} clicks"
msgstr[0] "Sizda {number}ta clik"
msgstr[1] "Sizda {number}ta clik"
#: main.py:135 main.py:155
msgid ""
"This is clicker.\n"
"\n"
msgstr ""
"Bu clicker.\n"
"\n"
#: main.py:163
msgid "This is ReplyKeyboardMarkup menu example in multilanguage bot."
msgstr "Bu multilanguage bot da replykeyboardmarkup menyu misoli."
#: main.py:203
msgid "Seems you confused language"
msgstr "Tilni adashtirdiz"

View File

@ -0,0 +1,214 @@
"""
In this example you will learn how to adapt your bot to different languages
Using built-in middleware I18N.
You need to install babel package 'https://pypi.org/project/Babel/'
Babel provides a command-line interface for working with message catalogs
After installing babel package you have a script called 'pybabel'
Too see all the commands open terminal and type 'pybabel --help'
Full description for pybabel commands can be found here: 'https://babel.pocoo.org/en/latest/cmdline.html'
Create a directory 'locales' where our translations will be stored
First we need to extract texts:
pybabel extract -o locales/{domain_name}.pot --input-dirs .
{domain_name}.pot - is the file where all translations are saved
The name of this file should be the same as domain which you pass to I18N class
In this example domain_name will be 'messages'
For gettext (singular texts) we use '_' alias and it works perfect
You may also you some alias for ngettext (plural texts) but you can face with a problem that
your plural texts are not being extracted
That is because by default 'pybabel extract' recognizes the following keywords:
_, gettext, ngettext, ugettext, ungettext, dgettext, dngettext, N_
To add your own keyword you can use '-k' flag
In this example for 'ngettext' i will assign double underscore alias '__'
Full command with pluralization support will look so:
pybabel extract -o locales/{domain_name}.pot -k __:1,2 --input-dirs .
Then create directories with translations (get list of all locales: 'pybabel --list-locales'):
pybabel init -i locales/{domain_name}.pot -d locales -l en
pybabel init -i locales/{domain_name}.pot -d locales -l ru
pybabel init -i locales/{domain_name}.pot -d locales -l uz_Latn
Now you can translate the texts located in locales/{language}/LC_MESSAGES/{domain_name}.po
After you translated all the texts you need to compile .po files:
pybabel compile -d locales
When you delete/update your texts you also need to update them in .po files:
pybabel extract -o locales/{domain_name}.pot -k __:1,2 --input-dirs .
pybabel update -i locales/{domain_name}.pot -d locales
- translate
pybabel compile -d locales
If you have any exceptions check:
- you have installed babel
- translations are ready, so you just compiled it
- in the commands above you replaced {domain_name} to messages
- you are writing commands from correct path in terminal
"""
import asyncio
from typing import Union
import keyboards
from telebot import types
from telebot.async_telebot import AsyncTeleBot
from telebot.asyncio_filters import TextMatchFilter, TextFilter
from i18n_base_middleware import I18N
from telebot.asyncio_storage.memory_storage import StateMemoryStorage
class I18NMiddleware(I18N):
def process_update_types(self) -> list:
"""
Here you need to return a list of update types which you want to be processed
"""
return ['message', 'callback_query']
async def get_user_language(self, obj: Union[types.Message, types.CallbackQuery]):
"""
This method is called when new update comes (only updates which you return in 'process_update_types' method)
Returned language will be used in 'pre_process' method of parent class
Returned language will be set to context language variable.
If you need to get translation with user's actual language you don't have to pass it manually
It will be automatically passed from context language value.
However if you need some other language you can always pass it.
"""
user_id = obj.from_user.id
if user_id not in users_lang:
users_lang[user_id] = 'en'
return users_lang[user_id]
storage = StateMemoryStorage()
bot = AsyncTeleBot("", state_storage=storage)
i18n = I18NMiddleware(translations_path='locales', domain_name='messages')
_ = i18n.gettext # for singular translations
__ = i18n.ngettext # for plural translations
# These are example storages, do not use it in a production development
users_lang = {}
users_clicks = {}
@bot.message_handler(commands='start')
async def start_handler(message: types.Message):
text = _("Hello, {user_fist_name}!\n"
"This is the example of multilanguage bot.\n"
"Available commands:\n\n"
"/lang - change your language\n"
"/plural - pluralization example\n"
"/menu - text menu example")
# remember don't use f string for interpolation, use .format method instead
text = text.format(user_fist_name=message.from_user.first_name)
await bot.send_message(message.from_user.id, text)
@bot.message_handler(commands='lang')
async def change_language_handler(message: types.Message):
await bot.send_message(message.chat.id, "Choose language\nВыберите язык\nTilni tanlang",
reply_markup=keyboards.languages_keyboard())
@bot.callback_query_handler(func=None, text=TextFilter(contains=['en', 'ru', 'uz_Latn']))
async def language_handler(call: types.CallbackQuery):
lang = call.data
users_lang[call.from_user.id] = lang
# When you changed user language, you have to pass it manually beacause it is not changed in context
await bot.edit_message_text(_("Language has been changed", lang=lang), call.from_user.id, call.message.id)
@bot.message_handler(commands='plural')
async def pluralization_handler(message: types.Message):
if not users_clicks.get(message.from_user.id):
users_clicks[message.from_user.id] = 0
clicks = users_clicks[message.from_user.id]
text = __(
singular="You have {number} click",
plural="You have {number} clicks",
n=clicks
)
text = _("This is clicker.\n\n") + text.format(number=clicks)
await bot.send_message(message.chat.id, text, reply_markup=keyboards.clicker_keyboard(_))
@bot.callback_query_handler(func=None, text=TextFilter(equals='click'))
async def click_handler(call: types.CallbackQuery):
if not users_clicks.get(call.from_user.id):
users_clicks[call.from_user.id] = 1
else:
users_clicks[call.from_user.id] += 1
clicks = users_clicks[call.from_user.id]
text = __(
singular="You have {number} click",
plural="You have {number} clicks",
n=clicks
)
text = _("This is clicker.\n\n") + text.format(number=clicks)
await bot.edit_message_text(text, call.from_user.id, call.message.message_id,
reply_markup=keyboards.clicker_keyboard(_))
@bot.message_handler(commands='menu')
async def menu_handler(message: types.Message):
text = _("This is ReplyKeyboardMarkup menu example in multilanguage bot.")
await bot.send_message(message.chat.id, text, reply_markup=keyboards.menu_keyboard(_))
# For lazy tranlations
# lazy gettext is used when you don't know user's locale
# It can be used for example to handle text buttons in multilanguage bot
# The actual translation will be delayed until update comes and context language is set
l_ = i18n.lazy_gettext
# Handlers below will handle text according to user's language
@bot.message_handler(text=l_("My user id"))
async def return_user_id(message: types.Message):
await bot.send_message(message.chat.id, str(message.from_user.id))
@bot.message_handler(text=l_("My user name"))
async def return_user_id(message: types.Message):
username = message.from_user.username
if not username:
username = '-'
await bot.send_message(message.chat.id, username)
# You can make it case insensitive
@bot.message_handler(text=TextFilter(equals=l_("My first name"), ignore_case=True))
async def return_user_id(message: types.Message):
await bot.send_message(message.chat.id, message.from_user.first_name)
all_menu_texts = []
for language in i18n.available_translations:
for menu_text in ("My user id", "My user name", "My first name"):
all_menu_texts.append(_(menu_text, language))
# When user confused language. (handles all menu buttons texts)
@bot.message_handler(text=TextFilter(contains=all_menu_texts, ignore_case=True))
async def missed_message(message: types.Message):
await bot.send_message(message.chat.id, _("Seems you confused language"), reply_markup=keyboards.menu_keyboard(_))
if __name__ == '__main__':
bot.setup_middleware(i18n)
bot.add_custom_filter(TextMatchFilter())
asyncio.run(bot.infinity_polling())

View File

@ -0,0 +1,17 @@
You probably have seen bots which allow you to send them token of your bot and then handle updates providing some functionality for your bot.
<br>
This type of bots are called <b>multibots</b>. They are created using webhooks.
<br>
This is the example of simple multibot.<br>
In order to reproduce this example you need to have <b>domain and ssl connection</b>.
<br>
If you have, go to config.py and specify your data.
<br>
There is also file called <b>nginx_conf.conf</b>, we will use nginx as proxy-server and this file is example nginx.conf file.
<br>
Make sure that server_name and port are the same in both config and nginx_conf
<br>
(nginx_conf.conf IS NOT complete, you would probably use tools like certbot to add ssl connection to it)
<br>
Also, in this example I used dictionary as tokens storage, but in production you should use database so that you can re-set webhooks in case bot restarts.

View File

@ -0,0 +1,6 @@
MAIN_BOT_TOKEN = "your_main_bot_token"
WEBHOOK_HOST = "your_domain.com"
WEBHOOK_PATH = "telegram_webhook"
WEBAPP_HOST = "0.0.0.0"
WEBAPP_PORT = 3500

View File

@ -0,0 +1,15 @@
from telebot.async_telebot import AsyncTeleBot
from telebot import types
async def hello_handler(message: types.Message, bot: AsyncTeleBot):
await bot.send_message(message.chat.id, "Hi :)")
async def echo_handler(message: types.Message, bot: AsyncTeleBot):
await bot.send_message(message.chat.id, message.text)
def register_handlers(bot: AsyncTeleBot):
bot.register_message_handler(hello_handler, func=lambda message: message.text == 'Hello', pass_bot=True)
bot.register_message_handler(echo_handler, pass_bot=True)

View File

@ -0,0 +1,56 @@
import asyncio
from aiohttp import web
from telebot import types, util
from telebot.async_telebot import AsyncTeleBot
from handlers import register_handlers
import config
main_bot = AsyncTeleBot(config.MAIN_BOT_TOKEN)
app = web.Application()
tokens = {config.MAIN_BOT_TOKEN: True}
async def webhook(request):
token = request.match_info.get('token')
if not tokens.get(token):
return web.Response(status=404)
if request.headers.get('content-type') != 'application/json':
return web.Response(status=403)
json_string = await request.json()
update = types.Update.de_json(json_string)
if token == main_bot.token:
await main_bot.process_new_updates([update])
return web.Response()
from_update_bot = AsyncTeleBot(token)
register_handlers(from_update_bot)
await from_update_bot.process_new_updates([update])
return web.Response()
app.router.add_post("/" + config.WEBHOOK_PATH + "/{token}", webhook)
@main_bot.message_handler(commands=['add_bot'])
async def add_bot(message: types.Message):
token = util.extract_arguments(message.text)
tokens[token] = True
new_bot = AsyncTeleBot(token)
await new_bot.delete_webhook()
await new_bot.set_webhook(f"{config.WEBHOOK_HOST}/{config.WEBHOOK_PATH}/{token}")
await new_bot.send_message(message.chat.id, "Webhook was set.")
async def main():
await main_bot.delete_webhook()
await main_bot.set_webhook(f"{config.WEBHOOK_HOST}/{config.WEBHOOK_PATH}/{config.MAIN_BOT_TOKEN}")
web.run_app(app, host=config.WEBAPP_HOST, port=config.WEBAPP_PORT)
if __name__ == '__main__':
asyncio.run(main())

View File

@ -0,0 +1,8 @@
server {
server_name your_domain.com;
location /telegram_webhook/ {
proxy_pass http://localhost:3500;
}
}

View File

@ -0,0 +1,20 @@
from telebot.async_telebot import AsyncTeleBot
bot = AsyncTeleBot('TOKEN')
async def start_executor(message):
await bot.send_message(message.chat.id, 'Hello!')
bot.register_message_handler(start_executor, commands=['start']) # Start command executor
# See also
# bot.register_callback_query_handler(*args, **kwargs)
# bot.register_channel_post_handler(*args, **kwargs)
# bot.register_chat_member_handler(*args, **kwargs)
# bot.register_inline_handler(*args, **kwargs)
# bot.register_my_chat_member_handler(*args, **kwargs)
# bot.register_edited_message_handler(*args, **kwargs)
# And other functions..
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,29 @@
import telebot
from telebot.async_telebot import AsyncTeleBot
bot = AsyncTeleBot('TOKEN')
@bot.message_handler(commands=['photo'])
async def photo_send(message: telebot.types.Message):
with open('test.png', 'rb') as new_file:
await bot.send_photo(message.chat.id, new_file)
@bot.message_handler(commands=['document'])
async def document_send(message: telebot.types.Message):
with open('test.docx', 'rb') as new_file:
await bot.send_document(message.chat.id, new_file)
@bot.message_handler(commands=['photos'])
async def photos_send(message: telebot.types.Message):
with open('test.png', 'rb') as new_file, open('test2.png', 'rb') as new_file2:
await bot.send_media_group(message.chat.id, [telebot.types.InputMediaPhoto(new_file), telebot.types.InputMediaPhoto(new_file2)])
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,35 @@
#!/usr/bin/python
# This is a set_my_commands example.
# Press on [/] button in telegram client.
# Important, to update the command menu, be sure to exit the chat with the bot and log in again
# Important, command for chat_id and for group have a higher priority than for all
import asyncio
import telebot
from telebot.async_telebot import AsyncTeleBot
API_TOKEN = '<api_token>'
bot = AsyncTeleBot(API_TOKEN)
async def main():
# use in for delete with the necessary scope and language_code if necessary
await bot.delete_my_commands(scope=None, language_code=None)
await bot.set_my_commands(
commands=[
telebot.types.BotCommand("command1", "command1 description"),
telebot.types.BotCommand("command2", "command2 description")
],
# scope=telebot.types.BotCommandScopeChat(12345678) # use for personal command menu for users
# scope=telebot.types.BotCommandScopeAllPrivateChats() # use for all private chats
)
cmd = await bot.get_my_commands(scope=None, language_code=None)
print([c.to_json() for c in cmd])
if __name__ == '__main__':
asyncio.run(main())

View File

@ -0,0 +1,15 @@
from telebot.async_telebot import AsyncTeleBot
bot = AsyncTeleBot('TOKEN')
@bot.message_handler(commands=['start', 'help'])
async def send_welcome(message):
await bot.reply_to(message, "Howdy, how are you doing?")
@bot.message_handler(func=lambda message: True)
async def echo_all(message):
await bot.reply_to(message, message.text)
import asyncio
asyncio.run(bot.polling(skip_pending=True)) # to skip updates

View File

@ -0,0 +1,52 @@
#!/usr/bin/python3
# This is a simple bot with schedule timer
# https://github.com/ibrb/python-aioschedule
# https://schedule.readthedocs.io
import asyncio
import aioschedule
from telebot.async_telebot import AsyncTeleBot
API_TOKEN = '<api_token>'
bot = AsyncTeleBot(API_TOKEN)
async def beep(chat_id) -> None:
"""Send the beep message."""
await bot.send_message(chat_id, text='Beep!')
aioschedule.clear(chat_id) # return schedule.CancelJob not working in aioschedule use tag for delete
@bot.message_handler(commands=['help', 'start'])
async def send_welcome(message):
await bot.reply_to(message, "Hi! Use /set <seconds> to set a timer")
@bot.message_handler(commands=['set'])
async def set_timer(message):
args = message.text.split()
if len(args) > 1 and args[1].isdigit():
sec = int(args[1])
aioschedule.every(sec).seconds.do(beep, message.chat.id).tag(message.chat.id)
else:
await bot.reply_to(message, 'Usage: /set <seconds>')
@bot.message_handler(commands=['unset'])
def unset_timer(message):
aioschedule.clean(message.chat.id)
async def scheduler():
while True:
await aioschedule.run_pending()
await asyncio.sleep(1)
async def main():
await asyncio.gather(bot.infinity_polling(), scheduler())
if __name__ == '__main__':
asyncio.run(main())

View File

@ -0,0 +1,16 @@
from telebot.async_telebot import AsyncTeleBot
# Update listeners are functions that are called when any update is received.
bot = AsyncTeleBot(token='TOKEN')
async def update_listener(messages):
for message in messages:
if message.text == '/start':
await bot.send_message(message.chat.id, 'Hello!')
bot.set_update_listener(update_listener)
import asyncio
asyncio.run(bot.polling())

View File

@ -0,0 +1,93 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is an async echo bot using decorators and webhook with aiohttp
# It echoes any incoming text messages and does not use the polling method.
import logging
import ssl
import asyncio
from aiohttp import web
import telebot
from telebot.async_telebot import AsyncTeleBot
API_TOKEN = '<api_token>'
WEBHOOK_HOST = '<ip/host where the bot is running>'
WEBHOOK_PORT = 8443 # 443, 80, 88 or 8443 (port need to be 'open')
WEBHOOK_LISTEN = '0.0.0.0' # In some VPS you may need to put here the IP addr
WEBHOOK_SSL_CERT = './webhook_cert.pem' # Path to the ssl certificate
WEBHOOK_SSL_PRIV = './webhook_pkey.pem' # Path to the ssl private key
WEBHOOK_URL_BASE = "https://{}:{}".format(WEBHOOK_HOST, WEBHOOK_PORT)
WEBHOOK_URL_PATH = "/{}/".format(API_TOKEN)
# Quick'n'dirty SSL certificate generation:
#
# openssl genrsa -out webhook_pkey.pem 2048
# openssl req -new -x509 -days 3650 -key webhook_pkey.pem -out webhook_cert.pem
#
# When asked for "Common Name (e.g. server FQDN or YOUR name)" you should reply
# with the same value in you put in WEBHOOK_HOST
logger = telebot.logger
telebot.logger.setLevel(logging.INFO)
bot = AsyncTeleBot(API_TOKEN)
# Process webhook calls
async def handle(request):
if request.match_info.get('token') == bot.token:
request_body_dict = await request.json()
update = telebot.types.Update.de_json(request_body_dict)
asyncio.ensure_future(bot.process_new_updates([update]))
return web.Response()
else:
return web.Response(status=403)
# Handle '/start' and '/help'
@bot.message_handler(commands=['help', 'start'])
async def send_welcome(message):
await bot.reply_to(message,
("Hi there, I am EchoBot.\n"
"I am here to echo your kind words back to you."))
# Handle all other messages
@bot.message_handler(func=lambda message: True, content_types=['text'])
async def echo_message(message):
await bot.reply_to(message, message.text)
# Remove webhook and closing session before exiting
async def shutdown(app):
logger.info('Shutting down: removing webhook')
await bot.remove_webhook()
logger.info('Shutting down: closing session')
await bot.close_session()
async def setup():
# Remove webhook, it fails sometimes the set if there is a previous webhook
logger.info('Starting up: removing old webhook')
await bot.remove_webhook()
# Set webhook
logger.info('Starting up: setting webhook')
await bot.set_webhook(url=WEBHOOK_URL_BASE + WEBHOOK_URL_PATH,
certificate=open(WEBHOOK_SSL_CERT, 'r'))
app = web.Application()
app.router.add_post('/{token}/', handle)
app.on_cleanup.append(shutdown)
return app
if __name__ == '__main__':
# Build ssl context
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
context.load_cert_chain(WEBHOOK_SSL_CERT, WEBHOOK_SSL_PRIV)
# Start aiohttp server
web.run_app(
setup(),
host=WEBHOOK_LISTEN,
port=WEBHOOK_PORT,
ssl_context=context,
)

View File

@ -0,0 +1,45 @@
#!/usr/bin/python
# This is a simple echo bot using the decorator mechanism.
# It echoes any incoming text messages.
# Example on built-in function to receive and process webhooks.
from telebot.async_telebot import AsyncTeleBot
import asyncio
bot = AsyncTeleBot('TOKEN')
WEBHOOK_SSL_CERT = './webhook_cert.pem' # Path to the ssl certificate
WEBHOOK_SSL_PRIV = './webhook_pkey.pem' # Path to the ssl private key
DOMAIN = '1.2.3.4' # either domain, or ip address of vps
# Quick'n'dirty SSL certificate generation:
#
# openssl genrsa -out webhook_pkey.pem 2048
# openssl req -new -x509 -days 3650 -key webhook_pkey.pem -out webhook_cert.pem
#
# When asked for "Common Name (e.g. server FQDN or YOUR name)" you should reply
# with the same value in you put in WEBHOOK_HOST
# Handle '/start' and '/help'
@bot.message_handler(commands=['help', 'start'])
async def send_welcome(message):
await bot.reply_to(message, """\
Hi there, I am EchoBot.
I am here to echo your kind words back to you. Just say anything nice and I'll say the exact same thing to you!\
""")
# Handle all other messages with content_type 'text' (content_types defaults to ['text'])
@bot.message_handler(func=lambda message: True)
async def echo_message(message):
await bot.reply_to(message, message.text)
# it uses fastapi + uvicorn
asyncio.run(bot.run_webhooks(
listen=DOMAIN,
certificate=WEBHOOK_SSL_CERT,
certificate_key=WEBHOOK_SSL_PRIV
))

View File

@ -0,0 +1,89 @@
#!/usr/bin/env python
"""
Asynchronous Telegram Echo Bot example.
This is a simple bot that echoes each message that is received onto the chat.
It uses the Starlette ASGI framework to receive updates via webhook requests.
"""
import uvicorn
from starlette.applications import Starlette
from starlette.requests import Request
from starlette.responses import PlainTextResponse, Response
from starlette.routing import Route
from telebot.async_telebot import AsyncTeleBot
from telebot.types import Message, Update
API_TOKEN = "TOKEN"
WEBHOOK_HOST = "<ip/domain>"
WEBHOOK_PORT = 8443 # 443, 80, 88 or 8443 (port need to be 'open')
WEBHOOK_LISTEN = "0.0.0.0"
WEBHOOK_SSL_CERT = "./webhook_cert.pem" # Path to the ssl certificate
WEBHOOK_SSL_PRIV = "./webhook_pkey.pem" # Path to the ssl private key
WEBHOOK_URL = f"https://{WEBHOOK_HOST}:{WEBHOOK_PORT}/telegram"
WEBHOOK_SECRET_TOKEN = "SECRET_TOKEN"
logger = telebot.logger
telebot.logger.setLevel(logging.INFO)
bot = AsyncTeleBot(token=API_TOKEN)
# BOT HANDLERS
@bot.message_handler(commands=["help", "start"])
async def send_welcome(message: Message):
"""
Handle '/start' and '/help'
"""
await bot.reply_to(
message,
("Hi there, I am EchoBot.\n" "I am here to echo your kind words back to you."),
)
@bot.message_handler(func=lambda _: True, content_types=["text"])
async def echo_message(message: Message):
"""
Handle all other messages
"""
await bot.reply_to(message, message.text)
# WEBSERVER HANDLERS
async def telegram(request: Request) -> Response:
"""Handle incoming Telegram updates."""
token_header_name = "X-Telegram-Bot-Api-Secret-Token"
if request.headers.get(token_header_name) != WEBHOOK_SECRET_TOKEN:
return PlainTextResponse("Forbidden", status_code=403)
await bot.process_new_updates([Update.de_json(await request.json())])
return Response()
async def startup() -> None:
"""Register webhook for telegram updates."""
webhook_info = await bot.get_webhook_info(30)
if WEBHOOK_URL != webhook_info.url:
logger.debug(
f"updating webhook url, old: {webhook_info.url}, new: {WEBHOOK_URL}"
)
if not await bot.set_webhook(
url=WEBHOOK_URL, secret_token=WEBHOOK_SECRET_TOKEN
):
raise RuntimeError("unable to set webhook")
app = Starlette(
routes=[
Route("/telegram", telegram, methods=["POST"]),
],
on_startup=[startup],
)
uvicorn.run(
app,
host=WEBHOOK_HOST,
port=WEBHOOK_LISTEN,
ssl_certfile=WEBHOOK_SSL_CERT,
ssl_keyfile=WEBHOOK_SSL_PRIV,
)

View File

@ -0,0 +1,25 @@
import telebot
from telebot import types, AdvancedCustomFilter
from telebot.callback_data import CallbackData, CallbackDataFilter
calendar_factory = CallbackData("year", "month", prefix="calendar")
calendar_zoom = CallbackData("year", prefix="calendar_zoom")
class CalendarCallbackFilter(AdvancedCustomFilter):
key = 'calendar_config'
def check(self, call: types.CallbackQuery, config: CallbackDataFilter):
return config.check(query=call)
class CalendarZoomCallbackFilter(AdvancedCustomFilter):
key = 'calendar_zoom_config'
def check(self, call: types.CallbackQuery, config: CallbackDataFilter):
return config.check(query=call)
def bind_filters(bot: telebot.TeleBot):
bot.add_custom_filter(CalendarCallbackFilter())
bot.add_custom_filter(CalendarZoomCallbackFilter())

View File

@ -0,0 +1,92 @@
import calendar
from datetime import date, timedelta
from examples.callback_data_examples.advanced_calendar_example.filters import calendar_factory, calendar_zoom
from telebot.types import InlineKeyboardMarkup, InlineKeyboardButton
EMTPY_FIELD = '1'
WEEK_DAYS = [calendar.day_abbr[i] for i in range(7)]
MONTHS = [(i, calendar.month_name[i]) for i in range(1, 13)]
def generate_calendar_days(year: int, month: int):
keyboard = InlineKeyboardMarkup(row_width=7)
today = date.today()
keyboard.add(
InlineKeyboardButton(
text=date(year=year, month=month, day=1).strftime('%b %Y'),
callback_data=EMTPY_FIELD
)
)
keyboard.add(*[
InlineKeyboardButton(
text=day,
callback_data=EMTPY_FIELD
)
for day in WEEK_DAYS
])
for week in calendar.Calendar().monthdayscalendar(year=year, month=month):
week_buttons = []
for day in week:
day_name = ' '
if day == today.day and today.year == year and today.month == month:
day_name = '🔘'
elif day != 0:
day_name = str(day)
week_buttons.append(
InlineKeyboardButton(
text=day_name,
callback_data=EMTPY_FIELD
)
)
keyboard.add(*week_buttons)
previous_date = date(year=year, month=month, day=1) - timedelta(days=1)
next_date = date(year=year, month=month, day=1) + timedelta(days=31)
keyboard.add(
InlineKeyboardButton(
text='Previous month',
callback_data=calendar_factory.new(year=previous_date.year, month=previous_date.month)
),
InlineKeyboardButton(
text='Zoom out',
callback_data=calendar_zoom.new(year=year)
),
InlineKeyboardButton(
text='Next month',
callback_data=calendar_factory.new(year=next_date.year, month=next_date.month)
),
)
return keyboard
def generate_calendar_months(year: int):
keyboard = InlineKeyboardMarkup(row_width=3)
keyboard.add(
InlineKeyboardButton(
text=date(year=year, month=1, day=1).strftime('Year %Y'),
callback_data=EMTPY_FIELD
)
)
keyboard.add(*[
InlineKeyboardButton(
text=month,
callback_data=calendar_factory.new(year=year, month=month_number)
)
for month_number, month in MONTHS
])
keyboard.add(
InlineKeyboardButton(
text='Previous year',
callback_data=calendar_zoom.new(year=year - 1)
),
InlineKeyboardButton(
text='Next year',
callback_data=calendar_zoom.new(year=year + 1)
)
)
return keyboard

View File

@ -0,0 +1,56 @@
# -*- coding: utf-8 -*-
"""
This Example will show you an advanced usage of CallbackData.
In this example calendar was implemented
"""
from datetime import date
from examples.callback_data_examples.advanced_calendar_example.keyboards import generate_calendar_days, \
generate_calendar_months, EMTPY_FIELD
from filters import calendar_factory, calendar_zoom, bind_filters
from telebot import types, TeleBot
API_TOKEN = ''
bot = TeleBot(API_TOKEN)
@bot.message_handler(commands='start')
def start_command_handler(message: types.Message):
bot.send_message(message.chat.id,
f"Hello {message.from_user.first_name}. This bot is an example of calendar keyboard."
"\nPress /calendar to see it.")
@bot.message_handler(commands='calendar')
def calendar_command_handler(message: types.Message):
now = date.today()
bot.send_message(message.chat.id, 'Calendar', reply_markup=generate_calendar_days(year=now.year, month=now.month))
@bot.callback_query_handler(func=None, calendar_config=calendar_factory.filter())
def calendar_action_handler(call: types.CallbackQuery):
callback_data: dict = calendar_factory.parse(callback_data=call.data)
year, month = int(callback_data['year']), int(callback_data['month'])
bot.edit_message_reply_markup(call.message.chat.id, call.message.id,
reply_markup=generate_calendar_days(year=year, month=month))
@bot.callback_query_handler(func=None, calendar_zoom_config=calendar_zoom.filter())
def calendar_zoom_out_handler(call: types.CallbackQuery):
callback_data: dict = calendar_zoom.parse(callback_data=call.data)
year = int(callback_data.get('year'))
bot.edit_message_reply_markup(call.message.chat.id, call.message.id,
reply_markup=generate_calendar_months(year=year))
@bot.callback_query_handler(func=lambda call: call.data == EMTPY_FIELD)
def callback_empty_field_handler(call: types.CallbackQuery):
bot.answer_callback_query(call.id)
if __name__ == '__main__':
bind_filters(bot)
bot.infinity_polling()

View File

@ -0,0 +1,86 @@
# -*- coding: utf-8 -*-
"""
This Example will show you how to use CallbackData
"""
from telebot.callback_data import CallbackData, CallbackDataFilter
from telebot import types, TeleBot
from telebot.custom_filters import AdvancedCustomFilter
API_TOKEN = ''
PRODUCTS = [
{'id': '0', 'name': 'xiaomi mi 10', 'price': 400},
{'id': '1', 'name': 'samsung s20', 'price': 800},
{'id': '2', 'name': 'iphone 13', 'price': 1300}
]
bot = TeleBot(API_TOKEN)
products_factory = CallbackData('product_id', prefix='products')
def products_keyboard():
return types.InlineKeyboardMarkup(
keyboard=[
[
types.InlineKeyboardButton(
text=product['name'],
callback_data=products_factory.new(product_id=product["id"])
)
]
for product in PRODUCTS
]
)
def back_keyboard():
return types.InlineKeyboardMarkup(
keyboard=[
[
types.InlineKeyboardButton(
text='',
callback_data='back'
)
]
]
)
class ProductsCallbackFilter(AdvancedCustomFilter):
key = 'config'
def check(self, call: types.CallbackQuery, config: CallbackDataFilter):
return config.check(query=call)
@bot.message_handler(commands=['products'])
def products_command_handler(message: types.Message):
bot.send_message(message.chat.id, 'Products:', reply_markup=products_keyboard())
# Only product with field - product_id = 2
@bot.callback_query_handler(func=None, config=products_factory.filter(product_id='2'))
def product_one_callback(call: types.CallbackQuery):
bot.answer_callback_query(callback_query_id=call.id, text='Not available :(', show_alert=True)
# Any other products
@bot.callback_query_handler(func=None, config=products_factory.filter())
def products_callback(call: types.CallbackQuery):
callback_data: dict = products_factory.parse(callback_data=call.data)
product_id = int(callback_data['product_id'])
product = PRODUCTS[product_id]
text = f"Product name: {product['name']}\n" \
f"Product price: {product['price']}"
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id,
text=text, reply_markup=back_keyboard())
@bot.callback_query_handler(func=lambda c: c.data == 'back')
def back_callback(call: types.CallbackQuery):
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id,
text='Products:', reply_markup=products_keyboard())
bot.add_custom_filter(ProductsCallbackFilter())
bot.infinity_polling()

View File

@ -0,0 +1,11 @@
import telebot
bot = telebot.TeleBot('TOKEN')
@bot.chat_join_request_handler()
def make_some(message: telebot.types.ChatJoinRequest):
bot.send_message(message.chat.id, 'I accepted a new user!')
bot.approve_chat_join_request(message.chat.id, message.from_user.id)
bot.infinity_polling(allowed_updates=telebot.util.update_types)

View File

@ -0,0 +1,33 @@
import telebot
from telebot import types,util
bot = telebot.TeleBot("token")
#chat_member_handler. When status changes, telegram gives update. check status from old_chat_member and new_chat_member.
@bot.chat_member_handler()
def chat_m(message: types.ChatMemberUpdated):
old = message.old_chat_member
new = message.new_chat_member
if new.status == "member":
bot.send_message(message.chat.id,"Hello {name}!".format(name=new.user.first_name)) # Welcome message
#if bot is added to group, this handler will work
@bot.my_chat_member_handler()
def my_chat_m(message: types.ChatMemberUpdated):
old = message.old_chat_member
new = message.new_chat_member
if new.status == "member":
bot.send_message(message.chat.id,"Somebody added me to group") # Welcome message, if bot was added to group
bot.leave_chat(message.chat.id)
#content_Type_service is:
#'new_chat_members', 'left_chat_member', 'new_chat_title', 'new_chat_photo', 'delete_chat_photo', 'group_chat_created',
#'supergroup_chat_created', 'channel_chat_created', 'migrate_to_chat_id', 'migrate_from_chat_id', 'pinned_message',
#'proximity_alert_triggered', 'video_chat_scheduled', 'video_chat_started', 'video_chat_ended',
#'video_chat_participants_invited', 'message_auto_delete_timer_changed'
# this handler deletes service messages
@bot.message_handler(content_types=util.content_type_service)
def delall(message: types.Message):
bot.delete_message(message.chat.id,message.message_id)
bot.infinity_polling(allowed_updates=util.update_types)

View File

@ -0,0 +1,23 @@
from telebot import TeleBot
from telebot.handler_backends import ContinueHandling
bot = TeleBot('TOKEN')
@bot.message_handler(commands=['start'])
def start(message):
bot.send_message(message.chat.id, 'Hello World!')
return ContinueHandling()
@bot.message_handler(commands=['start'])
def start2(message):
"""
This handler comes after the first one, but it will never be called.
But you can call it by returning ContinueHandling() in the first handler.
If you return ContinueHandling() in the first handler, the next
registered handler with appropriate filters will be called.
"""
bot.send_message(message.chat.id, 'Hello World2!')
bot.infinity_polling()

View File

@ -0,0 +1,33 @@
import telebot
from time import sleep, time
from telebot.types import InlineKeyboardMarkup, InlineKeyboardButton #Only for creating Inline Buttons, not necessary for creating Invite Links
Token = "api_token" #Your Bot Access Token
Group_ID = -1234567890 #Group ID for which invite link is to be created
bot = telebot.TeleBot(Token, parse_mode="HTML")
#/start command message
@bot.message_handler(commands=['start'])
def startmsg(msg):
bot.reply_to(msg, "Hey there, I'm a bot made by pyTelegramBotAPI!")
#Get notified of incoming members in group
@bot.message_handler(content_types=['new_chat_members'])
def newmember(msg):
#Create an invite link class that contains info about the created invite link using create_chat_invite_link() with parameters
invite = bot.create_chat_invite_link(Group_ID, member_limit=1, expire_date=int(time())+45) #Here, the link will auto-expire in 45 seconds
InviteLink = invite.invite_link #Get the actual invite link from 'invite' class
mrkplink = InlineKeyboardMarkup() #Created Inline Keyboard Markup
mrkplink.add(InlineKeyboardButton("Join our group 🚀", url=InviteLink)) #Added Invite Link to Inline Keyboard
bot.send_message(msg.chat.id, f"Hey there {msg.from_user.first_name}, Click the link below to join our Official Group.", reply_markup=mrkplink)
#This will send a message with the newly-created invite link as markup button.
#The member limit will be 1 and expiring time will be 45 sec.
bot.infinity_polling()

View File

@ -0,0 +1,12 @@
import telebot
from telebot import custom_filters
bot = telebot.TeleBot('TOKEN')
# Handler
@bot.message_handler(chat_types=['supergroup'], is_chat_admin=True)
def answer_for_admin(message):
bot.send_message(message.chat.id,"hello my admin")
# Register filter
bot.add_custom_filter(custom_filters.IsAdminFilter(bot))
bot.infinity_polling()

View File

@ -0,0 +1,125 @@
# -*- coding: utf-8 -*-
"""
This Example will show you usage of TextFilter
In this example you will see how to use TextFilter
with (message_handler, callback_query_handler, poll_handler)
"""
from telebot import TeleBot, types
from telebot.custom_filters import TextFilter, TextMatchFilter, IsReplyFilter
bot = TeleBot("")
@bot.message_handler(text=TextFilter(equals='hello'))
def hello_handler(message: types.Message):
bot.send_message(message.chat.id, message.text)
@bot.message_handler(text=TextFilter(equals='hello', ignore_case=True))
def hello_handler_ignore_case(message: types.Message):
bot.send_message(message.chat.id, message.text + ' ignore case')
@bot.message_handler(text=TextFilter(contains=['good', 'bad']))
def contains_handler(message: types.Message):
bot.send_message(message.chat.id, message.text)
@bot.message_handler(text=TextFilter(contains=['good', 'bad'], ignore_case=True))
def contains_handler_ignore_case(message: types.Message):
bot.send_message(message.chat.id, message.text + ' ignore case')
@bot.message_handler(text=TextFilter(starts_with='st')) # stArk, steve, stONE
def starts_with_handler(message: types.Message):
bot.send_message(message.chat.id, message.text)
@bot.message_handler(text=TextFilter(starts_with='st', ignore_case=True)) # STark, sTeve, stONE
def starts_with_handler_ignore_case(message: types.Message):
bot.send_message(message.chat.id, message.text + ' ignore case')
@bot.message_handler(text=TextFilter(ends_with='ay')) # wednesday, SUNday, WeekDay
def ends_with_handler(message: types.Message):
bot.send_message(message.chat.id, message.text)
@bot.message_handler(text=TextFilter(ends_with='ay', ignore_case=True)) # wednesdAY, sundAy, WeekdaY
def ends_with_handler_ignore_case(message: types.Message):
bot.send_message(message.chat.id, message.text + ' ignore case')
@bot.message_handler(text=TextFilter(equals='/callback'))
def send_callback(message: types.Message):
keyboard = types.InlineKeyboardMarkup(
keyboard=[
[types.InlineKeyboardButton(text='callback data', callback_data='example')],
[types.InlineKeyboardButton(text='ignore case callback data', callback_data='ExAmPLe')]
]
)
bot.send_message(message.chat.id, message.text, reply_markup=keyboard)
@bot.callback_query_handler(func=None, text=TextFilter(equals='example'))
def callback_query_handler(call: types.CallbackQuery):
bot.answer_callback_query(call.id, call.data, show_alert=True)
@bot.callback_query_handler(func=None, text=TextFilter(equals='example', ignore_case=True))
def callback_query_handler_ignore_case(call: types.CallbackQuery):
bot.answer_callback_query(call.id, call.data + " ignore case", show_alert=True)
@bot.message_handler(text=TextFilter(equals='/poll'))
def send_poll(message: types.Message):
bot.send_poll(message.chat.id, question='When do you prefer to work?', options=['Morning', 'Night'])
bot.send_poll(message.chat.id, question='WHEN DO you pRefeR to worK?', options=['Morning', 'Night'])
@bot.poll_handler(func=None, text=TextFilter(equals='When do you prefer to work?'))
def poll_question_handler(poll: types.Poll):
print(poll.question)
@bot.poll_handler(func=None, text=TextFilter(equals='When do you prefer to work?', ignore_case=True))
def poll_question_handler_ignore_case(poll: types.Poll):
print(poll.question + ' ignore case')
# either hi or contains one of (привет, salom)
@bot.message_handler(text=TextFilter(equals="hi", contains=('привет', 'salom'), ignore_case=True))
def multiple_patterns_handler(message: types.Message):
bot.send_message(message.chat.id, message.text)
# starts with one of (mi, mea) for ex. minor, milk, meal, meat
@bot.message_handler(text=TextFilter(starts_with=['mi', 'mea'], ignore_case=True))
def multiple_starts_with_handler(message: types.Message):
bot.send_message(message.chat.id, message.text)
# ends with one of (es, on) for ex. Jones, Davies, Johnson, Wilson
@bot.message_handler(text=TextFilter(ends_with=['es', 'on'], ignore_case=True))
def multiple_ends_with_handler(message: types.Message):
bot.send_message(message.chat.id, message.text)
# !ban /ban .ban !бан /бан .бан
@bot.message_handler(is_reply=True,
text=TextFilter(starts_with=('!', '/', '.'), ends_with=['ban', 'бан'], ignore_case=True))
def ban_command_handler(message: types.Message):
if len(message.text) == 4 and message.chat.type != 'private':
try:
bot.ban_chat_member(message.chat.id, message.reply_to_message.from_user.id)
bot.reply_to(message.reply_to_message, 'Banned.')
except Exception as err:
print(err.args)
return
if __name__ == '__main__':
bot.add_custom_filter(TextMatchFilter())
bot.add_custom_filter(IsReplyFilter())
bot.infinity_polling()

View File

@ -0,0 +1,42 @@
import telebot
bot = telebot.TeleBot('TOKEN')
# AdvancedCustomFilter is for list, string filter values
class MainFilter(telebot.custom_filters.AdvancedCustomFilter):
key='text'
@staticmethod
def check(message, text):
return message.text in text
# SimpleCustomFilter is for boolean values, such as is_admin=True
class IsAdmin(telebot.custom_filters.SimpleCustomFilter):
key='is_admin'
@staticmethod
def check(message: telebot.types.Message):
return bot.get_chat_member(message.chat.id,message.from_user.id).status in ['administrator','creator']
@bot.message_handler(is_admin=True, commands=['admin']) # Check if user is admin
def admin_rep(message):
bot.send_message(message.chat.id, "Hi admin")
@bot.message_handler(is_admin=False, commands=['admin']) # If user is not admin
def not_admin(message):
bot.send_message(message.chat.id, "You are not admin")
@bot.message_handler(text=['hi']) # Response to hi message
def welcome_hi(message):
bot.send_message(message.chat.id, 'You said hi')
@bot.message_handler(text=['bye']) # Response to bye message
def bye_user(message):
bot.send_message(message.chat.id, 'You said bye')
# Do not forget to register filters
bot.add_custom_filter(MainFilter())
bot.add_custom_filter(IsAdmin())
bot.infinity_polling(skip_pending=True) # Skip old updates

View File

@ -0,0 +1,19 @@
import telebot
from telebot import custom_filters
bot = telebot.TeleBot('token')
# Chat id can be private or supergroups.
@bot.message_handler(chat_id=[12345678], commands=['admin']) # chat_id checks id corresponds to your list or not.
def admin_rep(message):
bot.send_message(message.chat.id, "You are allowed to use this command.")
@bot.message_handler(commands=['admin'])
def not_admin(message):
bot.send_message(message.chat.id, "You are not allowed to use this command")
# Do not forget to register
bot.add_custom_filter(custom_filters.ChatFilter())
bot.infinity_polling()

View File

@ -0,0 +1,21 @@
import telebot
from telebot import custom_filters
bot = telebot.TeleBot('TOKEN')
# Check if message is a reply
@bot.message_handler(is_reply=True)
def start_filter(message):
bot.send_message(message.chat.id, "Looks like you replied to my message.")
# Check if message was forwarded
@bot.message_handler(is_forwarded=True)
def text_filter(message):
bot.send_message(message.chat.id, "I do not accept forwarded messages!")
# Do not forget to register filters
bot.add_custom_filter(custom_filters.IsReplyFilter())
bot.add_custom_filter(custom_filters.ForwardFilter())
bot.infinity_polling()

View File

@ -0,0 +1,21 @@
import telebot
from telebot import custom_filters
bot = telebot.TeleBot('TOKEN')
# Check if message starts with @admin tag
@bot.message_handler(text_startswith="@admin")
def start_filter(message):
bot.send_message(message.chat.id, "Looks like you are calling admin, wait...")
# Check if text is hi or hello
@bot.message_handler(text=['hi','hello'])
def text_filter(message):
bot.send_message(message.chat.id, "Hi, {name}!".format(name=message.from_user.first_name))
# Do not forget to register filters
bot.add_custom_filter(custom_filters.TextMatchFilter())
bot.add_custom_filter(custom_filters.TextStartsFilter())
bot.infinity_polling()

106
examples/custom_states.py Normal file
View File

@ -0,0 +1,106 @@
import telebot # telebot
from telebot import custom_filters
from telebot.handler_backends import State, StatesGroup #States
# States storage
from telebot.storage import StateMemoryStorage
# Starting from version 4.4.0+, we support storages.
# StateRedisStorage -> Redis-based storage.
# StatePickleStorage -> Pickle-based storage.
# For redis, you will need to install redis.
# Pass host, db, password, or anything else,
# if you need to change config for redis.
# Pickle requires path. Default path is in folder .state-saves.
# If you were using older version of pytba for pickle,
# you need to migrate from old pickle to new by using
# StatePickleStorage().convert_old_to_new()
# Now, you can pass storage to bot.
state_storage = StateMemoryStorage() # you can init here another storage
bot = telebot.TeleBot("TOKEN",
state_storage=state_storage)
# States group.
class MyStates(StatesGroup):
# Just name variables differently
name = State() # creating instances of State class is enough from now
surname = State()
age = State()
@bot.message_handler(commands=['start'])
def start_ex(message):
"""
Start command. Here we are starting state
"""
bot.set_state(message.from_user.id, MyStates.name, message.chat.id)
bot.send_message(message.chat.id, 'Hi, write me a name')
# Any state
@bot.message_handler(state="*", commands=['cancel'])
def any_state(message):
"""
Cancel state
"""
bot.send_message(message.chat.id, "Your state was cancelled.")
bot.delete_state(message.from_user.id, message.chat.id)
@bot.message_handler(state=MyStates.name)
def name_get(message):
"""
State 1. Will process when user's state is MyStates.name.
"""
bot.send_message(message.chat.id, 'Now write me a surname')
bot.set_state(message.from_user.id, MyStates.surname, message.chat.id)
with bot.retrieve_data(message.from_user.id, message.chat.id) as data:
data['name'] = message.text
@bot.message_handler(state=MyStates.surname)
def ask_age(message):
"""
State 2. Will process when user's state is MyStates.surname.
"""
bot.send_message(message.chat.id, "What is your age?")
bot.set_state(message.from_user.id, MyStates.age, message.chat.id)
with bot.retrieve_data(message.from_user.id, message.chat.id) as data:
data['surname'] = message.text
# result
@bot.message_handler(state=MyStates.age, is_digit=True)
def ready_for_answer(message):
"""
State 3. Will process when user's state is MyStates.age.
"""
with bot.retrieve_data(message.from_user.id, message.chat.id) as data:
msg = ("Ready, take a look:\n<b>"
f"Name: {data['name']}\n"
f"Surname: {data['surname']}\n"
f"Age: {message.text}</b>")
bot.send_message(message.chat.id, msg, parse_mode="html")
bot.delete_state(message.from_user.id, message.chat.id)
#incorrect number
@bot.message_handler(state=MyStates.age, is_digit=False)
def age_incorrect(message):
"""
Wrong response for MyStates.age
"""
bot.send_message(message.chat.id, 'Looks like you are submitting a string in the field age. Please enter a number')
# register filters
bot.add_custom_filter(custom_filters.StateFilter(bot))
bot.add_custom_filter(custom_filters.IsDigitFilter())
bot.infinity_polling(skip_pending=True)

View File

@ -1,3 +1,5 @@
#!/usr/bin/python
# This example shows how to implement deep linking (https://core.telegram.org/bots#deep-linking)
# with the pyTelegramBotAPI.
# Note: This is not a working, production-ready sample.
@ -31,34 +33,38 @@
# steps are not shown here. Only steps 5 to 7 are illustrated, some in pseudo-code, with this example.
import telebot
import time
bot = telebot.TeleBot('TOKEN')
def extract_unique_code(text):
# Extracts the unique_code from the sent /start command.
return text.split()[1] if len(text.split()) > 1 else None
def in_storage(unique_code):
# (pseudo-code) Should check if a unique code exists in storage
return True
def get_username_from_storage(unique_code):
# (pseudo-code) Does a query to the storage, retrieving the associated username
# Should be replaced by a real database-lookup.
return "ABC" if in_storage(unique_code) else None
def save_chat_id(chat_id, username):
# (pseudo-code) Save the chat_id->username to storage
# Should be replaced by a real database query.
pass
@bot.message_handler(commands=['start'])
def send_welcome(message):
unique_code = extract_unique_code(message.text)
if unique_code: # if the '/start' command contains a unique_code
if unique_code: # if the '/start' command contains a unique_code
username = get_username_from_storage(unique_code)
if username: # if the username exists in our database
if username: # if the username exists in our database
save_chat_id(message.chat.id, username)
reply = "Hello {0}, how are you?".format(username)
else:
@ -67,4 +73,5 @@ def send_welcome(message):
reply = "Please visit me via a provided URL from the website."
bot.reply_to(message, reply)
bot.polling()
bot.infinity_polling()

View File

@ -2,9 +2,10 @@
This is a detailed example using almost every command of the API
"""
import time
import telebot
from telebot import types
import time
TOKEN = '<token_string>'
@ -12,14 +13,14 @@ knownUsers = [] # todo: save these in a file,
userStep = {} # so they won't reset every time the bot restarts
commands = { # command description used in the "help" command
'start': 'Get used to the bot',
'help': 'Gives you information about the available commands',
'sendLongText': 'A test using the \'send_chat_action\' command',
'getImage': 'A test using multi-stage messages, custom keyboard, and media sending'
'start' : 'Get used to the bot',
'help' : 'Gives you information about the available commands',
'sendLongText': 'A test using the \'send_chat_action\' command',
'getImage' : 'A test using multi-stage messages, custom keyboard, and media sending'
}
imageSelect = types.ReplyKeyboardMarkup(one_time_keyboard=True) # create the image selection keyboard
imageSelect.add('cock', 'pussy')
imageSelect.add('Mickey', 'Minnie')
hideBoard = types.ReplyKeyboardRemove() # if sent as reply_markup, will hide the keyboard
@ -33,7 +34,7 @@ def get_user_step(uid):
else:
knownUsers.append(uid)
userStep[uid] = 0
print "New user detected, who hasn't used \"/start\" yet"
print("New user detected, who hasn't used \"/start\" yet")
return 0
@ -45,7 +46,7 @@ def listener(messages):
for m in messages:
if m.content_type == 'text':
# print the sent message to the console
print str(m.chat.first_name) + " [" + str(m.chat.id) + "]: " + m.text
print(str(m.chat.first_name) + " [" + str(m.chat.id) + "]: " + m.text)
bot = telebot.TeleBot(TOKEN)
@ -104,15 +105,15 @@ def msg_image_select(m):
# for some reason the 'upload_photo' status isn't quite working (doesn't show at all)
bot.send_chat_action(cid, 'typing')
if text == "cock": # send the appropriate image based on the reply to the "/getImage" command
if text == 'Mickey': # send the appropriate image based on the reply to the "/getImage" command
bot.send_photo(cid, open('rooster.jpg', 'rb'),
reply_markup=hideBoard) # send file and hide keyboard, after image is sent
userStep[cid] = 0 # reset the users step back to 0
elif text == "pussy":
elif text == 'Minnie':
bot.send_photo(cid, open('kitten.jpg', 'rb'), reply_markup=hideBoard)
userStep[cid] = 0
else:
bot.send_message(cid, "Don't type bullsh*t, if I give you a predefined keyboard!")
bot.send_message(cid, "Please, use the predefined keyboard!")
bot.send_message(cid, "Please try again")
@ -128,4 +129,5 @@ def command_default(m):
# this is the standard reply to a normal message
bot.send_message(m.chat.id, "I don't understand \"" + m.text + "\"\nMaybe try the help page at /help")
bot.polling()
bot.infinity_polling()

View File

@ -0,0 +1,28 @@
#!/usr/bin/python
# This is a simple echo bot using the decorator mechanism.
# It echoes any incoming text messages.
import telebot
API_TOKEN = '<api_token>'
bot = telebot.TeleBot(API_TOKEN)
# Handle '/start' and '/help'
@bot.message_handler(commands=['help', 'start'])
def send_welcome(message):
bot.reply_to(message, """\
Hi there, I am EchoBot.
I am here to echo your kind words back to you. Just say anything nice and I'll say the exact same thing to you!\
""")
# Handle all other messages with content_type 'text' (content_types defaults to ['text'])
@bot.message_handler(func=lambda message: True)
def echo_message(message):
bot.reply_to(message, message.text)
# only for versions 4.7.0+
bot.infinity_polling(restart_on_change=True)

Some files were not shown because too many files have changed in this diff Show More