Commit graph

21 commits

Author SHA1 Message Date
9545ca1218
fix(bot): mark messages as read after processing
Added functionality to mark messages as read after processing events to enhance usability and tracking. Also corrected formatting in help command documentation by fixing escape characters.
2024-06-16 18:58:50 +02:00
6e1a50c606
fix(bot): conditionally send error messages in debug mode
All checks were successful
Python Package CI/CD / Setup and Test (push) Successful in 41s
Python Package CI/CD / Publish to PyPI (push) Successful in 43s
Modified the RSS feed error handling to send error messages to the chat room only in debug mode, reducing unnecessary messages for non-debug environments. Incremented project version to 0.1.8 to reflect these updates and improvements.
2024-06-16 18:51:11 +02:00
788b15b151
feat(help): add backfill option to addfeed command
Enhanced the addfeed command to support an optional --backfill
parameter, allowing users to include all current entries when
bridging a new feed. This provides more flexibility in feed
management and ensures no entries are missed during the initial
setup.
2024-06-16 17:59:25 +02:00
ec505cfc3b
feat(bot): add operator property to RSSBot class
Introduced a new 'operator' property to the RSSBot class that retrieves the bot operator's name from the configuration file. Defaults to "your Matrix administrator" if not specified. Enhances configuration clarity and accessibility by allowing easy retrieval of the bot operator information.
2024-06-16 17:54:29 +02:00
e28dcaf942
fix(bot): order RSS entries by published or updated date
Sorted feed entries by published date first, falling back to
updated date if published date is unavailable. This ensures
RSS entries are processed in a consistent temporal order,
improving the accuracy of feed updates and user notifications.
2024-06-16 08:40:36 +02:00
709144c339
feat: add feedback messages on feed removal
Enhances user experience by adding confirmation messages after removing a feed, whether by index or URL. This improvement helps users quickly verify that their intended action was successfully completed and mitigates confusion about the state of their feeds list.
2024-06-16 08:33:50 +02:00
79391d1cc5
feat(bot): support backfilling RSS feed history
All checks were successful
Python Package CI/CD / Setup and Test (push) Successful in 1m12s
Python Package CI/CD / Publish to PyPI (push) Successful in 1m5s
Added the ability to backfill messages from an RSS feed upon adding it to a room. Users can now add the `--backfill` flag when using the `addfeed` command to retrieve and post historical entries from the feed. This enhancement improves user experience by ensuring no important feed information is missed.
2024-06-16 08:28:29 +02:00
08fbba0e0a
feat: add support for proxying feed requests
Introduced optional proxy configuration for fetching RSS feeds,
including support for using Tor SOCKS5 proxy for enhanced privacy.
Added properties to manage proxy settings and updated fetch
functionality to utilize the proxy when necessary. This helps route
requests through specified proxies, supporting privacy use cases
like accessing .onion URLs.
2024-06-15 19:58:15 +02:00
6727d8eabe
fix: improve logging clarity by showing room ID
Updated the logging statement in the RSSBot class to display room IDs instead of room objects when processing feeds. This change ensures that log entries are more informative and easier to understand, especially when debugging issues related to specific rooms. The inclusion of room IDs aids in quick identification and resolution of problems by providing a clear reference to the affected chat room.
2024-05-18 09:08:38 +02:00
d8455ca1d3
feat: Add room-specific event type setting
Introduce the ability for users to override the default event type on a per-room basis in the Matrix RSS bot. By adding a new `eventtype` command and updating the help menu to include this command, users can now specify whether messages in a particular room should be sent as "text" or "notice". This feature provides greater flexibility and customization for room administrators, catering to diverse notification preferences and use cases. The implementation does not validate the event type beyond checking for "text" or "notice", ensuring simplicity in usage while relying on user input accuracy.

This change enhances the bot's versatility in different Matrix environments, allowing for more refined control over how feed updates are communicated within rooms.
2024-05-18 08:58:28 +02:00
7c8d957548
feat: add message event type configuration
Added support for configurable event types for sending messages, enabling use of either "text" or "notice" message types as per user preference. Additionally, this update brings along improvements including code cleanup, updated dependencies to improve functionality and fix potential security issues, and reorganization of example configuration files into a more structured directory. Significant refactorings standardize async task creations and remove unused imports, streamlining the codebase for better maintainability and performance.

