Commit graph

38 commits

Author SHA1 Message Date
6bd78018ef
feat: Add confirmation message after application submission
Sends a confirmation message to the user once an application
is submitted, thanking them and advising them to wait for
moderator review. Enhances user experience by providing clarity
and reassurance about the submission process.
2024-11-20 21:20:00 +01:00
2e381a4c66
fix: await resolve_room_id for async handling
Switch resolve_room_id to an async call in command handling to prevent blocking operations and enhance performance. This change ensures the bot can handle room ID resolutions non-blockingly, particularly during monitoring and protection operations. It improves the overall responsiveness and reliability of the bot when processing commands that require room ID resolution.
2024-11-12 21:46:31 +01:00
91f16b3a99
fix(commands): correct monitor command parsing
Adjusted the command parsing logic to require a space after "monitor," ensuring proper extraction of the room ID from the user input. This change enhances command reliability and prevents misinterpretations that could lead to incorrect room monitoring behavior.
2024-11-12 21:36:04 +01:00
d847484b5c
fix(bot): ensure correct username parsing for mentions
Adjusted mention handling logic to split the username at the colon, ensuring correct comparison for command processing. This prevents false positives when the username contains additional information post-colon.
2024-11-12 21:34:26 +01:00
f491c8be41
fix(bot): normalize mention case for command handling
Ensure that the bot commands are recognized regardless of the letter casing of the mention. This improves command compatibility and user experience by allowing flexibility in how the bot is invoked. Prior to this change, commands were case-sensitive, potentially leading to inconsistencies in command recognition.
2024-11-12 21:31:25 +01:00
9c514cd9cd
fix(bot): handle room state update failures
Add error handling for room state updates when setting monitored and protected rooms. Log errors and send a notification to the operator room if the update fails. This ensures that failures don't silently occur, providing better feedback and fault management.
2024-11-12 21:21:36 +01:00
7a52188ff6
fix(bot): handle errors in command processing
Wrapped command handling in a try-except block to log errors and notify users of failures in processing commands. Updated the error message for the protect command, and included responses for invalid or unauthorized commands. This enhances robustness and improves user feedback. Adjustments ensure all exceptions are caught, improving usability and maintainability.
2024-11-12 21:07:05 +01:00
400a694362
feat(bot): improve command feedback and logging
Enhanced user feedback for 'monitor', 'unmonitor', 'protect', and 'unprotect' commands by sending messages confirming action status in target rooms. Improved clarity and logging for potential errors such as missing room IDs. Provides users with immediate notification of their command's effect, facilitating better user interaction and error handling.
2024-11-12 20:56:32 +01:00
6b8ccd0336
refactor(bot): simplify command handling logic
Streamlined command handling by decoupling the bot's prefix from commands, reducing redundancy. Commands are now directly matched after splitting the prefix. This change enhances readability, maintains clarity, and potentially reduces command parsing errors. It also ensures commands are processed more consistently. This update should not affect current usage but may facilitate future extensions to command handling rules.
2024-11-10 18:54:58 +01:00
24a095c2d5
feat(bot): enhance room ID resolution for commands
Implemented a more robust method for resolving room IDs in bot commands by introducing a `resolve_room_id` function. This helps handle room aliases and formats gracefully, minimizing errors when monitoring, protecting, or unprotecting rooms. This change improves user experience by ensuring accurate room identification based on different input formats. Also added the `resolve_alias` function to assist in resolving room aliases to IDs. Fixes issue with incorrect room handling when commands used aliases or non-standard room identifiers.
2024-11-10 13:17:44 +01:00
c9a04619de
refactor(bot): rename command prefix to !applicationbot
Updated the command prefix from `!supportbot` to `!applicationbot` to ensure consistent naming across the application, thereby avoiding user confusion. This change applies to all related commands including help, open ticket, invite, close, approve, reject, list, monitor, unmonitor, and protected room actions. This refactor aims to improve clarity and maintain a coherent command structure for users interacting with the bot.
2024-11-09 20:42:02 +01:00
fbce558a63
fix(bot): handle missing room ID in protect command
Improved error handling for the protect command by logging an error message when a room ID is missing, preventing potential crashes from an IndexError. Also, updated ticket naming convention to use "Application" for better clarity.
2024-11-09 20:40:03 +01:00
51a56c0949
refactor(bot): remove unused import statements
Removed the unused import statements for `RoomGetEventResponse` and `MegolmEvent` to improve code readability and maintainability. Unused imports can lead to confusion and unnecessarily inflate the codebase. This cleanup also aids in preventing potential import-related issues in the future.
2024-11-09 16:39:08 +01:00
c1032fd1c5
feat(bot): enhance ticket room invitation process
Added customer notification when a moderator invites themselves to a ticket room, improving transparency and communication. Corrected parameter for inviting operators to ensure proper user identification. Fixed room state update targeting, enhancing data accuracy.
2024-11-09 16:37:17 +01:00
652206a21a
feat(bot): enhance reaction processing logic
Updated the reaction processing mechanism to fetch user and ticket IDs directly from room state events instead of extracting them from messages. This streamlines and improves the robustness of the approval, rejection, and invitation workflows in the application bot. State storage for message-to-ticket mapping was also added to facilitate this process.
2024-11-08 21:28:26 +01:00
8f5935e41d
fix(bot): react in operator room instead of user room
Updated the bot's reactions to be sent to the operator room rather than the user room to ensure that all reactions are correctly coordinated with operations. Removed redundant logging for cleaner output. This change is aimed at improving the message handling accuracy and operational efficiency.
2024-11-08 13:27:03 +01:00
2632527f65
fix(bot): correct message type for emoji reaction
Changed the message type check from `RoomMessageText` to `RoomSendResponse` for accurate handling of sent message responses regarding emoji reactions. This ensures appropriate logging and message processing in compliance with expected response types.
2024-11-08 13:20:48 +01:00
84de0f7eb5
fix(bot): prevent self-sending of "!apply" commands
Ensure that the bot ignores "!apply" commands sent by itself to avoid unnecessary processing and potential loops. Also, add logging for message reactions to aid in debugging and monitoring.
2024-11-08 13:19:28 +01:00
372a719de0
refactor(bot): update event handling for applications
Revises method signatures to directly utilize the `event` object rather than individual message components, streamlining event processing for command and message relays. This change enhances code clarity and maintains consistency across methods.
2024-11-08 13:18:28 +01:00
7bfa875f05
fix(bot): ignore self-reactions and add emoji responses
The bot now ignores reactions from itself, preventing redundant logging and processing. Added functionality to automatically react with approval, pending, and rejection emojis to messages in the operator room. This enhances user interaction and streamlines the application review process.
2024-11-08 13:15:41 +01:00
7df144e107
fix(bot): correct event content access in reactions
Changed the `reaction_callback` method to access reaction event contents through `event.source["content"]` instead of `event.content`. This update addresses issues with data access during reaction handling, preventing potential errors. Added debug logging for improved tracing of reaction events.
2024-11-08 13:10:36 +01:00
105e5c7abe
fix(logging): enhance error logging for message relay
Improved error logs by including the event type when a message relay fails. This aids in debugging by providing more context about the nature of the error.
2024-11-08 13:08:01 +01:00
b33f905b3c
fix(bot): add sender info and error handling
Include the sender's name in bot notifications to enhance user communication. Introduce exception handling and logging when relaying messages to improve debugging and reliability.
2024-11-08 13:06:25 +01:00
0b32442011
feat(bot): add emoji-based application handling
Introduce emoji reaction handling in the application bot to streamline member application decisions. The bot now processes reactions "🟢" to approve, "🔴" to reject, and "🟡" to invite users to operator rooms, automating user management. This enhancement reduces manual intervention and improves efficiency.
2024-11-08 10:31:33 +01:00
1b0d3d4ddd
feat(bot): add reaction event handling
Introduced a callback to handle reaction events in the bot. This enhancement improves user interaction by allowing the bot to respond to reactions, broadening its capability beyond basic message and member events. No impact on existing functionality.
2024-11-08 09:31:36 +01:00
005a407d93
feat(bot): enhance communication during user operations
Added messages to notify the operator room when user invitation or kick actions fail, improving operator awareness. Included notifications to both the monitored and operator rooms when a room starts being monitored, enhancing transparency. Updated ticket terminology to "application" to better reflect the context. Also, added notification to customers when a moderator wishes to join their room, improving user interaction. This enhances clarity and communication efficiency within the application bot's operations.
2024-11-08 09:08:21 +01:00
c5acd76c0a
fix(bot): ensure command handling returns awaitables
Refactored command handling methods to return awaitables directly rather than awaiting them in place. This approach facilitates easier testing and future integration with event loop management strategies. Improves asynchronous function chaining and consistent handling of command execution results.
2024-11-08 08:28:53 +01:00
ac18806308
refactor(bot): improve code readability by reformatting
Refactor the ApplicationBot's methods for enhanced readability. This includes reformatting multiline structures and improving code consistency by adjusting indentation and ensuring uniform string formatting. These changes do not alter functionality but streamline future maintenance and readability. No functional impact or changes to logic were made.
2024-11-08 08:26:18 +01:00
ddc9b05fed
feat(bot): add help command for user and operator roles
Introduced a `help_command` method to provide users and operators with a list of available commands specific to their roles. This enhancement improves user experience by offering quick access to critical command information directly within the chat environment.
2024-11-08 08:25:48 +01:00
45e0f82285
refactor(bot): update ticket references to applications
Replaced occurrences of "ticket" with "application" within bot messages to better reflect the system's functionality focused on application processing rather than ticket management. This change clarifies the user instructions and aligns the terminology with the application's purpose. No functional behavior modifications were made.
2024-11-08 08:00:47 +01:00
64b4a28cef
refactor: rename project to matrix-applicationbot
Update project name and metadata from matrix-supportbot to
matrix-applicationbot to reflect new functionality of handling
space application requests. This includes changes in package
names, author information, and repository URLs to align with
the project's new identity. This helps avoid confusion and
provides clarity on the bot's purpose.
2024-11-08 07:55:29 +01:00
97cd4aeb2f
feat: rename and extend bot for application handling
Renamed the bot from "SupportBot" to "ApplicationBot" to reflect expanded functionality including room application management. Updated README to specify the fork's purpose and extended the bot with features like automated ticket creation for new members, application processing, and command handling for room monitoring and user access management. This enhances the bot's use case by supporting room access applications alongside support tickets.
2024-11-08 07:52:09 +01:00
f343b59cc6
docs: add badges for Matrix, PyPI, and latest commit
Enhanced the README with additional status badges for easier access to:
- Matrix community link
- PyPI package version and Python compatibility
- License information
- Latest Git commit

