v1.1.1: !rss filter toont het huidige globale filter

This commit is contained in:
eddy 2026-09-05 17:23:02 +02:00
commit 8c5e5a083e
2 changed files with 12 additions and 2 deletions

View file

@ -407,7 +407,7 @@ class RSSBot(Plugin):
await evt.reply(f"Subscribed to {feed_info}") await evt.reply(f"Subscribed to {feed_info}")
@rss.subcommand( @rss.subcommand(
"set-filter", aliases=("f", "filter"), help="Set the global match filter (whitelist regex) for all feeds." "set-filter", aliases=("f",), help="Set the global match filter (whitelist regex) for all feeds."
) )
@command.argument("match_filter", "match filter", pass_raw=True) @command.argument("match_filter", "match filter", pass_raw=True)
async def set_filter(self, evt: MessageEvent, match_filter: str) -> None: async def set_filter(self, evt: MessageEvent, match_filter: str) -> None:
@ -432,6 +432,16 @@ class RSSBot(Plugin):
else: else:
await evt.reply("Global filter removed (all posts will be sent)") await evt.reply("Global filter removed (all posts will be sent)")
@rss.subcommand(
"filter", aliases=("show-filter", "get-filter"), help="Show the current global match filter."
)
async def command_show_filter(self, evt: MessageEvent) -> None:
f = self.config["match_filter"]
if f:
await evt.reply(f"**Current global filter:**\n```\n{f}\n```")
else:
await evt.reply("No global filter is set (all posts are sent)")
@rss.subcommand( @rss.subcommand(
"unsubscribe", aliases=("u", "unsub"), help="Unsubscribe this room from a feed." "unsubscribe", aliases=("u", "unsub"), help="Unsubscribe this room from a feed."
) )

View file

@ -1,5 +1,5 @@
id: nl.eddydevink.rss id: nl.eddydevink.rss
version: 1.1.0 version: 1.1.1
modules: modules:
- buzzrss - buzzrss
main_class: RSSBot main_class: RSSBot