Skip to content

Releases: Domoel/Advanced-Community-Bot

Advanced Community Bot

Choose a tag to compare

@Domoel Domoel released this 11 Apr 22:53

📦 Changelog

🏷️ Rename to “Advanced Community Bot”

This release introduces a rebranding of the plugin from Community Bot to Advanced Community Bot to differentiate between the OG Community Bot which is still in active development and this fork. Kudos to William Kray for his fantastic work so far!

The change updates the plugin metadata (maubot.yaml) to reflect the new name, improving clarity and better representing the extended feature set and ongoing development of the project.

⚠️ Important: Plugin ID Changed

The plugin id has been updated as part of this release.

As a result, Maubot will treat this as a new plugin, and existing installations will not be upgraded automatically.

To migrate:

  • Install the new plugin as a separate instance
  • Copy your existing configuration into the new instance (recommended via copy & paste)
  • Reconfigure any runtime-specific settings if necessary'

💡 Notes

This is a non-functional change: no behavior or feature changes were introduced. All existing functionality remains unchanged. The release only affects plugin identity and presentation

Community Bot

Choose a tag to compare

@Domoel Domoel released this 11 Apr 18:27

📦 Changelog: Code Refactor & Native Matrix URI links

This update introduces a major improvement to how users and rooms are rendered and linked, alongside a substantial internal refactor of the codebase. The goal was to enhance the user experience in modern Matrix clients while significantly improving maintainability and stability.

🔗 Native Matrix URI Pills for {user} and {room}

The {user} and {room} placeholders have been completely reworked. Instead of rendering as plain text or using matrix.to links, they now use native matrix: URIs. This allows links to be handled directly by the client without relying on external redirects.

In practice, this means that users and rooms are rendered as clickable elements in supporting clients, opening the respective profile or room directly. At the same time, the visual representation has been simplified: {user} now displays only the display name, and {room} only the room name. Prefixes such as @ and # are intentionally omitted by default, resulting in a cleaner and more modern appearance.

This new behavior is applied consistently across all relevant areas, including greetings, join notifications, and reporting messages.

🛠 Improved Reporting and Moderation Messages

Reporting and moderation features have also been updated to take advantage of the new rendering logic. Users and rooms are now displayed using the same pill-style elements, significantly improving readability and interactivity.

Additionally, inspect and event links have been migrated from matrix.to to native matrix: URIs. This enables direct navigation within the client, which makes moderation workflows noticeably faster and more seamless. The same applies to automatically generated redaction messages, which now follow the same consistent URI approach.

🧠 Unified URI and Rendering Logic

As part of these changes, the entire link generation and rendering logic has been unified internally. Central helper functions now handle the creation of user, room, and event URIs, ensuring consistent handling of prefixes such as @, #, !, and $, as well as proper alias fallbacks.

This reduces duplication across the codebase and eliminates a class of bugs related to malformed IDs or inconsistent link formats. Future changes to URI behavior can now be made in a single place.

🧹 Refactoring and Structural Improvements

Beyond the visible changes, the codebase has undergone a significant refactor. The focus was on improving structure, clarifying responsibilities, and reducing complexity in critical code paths.

In particular, the join handling logic has been broken down into smaller, well-defined steps, making the flow easier to understand and maintain. Similar groundwork has been laid in other areas, such as the room replacement logic.

Internal state handling has also been improved. Previously mutable class-level attributes have been moved to instance-level state, preventing unintended side effects and improving reliability during reloads and testing.

In addition, redundant API calls have been reduced by reusing frequently accessed data, such as room and user information, within a single processing flow.

🧪 Improved Test Coverage

Test coverage has been expanded, especially around URI generation and rendering logic. This ensures that key functionality— such as user and room pills, as well as event links — remains stable as the code evolves.

The tests specifically target common edge cases, including prefix stripping and fallback behavior when aliases are missing, helping to prevent regressions in future changes.

⚙️ Notes on Rendering Behavior

The updated rendering of {user} and {room} intentionally omits prefixes like @ and # for a cleaner look. If needed, this behavior can still be adjusted internally via constants in the code. The configuration surface was intentionally kept minimal to avoid unnecessary complexity.

