Skip to content

Commit

Permalink
feat(rss): add filter type to /rss list
Browse files Browse the repository at this point in the history
  • Loading branch information
ZRunner committed Dec 1, 2023
1 parent 562c3d8 commit 03b5e0f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions fcts/rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@ async def _get_feeds_for_page(self, page: int):
roles = ", ".join(roles)
if feed.silent_mention:
roles += " <:silent:1093658138567245925>"
# feed filter
filter_state = await self.client._(
ctx.guild.id,
"rss.list-result-filter." + feed.filter_config["filter_type"]
)
# feed name
feed_name: str = feed.link
if feed.type == 'yt' and (channel_name := rss_cog.youtube_rss.get_channel_name_by_id(feed.link)):
Expand All @@ -548,6 +553,7 @@ async def _get_feeds_for_page(self, page: int):
channel=channel,
link=feed_name,
roles=roles,
filter=filter_state,
id=feed.feed_id,
last_post=last_date
))
Expand Down
7 changes: 6 additions & 1 deletion lang/rss/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@
"invalid-link": "Oops, this url address is invalid or incomplete :confused:",
"list": "*Type the number of the feeds to modify*\n\n**Link - Type - Channel - Mentions**\n",
"list-disabled": "(disabled)",
"list-result": "{emoji} {link}\nDiscord channel: {channel}\nMentions: {roles}\nIdentifier: {id}\nLast post: {last_post}",
"list-result": "{emoji} {link}\nDiscord channel: {channel}\nMentions: {roles} | {filter}\nIdentifier: {id}\nLast post: {last_post}",
"list-result-filter": {
"none": "No filter",
"blacklist": "Blacklist filter",
"whitelist": "Whitelist filter"
},
"list-title": {
"one": "List of RSS feeds from the server %{server} (1 feed)",
"many": "List of RSS feeds from the server %{server} (%{count} feeds)"
Expand Down
7 changes: 6 additions & 1 deletion lang/rss/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@
"invalid-link": "Oups, cette adresse url est invalide ou incomplète :confused:",
"list": "*Entrez le numéro du flux à modifier*\n\n**Lien - Type - Salon - Roles**\n",
"list-disabled": "(désactivé)",
"list-result": "{emoji} {link}\nSalon : {channel}\nRôle mentionné : {roles}\nIdentifiant : {id}\nDernier post : {last_post}",
"list-result": "{emoji} {link}\nSalon : {channel}\nRôle mentionné : {roles} | {filter}\nIdentifiant : {id}\nDernier post : {last_post}",
"list-result-filter": {
"none": "Aucun filtre",
"blacklist": "Filtre par liste noire",
"whitelist": "Filtre par liste blanche"
},
"list-title": {
"one": "Liste des flux RSS du serveur %{server} (1 flux)",
"many": "Liste des flux RSS du serveur %{server} (%{count} flux)"
Expand Down

0 comments on commit 03b5e0f

Please sign in to comment.