Skip to content

Commit

Permalink
refact(rss): remove the mentions variable from the /rss set-text docu…
Browse files Browse the repository at this point in the history
…mentation
  • Loading branch information
ZRunner committed Dec 5, 2024
1 parent 0f12cdb commit 130f1cd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 19 deletions.
1 change: 0 additions & 1 deletion docs/rss.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ If the rss feed ID is not given, the bot will open a menu to select it. And for
- :code:`{timestamp}`: the `Unix time <https://en.wikipedia.org/wiki/Unix_time>`__ in seconds, usable in `Discord timestamp markdown <https://discord.com/developers/docs/reference#message-formatting-timestamp-styles>`__
- :code:`{link}` or :code:`{url}`: a link to the post
- :code:`{logo}`: an emoji representing the type of post (web, YouTube, Reddit...)
- :code:`{mentions}`: the list of mentioned roles
- :code:`{title}`: the title of the post
- :code:`{full_text}`: the full text of the post
- :code:`{description}`: the description/summary of the post
Expand Down
13 changes: 6 additions & 7 deletions lang/rss/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"ask-roles-hint-example": "For example:\n> Members \"Super VIP\" @Ping roles",
"bluesky": "Bluesky",
"bluesky-default-flow": "{logo} | New post of {author}! ({date})\n\n{title}\n\nLink: {link}\n\n{mentions}",
"bluesky-default-flow": "{logo} | New post of {author}! ({date})\n\n{title}\n\nLink: {link}",
"bluesky-form-last": "{logo} | Here is the last post of {author}:\nWritten on {date}\n\n{title}\n\nLink: {url}",
"change-txt": {
"title": "Edit your feed text",
Expand All @@ -24,7 +24,6 @@
"timestamp": "`{timestamp}`: the Unix time of the post in seconds, usable in Discord timestamp markdown",
"link": "`{link}` or `{url}`: a link to the post",
"logo": "`{logo}`: an emoji representing the type of post (web, Reddit, YouTube...)",
"mentions": "`{mentions}`: the list of mentioned roles",
"title": "`{title}`: the title of the post",
"full_text": "`{full_text}`: the full text of the post, if available",
"description": "`{description}`: the description/summary of the post, if available"
Expand All @@ -50,7 +49,7 @@
"one": "The feed has been successfully enabled!"
},
"deviant": "DeviantArt",
"deviant-default-flow": "{logo} | New creation by {author}: **{title}**\nPublished on {date}\nLink: {link}\n{mentions}",
"deviant-default-flow": "{logo} | New creation by {author}: **{title}**\nPublished on {date}\nLink: {link}",
"deviant-form-last": "{logo} | Here is the new creation of {author}:\n{title}\nPublished on {date}\nLink: {url}",
"embed-json-changed": "The embed of this feed has been modified",
"filter": {
Expand Down Expand Up @@ -129,23 +128,23 @@
},
"too-long": "You waited too long, sorry :hourglass:",
"tw": "Twitter",
"tw-default-flow": "{logo} | New tweet of {author}! ({date})\n\n{title}\n\nLink: {link}\n\n{mentions}",
"tw-default-flow": "{logo} | New tweet of {author}! ({date})\n\n{title}\n\nLink: {link}",
"tw-form-last": "{logo} | Here is the last tweet of {author}:\nWritten on {date}\n\n{title}\n\nLink: {url}",
"tw-no-tweet": "It looks like this user has never tweeted :confused:",
"twitch": "Twitch",
"twitch-default-flow": "{logo} | New clip by {author}! ({date})\n\n{title}\n\nLink: {link}\n\n{mentions}",
"twitch-default-flow": "{logo} | New clip by {author}! ({date})\n\n{title}\n\nLink: {link}",
"twitch-form-last": "{logo} | Here is the last video of {author}:\n{title}\nPublished on {date}\nLink: {url}\n",
"twitch-invalid": "Oops, I couldn't find any Twitch channel with this name!",
"use_embed-same": "The use of embeds for this feed has not changed",
"use_embed-success": "The value has been modified to %{v} for feed n°%{id}!",
"use_embed_false": "This feed does not use embed to be sent. Do you want to use an embed for this feed? (true/false)",
"use_embed_true": "This feed currently uses embeds to be sent. Do you still want to use an embed for this feed? (true/false)",
"web": "Web",
"web-default-flow": "{logo} | New post on {channel} ({date}):\n {title}\n\n{link}\n\n{mentions}",
"web-default-flow": "{logo} | New post on {channel} ({date}):\n {title}\n\n{link}",
"web-form-last": "{logo} | Here is the last post on {channel}:\n**{title}**\n*Written on {date}*\nLink: {link}",
"web-invalid": "Oops, this url address is invalid :confused:",
"yt": "YouTube",
"yt-default-flow": "{logo} | New video of {author}: **{title}**\nPublished on {date}\nLink: {link}\n{mentions}",
"yt-default-flow": "{logo} | New video of {author}: **{title}**\nPublished on {date}\nLink: {link}",
"yt-form-last": "{logo} | Here is the last video of {author}:\n{title}\nPublished on {date}\nLink: {url}",
"yt-invalid": "Oops, I couldn't find any YouTube channel with this ID!"
}
13 changes: 6 additions & 7 deletions lang/rss/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"ask-roles-hint-example": "Par exemple:\n> Membres \"Super VIP\" @Notifs",
"bluesky": "Bluesky",
"bluesky-default-flow": "{logo} | Nouveau post de {author} ! ({date})\n\n{title}\n\nLien : {link}\n\n{mentions}",
"bluesky-default-flow": "{logo} | Nouveau post de {author} ! ({date})\n\n{title}\n\nLien : {link}",
"bluesky-form-last": "{logo} | Voici le dernier post de {author}:\nÉcrit le {date}\n\n{title}\n\nLien : {url}",
"change-txt": {
"title": "Modifiez le texte de votre flux",
Expand All @@ -24,7 +24,6 @@
"timestamp": "`{timestamp}`: la date Unix de publication en secondes, utilisable dans la notation de timestamp de Discord",
"link": "`{link}` ou `{url}`: un lien vers le post",
"logo": "`{logo}`: un emoji représentant le type de post (web, Reddit, YouTube...)",
"mentions": "`{mentions}`: la liste des rôles mentionnés",
"title": "`{title}`: le titre du post",
"full_text": "`{full_text}`: le texte complet du post, si disponible",
"description": "`{description}`: la description/le résumé du post, si disponible"
Expand All @@ -50,7 +49,7 @@
"one": "Le flux a été réactivé avec succès !"
},
"deviant": "DeviantArt",
"deviant-default-flow": "{logo} | Nouvelle création de {author} : **{title}**\nPubliée le {date}\nLien : {link}\n{mentions}",
"deviant-default-flow": "{logo} | Nouvelle création de {author} : **{title}**\nPubliée le {date}\nLien : {link}",
"deviant-form-last": "{logo} | Voici la dernière création de {author}:\n{title}\nPubliée le {date}\nLien : {url}",
"embed-json-changed": "L'embed de ce flux a bien été modifié",
"filter": {
Expand Down Expand Up @@ -129,23 +128,23 @@
},
"too-long": "Vous avez trop attendu, désolé :hourglass:",
"tw": "Twitter",
"tw-default-flow": "{logo} | Nouveau tweet de {author} ! ({date})\n\n{title}\n\nLien : {link}\n\n{mentions}",
"tw-default-flow": "{logo} | Nouveau tweet de {author} ! ({date})\n\n{title}\n\nLien : {link}",
"tw-form-last": "{logo} | Voici le dernier tweet de {author}:\nÉcrit le {date}\n\n{title}\n\nLien : {url}\n",
"tw-no-tweet": "Il semble que cet utilisateur n'ait jamais tweeté :confused:",
"twitch": "Twitch",
"twitch-default-flow": "{logo} | Nouveau clip de {author} ! ({date})\n\n{title}\n\nLien : {link}\n\n{mentions}",
"twitch-default-flow": "{logo} | Nouveau clip de {author} ! ({date})\n\n{title}\n\nLien : {link}",
"twitch-form-last": "{logo} | Voici la dernière vidéo de {author}:\n{title}\nPubliée le {date}\nLien : {url}\n",
"twitch-invalid": "Oups, impossible de trouver une chaîne Twitch avec ce nom !",
"use_embed-same": "L'utilisation d'embeds pour ce flux n'a pas changé",
"use_embed-success": "La valeur a bien été modifiée à %{v} pour le flux n°%{id} !",
"use_embed_false": "Ce flux n'utilise pas d'embed pour être envoyé. Voulez-vous utiliser les embeds pour ce flux ? (true/false)",
"use_embed_true": "Ce flux utilise actuellement les embeds pour être envoyé. Voulez-vous toujours utiliser les embeds pour ce flux ? (true/false)",
"web": "Web",
"web-default-flow": "{logo} | Nouveau post sur {channel} ({date}) :\n {title}\n\n{link}\n\n{mentions}",
"web-default-flow": "{logo} | Nouveau post sur {channel} ({date}) :\n {title}\n\n{link}",
"web-form-last": "{logo} | Voici le dernier post de {channel}:\n**{title}**\n*Ecrit le {date}*\nLien : {link}",
"web-invalid": "Oups, cette adresse url est invalide :confused:",
"yt": "YouTube",
"yt-default-flow": "{logo} | Nouvelle vidéo de {author} : **{title}**\nPubliée le {date}\nLien : {link}\n{mentions}",
"yt-default-flow": "{logo} | Nouvelle vidéo de {author} : **{title}**\nPubliée le {date}\nLien : {link}",
"yt-form-last": "{logo} | Voici la dernière vidéo de {author}:\n{title}\nPubliée le {date}\nLien : {url}",
"yt-invalid": "Oups, impossible de trouver une chaîne YouTube avec cet ID !"
}
6 changes: 2 additions & 4 deletions modules/rss/rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,6 @@ async def change_text(self, interaction: discord.Interaction, feed: str | None =
- `{timestamp}`: the Unix time of the post in seconds, usable in Discord timestamp markdown
- `{link}` or `{url}`: a link to the post
- `{logo}`: an emoji representing the type of post (web, Reddit, YouTube...)
- `{mentions}`: the list of mentioned roles
- `{title}`: the title of the post
- `{full_text}`: the full text of the post
- `{description}`: the description/summary of the post
Expand Down Expand Up @@ -953,8 +952,8 @@ async def _send_current_text_and_variabels(self, interaction: discord.Interactio
text = await self.bot._(interaction, "rss.change-txt.confirmation.current-structure", button_label=confirm_label)
text += f"\n```{current_feed_structure}```"
embed_description = await self.bot._(interaction, "rss.change-txt.confirmation.variables-explanation")
for variable in sorted(("author", "channel", "date", "long_date", "timestamp", "link", "logo", "mentions", "title",
"full_text", "description")):
for variable in sorted(
("author", "channel", "date", "long_date", "timestamp", "link", "logo", "title", "full_text", "description")):
embed_description += "\n- " + await self.bot._(interaction, f"rss.change-txt.confirmation.variables.{variable}")
embed = discord.Embed(
title=await self.bot._(interaction, "rss.change-txt.confirmation.variables-title"),
Expand Down Expand Up @@ -1004,7 +1003,6 @@ async def change_embed(self, interaction: discord.Interaction, feed_id: str | No
- `{timestamp}`: the Unix time of the post in seconds, usable in Discord timestamp markdown
- `{link}` or `{url}`: a link to the post
- `{logo}`: an emoji representing the type of post (web, Reddit, YouTube...)
- `{mentions}`: the list of mentioned roles
- `{title}`: the title of the post
- `{full_text}`: the full text of the post
- `{description}`: the description/summary of the post
Expand Down

0 comments on commit 130f1cd

Please sign in to comment.