The exact visual appearance of pills depends on the Matrix client in use. Modern clients fully support this rendering style, while older clients may display them as standard hyperlinks.

🧭 Summary

This update represents a significant step toward more modern Matrix integration. It improves the user experience through native, client-handled links while also establishing a much more maintainable and robust foundation for future development of the CommunityBot.

Community Bot

Choose a tag to compare

@Domoel Domoel released this 10 Apr 22:27

🚀 Changelog: Add configurable matrix permalink base, unify user placeholders, and refactor notification rendering

This release represents a significant step forward in terms of consistency, usability, and internal code quality.
A considerable amount of work has gone into unifying previously fragmented logic, improving the developer and administrator experience, and laying a more robust foundation for future development.

✨ Highlights

🔗 Configurable Matrix Link Resolver

One of the most impactful changes in this release is the introduction of a configurable base URL for Matrix permalinks. Previously, all links were tied to https://matrix.to. With version 0.5, this behavior has been generalized through the new configuration option:

matrix_to_base_url: "https://matrix.to"

This allows you to use your own matrix.to-compatible instance, which is particularly valuable in self-hosted environments or when providing a customized user experience. All user and room links generated by the plugin now consistently respect this setting, ensuring a unified and predictable linking behavior across all features.

👤 Improved User and Room Placeholder Semantics

The placeholder system has been fundamentally reworked to better reflect how users expect messages to look in real-world communities. Previously, placeholders tended to expose technical identifiers such as raw Matrix IDs, which often resulted in messages that felt more mechanical than human-readable.

With this release, user-related placeholders have been redesigned to strike a better balance between readability and technical precision. The system now consistently supports the following placeholders:

{user}: Display name if available, otherwise localpart, otherwise full MXID
{user_id}: Full Matrix user ID (e.g. @user:example.org)
{user_link}: Clickable link to the user (uses {user} as visible text in supported clients)
{room}: room name (or room ID if no name is set)
{room_link}: clickable matrix.to-compatible link to the room
{room_id}: raw room ID

In practice, this means that {user} becomes the primary way to reference a user in templates. It resolves to the most human-friendly representation available, making messages feel natural without requiring additional effort from administrators.

At the same time, {user_id} remains available whenever the underlying identifier is needed, for example in moderation contexts or logging. {user_link} complements both by providing a clickable reference: in plaintext contexts it resolves to a standard Matrix permalink, while in clients that support rich formatting it is rendered as a clickable name using the same value as {user}.

This design removes ambiguity and significantly reduces the need for workarounds when writing templates. A message such as:

"{user_link} joined {room_link}"

will appear as a clean, readable sentence in modern clients (e.g. “Alice joined General”, both clickable), while still degrading gracefully to fully functional links in simpler environments.

💬 Dual Rendering (Plaintext + HTML)

To support both modern and legacy clients, messages are now sent using a dual rendering approach. Each message includes both a plaintext body and an HTML-based formatted_body.

This allows capable clients to display rich content such as clickable display names, while simpler clients fall back to a fully functional plaintext version. The result is a noticeably improved user experience without sacrificing compatibility or reliability.

🔄 Improvements & Refactoring

🧩 Unified Rendering Pipeline

Message rendering has been consolidated into a single, shared pipeline. Previously, different parts of the plugin—such as greetings, notifications, and reaction-based messages—used slightly different formatting logic, which could lead to subtle inconsistencies.

With this release, all message generation flows through a central rendering function. This ensures consistent placeholder behavior across all features, reduces duplication, and makes future changes significantly easier to implement and reason about.

🔁 Reaction Handling Refactor

The reaction-based reporting system has been thoroughly cleaned up and aligned with the rest of the plugin’s architecture. Link generation is now handled through shared helper functions rather than inline string construction, and reaction-triggered notifications benefit from the same dual rendering approach used elsewhere.

These changes not only resolve existing edge cases and inconsistencies, but also make the system more maintainable and easier to extend going forward.

🧠 Majority Vote Logic Clarified

