Skip to content

Releases: TrueConf/python-trueconf-bot

v1.4.0b1

29 May 17:16

Choose a tag to compare

v1.4.0b1 Pre-release
Pre-release

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 in FSMContext. It supports nested groups, multiple storage strategies, and state-based filtering via StateFilter. 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_messages parameter in Bot(). By default, it is set to True, so the bot automatically ignores messages sent by itself. It can be disabled with skip_self_messages=False.

v1.3.0

06 May 12:51

Choose a tag to compare

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, and disconnected statuses.
  • Added bot.me_id support for storing the authorized bot identifier.
  • Added the message.mention shortcut, which returns True if the current bot is mentioned in the message or if @all is used.
  • Added the trueconf.utils.formatting module for convenient HTML/Markdown message construction with classes: Text, Bold, Italic, Underline, Strikethrough, Link, Mention, AllMention.
  • Added the truststore dependency for working with the system trusted certificate store.
  • Added the SSLVerify type for unified typing of the verify_ssl parameter: bool | str | ssl.SSLContext.
  • Added the bot.me_chat property as the new name for getting the chat_id of the "Favorites" chat.

Changed:

  • Updated the verify_ssl behavior:
    • verify_ssl=True uses the system trusted certificate store through truststore;
    • verify_ssl=False disables 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 via build_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 truststore or by passing a custom SSL context.

Deprecated:

  • The asynchronous bot.me property, which returns the chat_id of the "Favorites" chat, is now deprecated. Use await bot.me_chat instead.

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(...).
  • 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

04 May 11:36

Choose a tag to compare

Added:

  • Added a 10-second server response timeout; if no response is received, an asyncio.TimeoutError exception will be raised: Request to {self.__api_method__} timed out after {timeout}s (#12).

Fixed:

  • Situations where Mashumaro failed to parse the response, resulting in a crash (#8, #11)

v1.2.3.dev1 — disable version check

04 May 11:52

Choose a tag to compare

Pre-release
disable version check for 5.5.0-5.5.2

v1.2.2

24 Apr 07:37

Choose a tag to compare

Fixed:

  • Fixed the missing dependency: the packaging package, which is required to check the library version at bot startup.

v1.2.1

23 Apr 13:45

Choose a tag to compare

Added:

  • Support for TrueConf Server version 5.5.4
  • Added the receive_system_messages flag to Bot() and Bot.from_credentials() to enable or disable receiving system messages.
  • Added a new bot.get_chat_participant() method, which replaces bot.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.txt and llms-full.txt.

Changed:

  • When retrieving file information via bot.get_file_info(file_id=...), the response now returns the file_id field instead of info_hash.

Deprecated:

  • The bot.has_chat_participant() method has been deprecated. Use bot.get_chat_participant() instead.

v1.2.0

21 Apr 21:46

Choose a tag to compare

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_name parameter 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-magic and filetype libraries 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_retries and the maximum delay between attempts via ws_max_delay (#6).
  • Added TrueConf Server version validation: the library now raises a RuntimeError with 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_text utility. This is especially useful for AI agents generating long responses.
  • Added AI-friendly documentation builds: llms.txt and llms-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 filename and mimetype parameters are now deprecated.
  • Please migrate to the new snake_case parameter naming, as the old parameters will be removed in future versions.

v1.1.10

17 Apr 14:41

Choose a tag to compare

Fixed:

  • The file_id parameter was missing in SendFileResponse.

v1.2.0b3

07 Apr 21:03

Choose a tag to compare

v1.2.0b3 Pre-release
Pre-release

Added:

  • Added filetype library 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 uv package manager.

v1.2.0b2

06 Apr 18:08

Choose a tag to compare

v1.2.0b2 Pre-release
Pre-release

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_history parameter to Bot.remove_participant_from_chat().

Fixed:

  • Fixed issue with sending stickers in TrueConf Server 5.5.3+.