- Introduced `EventType` in `config.dist.ini` to allow users to specify the desired event type for outbound messages.
- Upgraded dependency versions in `pyproject.toml`, adding `future` for forward compatibility.
- Removed the deprecated `rssbot-pantalaimon.service` and unused image/file send functions in `bot.py`, focusing on core functionalities.
- Reorganized `pantalaimon.example.conf` into `contrib` directory for better project structure.
- Simplified logging and callback handling, removing redundant code paths and improving code readability.
- Bumped project version to 0.1.2, paving the way for new features and fixes.

This enhancement is aimed at providing users with greater flexibility in how messages are sent, accommodating different use cases and preferences.
2024-05-17 16:49:27 +02:00
02d7441f38
refactor: streamline entry point and update version
Reorganized the script's main execution logic into a `main` function for clearer entry point definition and better maintainability. Updated the project version to 0.1.1, reflecting these changes alongside minor fixes. Adjusted the script reference in `pyproject.toml` to align with the new entry point structure, ensuring proper package execution as a console script. This refactor enhances code readability and supports more flexible future updates.
2024-05-03 15:11:25 +02:00
2729a29807
Improved timestamp handling 2024-03-02 18:03:07 +01:00
db37f31b93
Added error handling for feed processing errors
This commit adds error handling for feed processing errors in the RSS
bot's feed polling logic. The previous version was failing to handle
exceptions that were thrown during the feed parsing process, which could
lead to unpredictable behavior and potential data corruption. This new
version catches any exceptions that occur during the feed parsing step
and logs them, preventing the bot from becoming stuck in an infinite
loop due to these errors.

The changes include a try/except block around the feed parsing code,
where any exceptions are caught and logged using Python's logging
module. The bot's state is not modified when there is an error during
feed processing, which ensures that the bot does not become stuck in an
infinite loop due to errors. Additionally, the commit includes a new
logger method for logging exceptions, which helps identify any issues
with the feed parsing process and prevents them from affecting the bot's
overall performance.

This commit has several benefits:

* It improves the reliability of the RSS bot by handling errors that
could occur during feed processing and preventing the bot from becoming
stuck in an infinite loop due to these errors.
* It makes it easier for users to troubleshoot issues with the RSS bot,
since error messages are now being logged and can be easily identified.
* It helps to prevent data corruption by ensuring that the bot's state
is not modified when there is an error during feed processing.
2024-03-02 17:51:15 +01:00
ec815b1487
Improve feed list handling & ensure unique feeds
This commit improves the handling of the feed list by removing
duplicate entries and ensuring that each feed is only listed once. This
change was made to improve the overall stability and performance of the
RSS bot, as well as to simplify the code and make it easier to maintain.
Additionally, this commit addresses a bug where the `listfeeds` command
would not work correctly if there were multiple feeds with the same URL.

This commit also includes an optimization that reduces the number of
network requests made by the RSS bot when fetching feed content. This
should improve the overall performance and reduce the load on servers
hosting RSS feeds.
2024-03-02 17:44:42 +01:00
bd6210bb4a
Add new "removefeed" command to
support deleting feeds in the Matrix RSS Bot

This commit adds a new "removefeed" command to the Matrix RSS Bot,
which allows users to delete existing RSS feeds from the bot's list of
subscribed feeds. The "removefeed" command is added to the "__init__.py"
file in the "matrix_rssbot/classes/commands" directory.
2024-03-02 17:39:39 +01:00
3b95dc0d3e
Splitting feed processing off into async task 2024-03-02 17:13:04 +01:00
8ea8c9208a
Refactor bot state management logic
This commit refactors the code handling bot state management to
improve readability and modularity. The new implementation uses a more
structured approach to handling different types of events, making it
easier to reason about and maintain. Additionally, it fixes an issue
where the bot was not properly handling errors when putting state in
rooms.

This change should improve the overall stability and performance of the
RSS bot, as well as make it easier for developers to understand and work
with the codebase.
2024-03-02 16:24:47 +01:00
ebb9b245a8
Remove unused Join callback 2024-03-02 15:50:59 +01:00
f11a461ad9
Remove unused Join callback 2024-03-02 15:50:51 +01:00
967d738e64
Created RSSBot 2024-03-02 15:31:14 +01:00