The majority vote mechanism has been reviewed and its behavior clarified. The plugin intentionally applies a strict interpretation of majority: more than 50% of eligible users must react before an automatic redaction is triggered.

This means that exactly half of the users is not sufficient; a true majority is required. While this behavior was already present, it is now clearly defined and consistently applied.

🐛 Bug Fixes

⚡ Async Safety Improvements

All blocking calls using time.sleep(...) have been replaced with await asyncio.sleep(...). This ensures that the bot no longer blocks the event loop, improving responsiveness and allowing concurrent events to be processed reliably.

🧱 Internal Improvements

Internally, the codebase has been significantly cleaned up. Reusable helper methods for URL generation and template rendering have been introduced, duplicated logic has been reduced, and overall readability has been improved.

These changes are not directly visible to end users, but they provide a much stronger and cleaner foundation for future development.

📝 Final Notes

Version 0.5 focuses on making the plugin more predictable, easier to configure, and more pleasant to use in real-world community environments. At the same time, it establishes a solid architectural baseline for upcoming features such as template validation, improved display name handling, and more flexible moderation controls I will start to build soon.

Community Bot

Choose a tag to compare

@Domoel Domoel released this 09 Apr 22:03
79e073b

🚀 Changelog: Reporting and Crowd Moderation & Stability Overhaul

This release marks a major milestone for CommunityBot, shifting power to the community while introducing critical stability fixes and quality-of-life improvements for administrators.

🎉 New Features

📢 Reaction-Based Crowd Moderation
Community members can now flag suspicious messages or spam by reacting with specific emojis (default: 🚩 or ⚠️). The bot immediately alerts moderators in their designated notification channel with a direct link to the incident.

⚖️ Majority-Based Auto-Redaction
The bot can now act on community consensus. If more than 50% of the human members in a room report a message, the bot will automatically redact it. This is a game-changer for mitigating overnight spam attacks when moderators are asleep.

✨ Enhancements & UX

🔗 Clickable Room Links for Moderators
To improve moderation UX, room names in both "Message Reported" and "Message Auto-Redacted" alerts are now formatted as clickable HTML links. This allows admins to jump straight into the relevant room with a single click.

🏷️ New Notification Placeholders ({room_link} & {room_id})
Introduced the {room_link} variable for the join_notification_message configuration to display a clickable room name. Additionally, the new {room_id} placeholder allows administrators to build custom deep links (e.g., matrix.to).
Note: The existing {room} variable remains fully backward-compatible and will continue to output the raw text name, ensuring current configurations will not break.

🐛 Bug Fixes & Stability

Fixed Room Alias Resolution ("Sigil Bug")
Commands like room_setpower previously failed when users provided a human-readable room alias (starting with #) instead of a room ID (!). The bot now explicitly resolves aliases using resolve_room_alias before executing state changes.

Robust Room Membership Filtering (403 Error Prevention)
The bot previously attempted to iterate over all child rooms of a space, leading to 403 Forbidden errors if the bot lacked membership in specific rooms. get_space_roomlist now intelligently intersects the space's child rooms with the bot's actually joined rooms, gracefully skipping inaccessible rooms (e.g. policy rooms.

Fixed Async Blocking in Purge Loop
Addressed a severe bug in the kick_users command where a string literal was mistakenly passed to the sleep function (time.sleep("sleep")). This was replaced with await asyncio.sleep(), preventing the entire plugin instance from blocking or freezing during large-scale purge operations.

Sync-Retry Safeguards & Deduplication
Implemented advanced, set-based event tracking to prevent "ghost notifications" and duplicate processing caused by Matrix sync retries or multiple reactions from the same user. Every report is now guaranteed to be processed exactly once.

General Code Refinement
Cleaned up the codebase, fixed indentation issues, and optimized member synchronization performance for larger spaces.

⚙️ Configuration Updates

To take advantage of the new moderation features, add the following to your config.yaml:

# Emojis that trigger a message report
report_emojis:
  - "🚩"
  - "⚠️"

# Automatically redact messages if > 50% of human members report them
auto_redact_majority: true