These additions improve visibility and accessibility of relevant project details for users and contributors.
2024-08-18 19:31:10 +02:00
79f1779ac3
fix(bot): correct ticket ID parsing logic
Adjusted ticket ID extraction to handle commands with three parts instead of two, ensuring proper ticket closure functionality. Updated project version to 0.1.2 to reflect the fix.
2024-08-18 19:24:11 +02:00
bf909c5efb
docs: update README with detailed features and usage
Expanded the README with comprehensive details about the bot's
capabilities, including its features, user and operator commands,
installation steps, and usage instructions. This enhances clarity
for new users and contributors on how to interact with and set
up the bot effectively.
2024-08-18 19:00:44 +02:00
ac2f18b021
chore: update .gitignore to include dist/ directory
Added dist/ directory to .gitignore to prevent distribution files from being tracked by Git. This keeps the repository clean and avoids unnecessary clutter from build artifacts.
2024-08-18 18:54:46 +02:00
14e8d44999
feat: improve bot functionality and logging setup
Enhanced the bot's functionality with several improvements:
- Added YAML dependency for configuration loading
- Introduced detailed logging for better monitoring
- Implemented invite event handling and operator check
- Updated error handling and user feedback messages
- Ensured the bot ignores its own messages

Increased the version to 0.1.1 to reflect these changes.
2024-08-18 18:53:59 +02:00
6447362d04
feat: add initial version of Matrix Support Bot
- Set up CI/CD workflow for Python package publishing to PyPI
- Add MIT License for project
- Create .gitignore file to exclude common Python and project files
- Document project purpose and licensing in README.md
- Add example configuration file (config.yaml.dist)
- Define package metadata and dependencies in pyproject.toml
- Implement SupportBot class for handling support tickets in Matrix
- Implement main script for bot execution and configuration loading

This initial commit establishes the structure and core functionality for the Matrix Support Bot project.
2024-08-18 17:33:56 +02:00