mirror of
https://github.com/maubot/rss.git
synced 2024-10-01 08:25:36 -04:00
Make default notification template configurable
Closes #29 Fixes #24 Co-authored-by: noantiq <timucin.boldt@udo.edu>
This commit is contained in:
parent
18ef939a04
commit
9a75ee4021
@ -8,6 +8,8 @@ spam_sleep: 2
|
||||
# The prefix for all commands
|
||||
# It has to be prefixed with ! in matrix to be recognised
|
||||
command_prefix: "rss"
|
||||
# Default post notification template for new subscriptions
|
||||
notification_template: "New post in $feed_title: [$title]($link)"
|
||||
# Users who can bypass room permission checks
|
||||
admins:
|
||||
- "@user:example.com"
|
||||
|
@ -51,6 +51,7 @@ class Config(BaseProxyConfig):
|
||||
helper.copy("max_backoff")
|
||||
helper.copy("spam_sleep")
|
||||
helper.copy("command_prefix")
|
||||
helper.copy("notification_template")
|
||||
helper.copy("admins")
|
||||
|
||||
|
||||
@ -360,7 +361,9 @@ class RSSBot(Plugin):
|
||||
)
|
||||
await evt.reply(f"{subscriber} had already subscribed this room to {feed_info}")
|
||||
else:
|
||||
await self.dbm.subscribe(feed.id, evt.room_id, evt.sender)
|
||||
await self.dbm.subscribe(
|
||||
feed.id, evt.room_id, evt.sender, self.config["notification_template"]
|
||||
)
|
||||
await evt.reply(f"Subscribed to {feed_info}")
|
||||
|
||||
@rss.subcommand(
|
||||
|
Loading…
Reference in New Issue
Block a user