- Bot API 5.1
- See all bot API changes in https://core.telegram.org/bots/api#recent-changes.
- Fixed a bug in download_file that prevented it from working
- Bot API 5.0 additions (Some things may be missing or broken, please report)
- Added the api_endpoint parameter to the Bot class to allow setting custom API endpoint
- Initial typing hint support, not yet complete
- Bump aiohttp to 3.7.2 and urllib3 to 1.25.11
- Dropped Python support below 3.5.3 and their compatibility hacks
- Hotfix for a bug that prevented amanobot from working
- Bot API 4.8
- Supported explanations for Quizzes 2.0. Add explanations by specifying the parameters
explanation
andexplanation_parse_mode
in the methodsendPoll
- Supported the new darts animation for the dice mini-game. Choose between the default dice animation and darts animation by specifying the parameter
emoji
in the methodsendDice
- Added the fields
explanation
andexplanation_entities
to thePoll
object - Supported timed polls that automatically close at a certain date and time. Set up by specifying the parameter
open_period
orclose_date
in the methodsendPoll
- Added the fields
open_period
andclose_date
to thePoll
object - Added the missing
is_anonymous
field to thePoll
object
- Updated setup.py to include a Python version check
- Added a deprecation warning for users in Python 2 and <=3.4
- This update has no visible improvments. You can ignore this update if you want
- Bot API 4.7
- Added the method
sendDice
for sending a dice message, which will have a random value from 1 to 6 - Added the field
dice
to theMessage
object - Added the method
getMyCommands
for getting the current list of the bot's commands - Added the method
setMyCommands
for changing the list of the bot's commands through the Bot API instead of @BotFather - Added the ability to create animated sticker sets by specifying the parameter
tgs_sticker
instead ofpng_sticker
in the methodcreateNewStickerSet
- Added the ability to add animated stickers to sets created by the bot by specifying the parameter
tgs_sticker
instead ofpng_sticker
in the methodaddStickerToSet
- Added the field
thumb
to theStickerSet
object - Added the ability to change thumbnails of sticker sets created by the bot using the method
setStickerSetThumb
- Bot API 4.6
- Added the ability to send non-anonymous, multiple answer, and quiz-style polls: added the parameters
is_anonymous
,type
,allows_multiple_answers
,correct_option_id
,is_closed
options to the methodsendPoll
- Added the object
KeyboardButtonPollType
and the fieldrequest_poll
to the objectKeyboardButton
- Added the field
poll_answer
in theUpdate
object - Added the fields
total_voter_count
,is_anonymous
,type
,allows_multiple_answers
,correct_option_id
to thePoll
object - Bots can now send polls to private chats
- Added the fields
can_join_groups
,can_read_all_group_messages
andsupports_inline_queries
to theUser
object - Added the optional field
language
to theMessageEntity
object
- Bot API 4.5
- Added the
setChatAdministratorCustomTitle
method - Added the
file_unique_id
field to the objectsAnimation
,Audio
,Document
,PassportFile
,PhotoSize
,Sticker
,Video
,VideoNote
,Voice
andFile
- Added the
small_file_unique_id
andbig_file_unique_id
fields to the objectChatPhoto
- Added the
slow_mode_delay
field to theChat
object - Added the
custom_title
field to theChatMember
object - Note: If you want to use the new entity fields (such as underlined and strikethrough text) in markdown, you need to pass
MarkdownV2
to theparse_mode
parameter
- Add the
raise_errors
to the Bot class - Require at least Python 3.5.3 for the asyncio variant (Fixes installation on Python 3.5.2)
- Hotfix for asyncio version failing to start
- Added support for the
thumb
parameter in media Senders (sendAudio
,sendDocument
, etc) - Added support for media editing using the
editMessageMedia
method
- Allow raising KeyboardInterrupt on
run_forever()
(aka blocking loop)
- Add missing permissions to restrictChatMember on the asyncio variant.
- Bot API 4.4
- Added the
setChatDescription
method. - Added the fields
can_send_polls
,can_change_info
,can_invite_users
,can_pin_messages
andpermissions
to therestrictChatMember
method. - Added the
ChatPermissions
object. - Removed the
all_members_are_administrators
field from theChat
object. - Added the
permissions
field tp theChat
object - Added the
is_animated
field to theSticker
andStickerSet
objects
- Bot API 4.3
- Added missing Passport related methods and objects
- Added the
LoginUrl
object - Added the
login_url
field to theInlineKeyboardButton
object
- Bot API 4.2
- Added the
sendPoll
method - Added the
stopPoll
method - Added the field
forward_sender_name
andpoll
to theMessage
object - Added the field
poll
to theUpdate
object - Added the field
is_member
to theChatMember
object
- Re-added
thumb
tosendAudio
method - Some improvments to the code
- Bot API 4.1 (complete)
- Fix
InputMediaAnimation
- Add types
InputMediaAudio
andInputMediaDocument
- Added
vcard
to the objectsContact
,InlineQueryResultContact
,InputContactMessageContent
and the methodsendContact
- Bot API 4.1 (partial)
- Added method
editMessageMedia
andsendAnimation
- Added
thumb
tosendAudio
,sendDocument
,sendVideo
andsendVideoNote
methods - Added
foursquare_type
tosendVenue
method and to objectsVenue
,InlineQueryResultVenue
andInputVenueMessageContent
- Await
aiohttp.ClientSession.close()
- Upgraded dependency
aiohttp>=3.0.0
- Bot API 3.6
- Added
parse_mode
to all methods and namedtuples supportingcaption
- Added
supports_streaming
andconnected_website
to relevant methods and namedtuples - Fixed downloading through proxy in
telepot.aio.api
module
- Bot API 3.5
- Added method
sendMediaGroup
and namedtupleInputMediaPhoto
andInputMediaVideo
- Added parameter
provider_data
to methodsendInvoice
- Better exception handling in
telepot.aio.api
module
- Bot API 3.4
- Live location:
- Added
live_period
to methodsendLocation
, and namedtupleInlineQueryResultLocation
andInputLocationMessageContent
- Added method
editMessageLiveLocation
andstopMessageLiveLocation
- Added
- Added method
setChatStickerSet
anddeleteChatStickerSet
- Added
sticker_set_name
andcan_set_sticker_set
to namedtupleChat
- Added
caption_entities
to namedtupleMessage
- Added method
editMessageLiveLocation
andstopMessageLiveLocation
to classEditor
- Added method
setChatStickerSet
anddeleteChatStickerSet
to classAdministrator
- Allowed supplying initial
offset
toMessageLoop
- Allowed Bot API access through proxy
- Bot API 3.3
- Added new fields to namedtuple
Chat
,Message
, andUser
- Included
aiohttp.ClientResponseError
in raisingBadHTTPResponse
- Added package
telepot.text
to help format Markdown and HTML by applying entities
- Bot API 3.2
- Added methods:
getStickerSet()
uploadStickerFile()
createNewStickerSet()
addStickerToSet()
setStickerPositionInSet()
deleteStickerFromSet()
- Added namedtuple
StickerSet
,MaskPosition
- Added new fields to
Sticker
- Added
cancel()
to asyncMessageLoop
(no change to traditional counterpart)
- Bot API 3.1
- Added methods:
restrictChatMember()
promoteChatMember()
exportChatInviteLink()
setChatPhoto()
deleteChatPhoto()
setChatTitle()
setChatDescription()
pinChatMessage()
unpinChatMessage()
- Added parameter
until_date
to methodkickChatMember()
- Added fields to namedtuple
Chat
andChatMember
- Added namedtuple
ChatPhoto
- Added exception
NotEnoughRightsError
to capture situations where the bot does not have enough rights to perform operations on channels, groups, or supergroups. - Changed some internal function names to be more descriptive, e.g.
_yell()
becomes_invoke()
,_delay_yell()
becomes_create_invoker()
. - Tested on Python 3.6.1
- Bot API 3.0
- Can receive updates containing ShippingQuery and PreCheckoutQuery
- Added flavors
shipping_option
andpre_checkout_query
- Added nametuples
Invoice
,LabeledPrice
,ShippingOption
,ShippingAddress
,OrderInfo
,ShippingQuery
,PreCheckoutQuery
,SuccessfulPayment
- Added method
sendInvoice()
,answerShippingQuery()
, andanswerPreCheckoutQuery()
- Added method
deleteMessage()
andsendVideoNote()
. Added namedtupleVideoNote
. - Added new fields to various namedtuples
- Added function
per_invoice_payload
and classInvoiceHandler
- Async version compliant with aiohttp2
- Added
telepot.loop
andtelepot.aio.loop
module. Methodmessage_loop()
deprecated. Use classMessageLoop
,OrderedWebhook
, orWebhook
instead.
- In
message_loop()
, delay longer between HTTP 502 responses - Handled empty JSON responses (async version)
- Added
quote_fields
parameter to aiohttp hack - Fixed dependency at
aiohttp==1.3
- Async Bot's scheduler method
event_at()
was modified to use unix timestamp
- Added parameter
max_connections
andallowed_updates
to methodsetWebhook()
- Added parameter
allowed_updates
to methodgetUpdates()
andmessage_loop()
- Added method
deleteWebhook()
- Recognized
channel_post
andedited_channel_post
in Update object - Removed flavor
edited_chat
. Keep 4 flavors:chat
,callback_query
,inline_query
, andchosen_inline_result
. When dealing withchat
messages, it is up to the user to differentiate between various kinds, e.g. new/edited, private/group/supergroup/channel, etc. setGameScore()
has parameterforce
anddisable_edit_message
answerCallbackQuery()
has parametercache_time
Message
namedtuple has fieldforward_from_message_id
- Renamed
ReplyKeyboardHide
toReplyKeyboardRemove
- Used the presence of
chat_instance
to recognize the flavorcallback_query
- Implemented Gaming Platform stuff
- Added game-related methods, e.g.
sendGame
,setGameScore
, etc. - Added game-related namedtuple, e.g.
InlineQueryResultGame
, etc. telepot.glance()
may return content typegame
- Added method
getWebhookInfo
- Added new parameters to some methods, e.g.
caption
forsendAudio()
, etc. - Handled
EventNotFound
inIdleEventCoordinator.refresh()
- Changed the name
pave_callback_query_origin_map()
tointercept_callback_query_origin()
- Added
include_callback_query_chat_id()
- I am finally satisfied with callback query handling. Many styles of dealing with callback query are now possible.
- Added a few
per_callback_query_*()
seeder factories - Added a few pair producers, e.g.
pave_event_space()
,pave_callback_query_origin_map()
- Added
Bot.Scheduler
to schedule internal events - Invented a standard event format for delegates to create their own events easily
- Improved Mixin framework. Added
StandardEventMixin
,IdleTerminateMixin
, andInterceptCallbackQueryMixin
. - Added
CallbackQueryOriginHandler
- Revamped
Listener
and message capture specifications - Default
retries=3
forurllib3
- Relaxed
urllib3>=1.9.1
insetup.py
- Fixed
urllib3==1.9.1
insetup.py
- Handling of callback query still unsatisfactory, a transitional release
- Changed async version to
telepot.aio
to avoid collision withasync
keyword - Added
CallbackQueryCoordinator
andCallbackQueryAble
to facilitate transparent handling ofCallbackQuery
- Added
AnswererMixin
to give anAnswerer
instance - Added
Timer
to express different timeout behaviors - Added
enable_callback_query
parameter to*Handler
constructors - Added default
on_timeout
method to@openable
decorator - Added
IdleTerminate
andAbsentCallbackQuery
as subclasses ofWaitTooLong
to distinguish between different timeout situations - Revamped
Listener
to handle different timeout requirements - Added
types
parameter toper_chat_id()
- By default,
per_from_id()
andUserHandler
reacts to non-callback_query
only - Fixed
Bot.download_file()
- Added docstrings for Sphinx generation
- Re-organized examples
- Added flavor
edited_chat
and handler functionon_edited_chat_message
- New Bot API methods:
getChat
,leaveChat
,getChatAdministrators
,getChatMember
, andgetChatMembersCount
- Added namedtuple
ChatMember
and other new fields - No longer dependent on
requests
. Useurllib3
throughout (traditional version). - Start adding docstring and using Sphinx to generate documentations.
- Added HTTP connection pooling (for both traditional and async version). Bot API requests are much speedier.
- Most requests are now done with
urllib3
, moving away fromrequests
. - Added module
telepot.routing
andtelepot.async.routing
to provide common key functions and routing tables forRouter
to use. - Removed method
set_key_function
andset_routing_table
fromRouter
. Access instance variablekey_function
androuting_table
instead. - Added function
telepot.message_identifier
to extract message identifier for editing messages. - Added helper class
Editor
to ease editing messages. ChatHandler
, by default, also capturescallback_query
from the same user.- Added
InlineUserHandler
to capture only inline-related messages. - Async version uses
async
/await
, stops supporting Python 3.4, works on Python 3.5+ from now on.
- Patched
requests
andaiohttp
to send unicode filenames
- Bot API 2.0
- Added new flavor
callback_query
- Added a bunch of namedtuples to reflect new objects in Bot API
- Added methods:
sendVenue()
,sendContact()
kickChatMember()
,unbanChatMember()
answerCallbackQuery()
editMessageText()
,editMessageCaption()
,editMessageReplyMarkup()
- To
ChatContext
, added a propertyadministrator
- Added new flavor
- Added
telepot.exception.MigratedToSupergroupChatError
- Backward-incompatible name changes
- Flavor
normal
→chat
- Method
notifyOnMessage
→message_loop
- Method
messageLoop
→message_loop
- Method
downloadFile
→download_file
- Function
telepot.namedtuple.namedtuple
was removed. Create namedtuples using their constructors directly. - Function
telepot.glance2
was removed. Usetelepot.glance
. - Chat messages' content type returned by
telepot.glance
:new_chat_participant
→new_chat_member
left_chat_participant
→left_chat_member
- Flavor
- Added underlying response object to
BadHTTPResponse
and underlying JSON object toTelegramError
- Added
TooManyRequestsError
as a subclass toTelegramError
- Added a few
TelegramError
subclasses to indicate specific errors - Override
BadHTTPResponse
's__unicode__()
and__str__()
to shorten traceback
- Changed
Answerer
interface. Compute function is now passed to methodanswer()
, not to the constructor. - Added parameter
disable_notification
to methodssendZZZ()
- Added function
telepot.delegate.per_application()
andper_message()
- Used
data
to pass POST parameters to prevent too-long query strings on URL - Async version support pushed back to Python 3.4.2
- Supports file-like object and filename when sending files
- Moved all exceptions to module
telepot.exception
- Expanded testing to Python 3.5
- Introduced automatic message routing to
Bot.handle()
andZZZHandler.on_message()
. Messages are routed to sub-handlers according to flavor, by default. - As an alternative to implementing
Bot.handle(msg)
, you may implementBot.on_chat_message(msg)
,Bot.on_inline_query(msg)
, andBot.on_chosen_inline_result(msg)
as needed. - As an alternative to implementing
ZZZHandler.on_message()
, you may implementZZZHandler.on_chat_message(msg)
,ZZZHandler.on_inline_query(msg)
, andZZZHandler.on_chosen_inline_result(msg)
as needed. notifyOnMessage()
andmessageLoop()
accept a dict as callback, routing messages according to flavor.- Added function
telepot.flavor_router()
, classestelepot.helper.Router
andtelepot.helper.DefaultRouterMixin
, and their async counterparts to facilitate message routing. - Many functions in
telepot.delegate
andtelepot.helper
now have aliases in their respective async modules, making imports more symmetric.
- Added
Answerer
class to better deal with inline queries - Made
telepot.glance()
equivalent totelepot.glance2()
. Developers are encouraged to usetelepot.glance()
from now on. - Added
telepot.flance()
, a combination oftelepot.flavor()
andtelepot.glance()
.
- Handle new field
chosen_inline_result
in Update object telepot.flavor()
returns a new flavorchosen_inline_result
- Added
telepot.namedtuple.ChosenInlineResult
class
- Changed normal message's flavor to
normal
- Moved all namedtuple-related stuff to a new module
telepot.namedtuple
. All calls to the functiontelepot.namedtuple()
should be changed totelepot.namedtuple.namedtuple()
- Added a function
telepot.flavor()
to differentiate between a normal message and an inline query - Added
flavor
parameter totelepot.glance2()
to extract info according to message flavor notifyOnMessage()
andmessageLoop()
can handle inline query as well as normal chat messages- Added a few
per_XXX_id()
functions useful for spawning delegates for inline queries - Added
UserHandler
reply_markup
parameter can accept namedtuplesReplyKeyboardMarkup
,ReplyKeyboardHide
,ForceReply
as values
- Added webhook interface
- Added
supergroup_chat_created
,migrate_to_chat_id
,migrate_from_chat_id
, andchannel_chat_created
fields to Message
- Added
openable()
class decorator - Default
on_close()
prints out exception - Async
SpeakerBot
andDelegatorBot
constructor acceptsloop
parameter
- Revamped
Listener
andChatHandler
architecture - Added
create_open()
- Conforms to latest Telegram Bot API as of October 8, 2015
- Added
Chat
class, removedGroupChat
- Added
glance2()
- Added
per_chat_id_except()
- Added lock to
Microphone
, make it thread-safe
- Added listener and delegation mechanism
- Conforms to latest Telegram Bot API as of September 18, 2015
- Added
getFile()
anddownloadFile()
method - Added
File
namedtuple - Removed
file_link
field from namedtuples
- In async
messageLoop()
, a regular handler function would be called directly, whereas a coroutine would be allocated a task, usingBaseEventLoop.create_task()
. - In
messageLoop()
andnotifyOnMessage()
, therelax
time default is now 0.1 second.
- Fixed
pip install
syntax error - Having wasted a lot of version numbers, I finally get a better hang of setup.py, pip, and PyPI.
- Conforms to latest Telegram Bot API as of September 7, 2015
- Added an async version for Python 3.4
- Added a
file_link
field to some namedtuples, in response to a not-yet-documented change in Bot API - Better exception handling on receiving invalid JSON responses
- On receiving unexpected fields,
namedtuple()
would issue a warning and would not break.
- Conforms to latest Telegram Bot API as of August 29, 2015
- Added
certificate
parameters tosetWebhook()
- Added
telepot.glance()
andtelepot.namedtuple()
- Consolidated all tests into one script
- Use MIT license
- Conforms to latest Telegram Bot API as of August 15, 2015
- Added
sendVoice()
- Added
caption
andduration
parameters tosendVideo()
- Added
performer
andtitle
parameters tosendAudio()
- Test scripts test the module more completely