Releases: TrueConf/python-trueconf-bot
v1.4.0b1
Added:
-
FSM (Finite State Machine) — a finite state machine mechanism. It allows you to implement step-by-step dialogs, such as questionnaires, forms, and setup wizards. States are declared declaratively using
StatesGroup/State, while data is stored inFSMContext. It supports nested groups, multiple storage strategies, and state-based filtering viaStateFilter. Learn more: FSM. -
Middleware — a layer for processing events before and after handlers. It allows you to log events, block them, check access, and modify data. It supports two types: outer middleware, which runs before filters, and inner middleware, which runs after filters. Learn more: Middleware.
-
The
skip_self_messagesparameter inBot(). By default, it is set toTrue, so the bot automatically ignores messages sent by itself. It can be disabled withskip_self_messages=False.
v1.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.
v1.2.3
v1.2.3.dev1 — disable version check
disable version check for 5.5.0-5.5.2
v1.2.2
v1.2.1
Added:
- Support for TrueConf Server version 5.5.4
- Added the
receive_system_messagesflag toBot()andBot.from_credentials()to enable or disable receiving system messages. - Added a new
bot.get_chat_participant()method, which replacesbot.has_chat_participant().
Fixed:
- Support for TrueConf Server versions 5.5.3+. Removed an unnecessary version check that prevented the code from running when using 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.
v1.2.0
TrueConf Server 5.5.3 Support
Support for new features introduced in TrueConf Server 5.5.3 has been added, including:
- chat title editing (
bot.edit_chat_title(...)); - chat avatar editing (
bot.edit_chat_avatar(...)); - chat history clearing (
bot.clear_chat_history(...)); - retrieving file storage limits (
bot.get_file_info_upload_limits(...)); - a new file transfer approach where the
file_nameparameter is now required (FSInputFile(...)and other file upload methods).
Other Improvements
- File storage limit settings are now cached and used for pre-upload validation. If a file does not meet the defined constraints, the library raises an exception.
- Added
python-magicandfiletypelibraries for more reliable file type detection based on magic numbers (byte signatures). - Automatic file extension appending when missing from filenames.
- Improved WebSocket connection stability: added exponential backoff and a configurable retry strategy. You can now control the maximum number of reconnection attempts via
ws_max_retriesand the maximum delay between attempts viaws_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 ability to safely split long messages exceeding 4096 characters into chunks of up to 4096 characters using the
safe_split_textutility. This is especially useful for AI agents generating long responses. - Added AI-friendly documentation builds:
llms.txtandllms-full.txt. - Logging has been added and expanded.
Fixed
- Fixed an issue with sending stickers in TrueConf Server 5.5.3+.
- Fixed issue #7.
- Fixed various minor bugs and made general improvements.
Deprecation
- The
filenameandmimetypeparameters are now deprecated. - Please migrate to the new
snake_caseparameter naming, as the old parameters will be removed in future versions.
v1.1.10
v1.2.0b3
Added:
- Added
filetypelibrary for more reliable file type detection (especially for WebP). - Automatically append file extensions to filenames when they are missing.
Fixed:
- Fixed package installation issues when using the
uvpackage manager.
v1.2.0b2
Added:
- Enhanced WebSocket resilience with exponential backoff and infinite retry strategy (#6).
- TrueConf Server version validation: the library now raises a RuntimeError with update instructions if an incompatible server version is detected.
- Added
clear_historyparameter toBot.remove_participant_from_chat().
Fixed:
- Fixed issue with sending stickers in TrueConf Server 5.5.3+.