List of Changes⚓︎
1.3.0⚓︎
Added:
- Added a health-check mechanism for tracking the bot connection state:
- push model via the
Bot(on_health_check=func_callback)callback, which is called when the connection status changes; - pull model via the
bot.health_check()method, which returns the current bot state; connected,authorized, anddisconnectedstatuses.
- push model via the
- Added
bot.me_idsupport for storing the authorized bot identifier. - Added the
message.mentionshortcut, which returnsTrueif the current bot is mentioned in the message or if@allis used. - Added the
trueconf.utils.formattingmodule for convenient HTML/Markdown message construction with classes:Text,Bold,Italic,Underline,Strikethrough,Link,Mention,AllMention. - Added the
truststoredependency for working with the system trusted certificate store. - Added the
SSLVerifytype for unified typing of theverify_sslparameter:bool | str | ssl.SSLContext. - Added the
bot.me_chatproperty as the new name for getting thechat_idof the "Favorites" chat.
Changed:
- Updated the
verify_sslbehavior:verify_ssl=Trueuses the system trusted certificate store throughtruststore;verify_ssl=Falsedisables certificate verification;verify_ssl="/path/to/ca.pem"uses a custom CA bundle;verify_ssl=ssl.SSLContext(...)uses the provided SSL context.
- Updated the SSL logic for WebSocket connections: a single
self.ssl_context, created viabuild_ssl_context(...), is now used. - Updated bot initialization logging: logs now include human-readable information about the SSL context.
Fixed:
- Fixed failures caused by incomplete certificate chains. Certificate chains can now be verified successfully by using the system trusted certificate store through
truststoreor by passing a custom SSL context.
Deprecated:
- The asynchronous
bot.meproperty, which returns thechat_idof the "Favorites" chat, is now deprecated. Useawait bot.me_chatinstead.
Documentation:
- Added Context7 AI Assistant: interactive support for code and documentation.
- Added a new Sending messages documentation section covering:
- getting
chat_id; - sending text messages via
bot.send_message(...); - replying with
reply_message_id; - forwarding messages via
bot.forward_message(...); - text formatting via
trueconf.utils.formatting; - the 4096-character message length limit and using
safe_split_text(...).
- getting
- Added health-check documentation covering:
- push model via callback;
- pull model via
bot.health_check(); - an example of combined usage with an HTTP health endpoint.
- Added and updated docstrings for the formatting module,
Message.mention,verify_ssl, and the health-check API. - Added new sections: Shortcuts, Restrictions, Formatting, Exceptions.
1.2.3⚓︎
Added:
- Added a 10-second server response timeout. If no response is received within the timeout, an
asyncio.TimeoutErroris raised:Request to {self.__api_method__} timed out after {timeout}s(#12).
Fixed:
- Fixed cases where Mashumaro failed to parse a response, which could cause the application to crash (#8, #11).
1.2.2⚓︎
Fixed:
- Fixed a missing dependency: the
packagingpackage, which is required to check the library version at bot startup.
1.2.1⚓︎
Added:
- Added support for TrueConf Server 5.5.4.
- Added the
receive_system_messagesflag toBot()andBot.from_credentials()to enable or disable receiving system messages. - Added the new
bot.get_chat_participant()method, which replacesbot.has_chat_participant().
Fixed:
- Fixed support for TrueConf Server 5.5.3+. Removed an unnecessary version check that prevented the code from running with library version 1.2.0.
- Fixed documentation links to
llms.txtandllms-full.txt.
Changed:
- When retrieving file information via
bot.get_file_info(file_id=...), the response now returns thefile_idfield instead ofinfo_hash.
Deprecated:
- The
bot.has_chat_participant()method has been deprecated. Usebot.get_chat_participant()instead.
1.2.0⚓︎
Added:
- Added support for TrueConf Server 5.5.3, including:
- chat title editing with
bot.edit_chat_title(...); - chat avatar editing with
bot.edit_chat_avatar(...); - chat history clearing with
bot.clear_chat_history(...); - retrieving file storage limits with
bot.get_file_info_upload_limits(...); - a new file transfer approach where the
file_nameparameter is now required forFSInputFile(...)and other file upload methods. - Added caching for file storage limit settings. These settings are now used for pre-upload validation, and the library raises an exception if a file does not meet the configured constraints.
- Added
python-magicandfiletypelibraries for more reliable file type detection based on magic numbers (byte signatures). - Added automatic file extension appending when a filename does not contain an extension.
- Improved WebSocket connection stability with exponential backoff and a configurable retry strategy. You can control the maximum number of reconnection attempts with
ws_max_retriesand the maximum delay between attempts withws_max_delay(#6). - Added TrueConf Server version validation. The library now raises a
RuntimeErrorwith upgrade instructions if an incompatible server version is detected. - Added the
safe_split_textutility for safely splitting long messages exceeding 4096 characters into chunks of up to 4096 characters. This is especially useful for AI agents that generate long responses. - Added AI-friendly documentation builds:
llms.txtandllms-full.txt. - Added and expanded logging.
Fixed:
- Fixed an issue with sending stickers in TrueConf Server 5.5.3+.
- Fixed issue #7.
- Fixed various minor bugs and made general improvements.
Deprecated:
- The
filenameandmimetypeparameters are now deprecated. - Please migrate to the new
snake_caseparameter naming, as the old parameters will be removed in future versions.
1.1.10⚓︎
Fixed:
- Fixed the missing
file_idparameter inSendFileResponse.
1.1.9⚓︎
Added:
- Added TrueConf Server version validation. The library now raises a
RuntimeErrorwith update instructions if an incompatible server version is detected.
1.1.8⚓︎
Fixed:
- Added
verify_sslsupport for WSS connections. Previously, SSL verification was unconditionally bypassed whenhttpswas enabled; it is now correctly controlled by the configuration flag.
1.1.7⚓︎
Added:
- Added
reply_photo,reply_document, andreply_stickershortcut methods to theMessageclass. - Added
reply_message_idsupport to multiple methods and to theSendFileclass.
Fixed:
- Fixed
quote_fieldsbeing set toFalseinaiohttp.FormData. - Set the default value of
last_messagetoNoneinGetChatByIdResponse(fixes #4).
Deprecated:
reply_messageis now deprecated. Usereply_message_idinstead.
1.1.6⚓︎
Refactored:
- Replaced local
verify_sslusage withself.verify_sslin class methods.
1.1.5⚓︎
Fixed:
- Prevented
run()from hanging when the connect task fails. - Properly propagate
ApiErrorExceptionand other errors to the caller.
1.1.4⚓︎
Fixed:
- Removed the
chat_idfield fromRemoveChatResponse(#1).
1.1.3⚓︎
Fixed:
- Fixed event propagation for multiple routers and subrouters.
1.1.2⚓︎
Added:
- Bumped the development status.
- Added
typing_extensionsto dependencies. - Added and updated the downloads badge.
- Added imports for
SelfandUnpackfromtyping_extensions.
Fixed:
- Fixed
Messageshortcuts not working.
1.1.1⚓︎
Added:
- New classes for working with files:
FSInputFile,BufferedInputFile,URLInputFile. More details can be found in the documentation. - Support for displaying message history
display_history = Truewhen adding a user to a group chat or channel. - Support for request and event for:
- role changes in a group chat or channel (request, notification);
- creation of the “Favorites” chat (request, notification).
- Ability to send files with a caption.
- Shortcut
.save_to_favorites()for quickly saving a message to the "Favorites" chat. - The asynchronous property
await bot.me, which returns thechat_idof the "Saved Messages" chat.
Fixed:
- Stickers sent via
bot.send_sticker()were displayed with a background due to an incorrect MIME type. - The method
.remove_participant_from_chat()did not work when an incomplete TrueConf ID was specified. - Error unpacking the participant list due to an incorrect alias.
- Sometimes, when obtaining a token using
.from_credentials(), a400 Bad Requestserror would occur when using a digit password.
Modified:
- The
bot.server_nameproperty has become asynchronous. Use it asawait bot.server_name.
1.0.0⚓︎
🎉 First Release!
- Stable version of the python-trueconf-bot library.
- Support for all major TrueConf ChatBot API methods.
- Aliases and keyboard shortcuts in the aiogram style (message.answer, message.reply, etc.).
- Asynchronous data transmission via the WebSocket protocol.
- Working with files (sending and uploading).
- Documentation: trueconf.github.io/python-trueconf-bot/
- PyPI: pypi.org/project/python-trueconf-bot/