From 2595c9de1020ba0b1b2072957c35fcfb3a8319a9 Mon Sep 17 00:00:00 2001 From: Mellow <89431994+mellow-org@users.noreply.github.com> Date: Wed, 28 Aug 2024 02:02:53 +0900 Subject: [PATCH 1/6] [Trivia] Correct typos in World Cup trivia list for Golden Glove questions (#6441) --- redbot/cogs/trivia/data/lists/worldcup.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/redbot/cogs/trivia/data/lists/worldcup.yaml b/redbot/cogs/trivia/data/lists/worldcup.yaml index 24f7e345056..918e024b851 100644 --- a/redbot/cogs/trivia/data/lists/worldcup.yaml +++ b/redbot/cogs/trivia/data/lists/worldcup.yaml @@ -637,16 +637,16 @@ Who won the Golden Boot award in 2022 Qatar?: # Golden Glove -Who won the Golden Boot award in 2010 South Africa?: +Who won the Golden Glove award in 2010 South Africa?: - Iker Casillas - Casillas -Who won the Golden Boot award in 2014 Brazil?: +Who won the Golden Glove award in 2014 Brazil?: - Manuel Neuer - Neuer -Who won the Golden Boot award in 2018 Russia?: +Who won the Golden Glove award in 2018 Russia?: - Thibaut Courtois - Courtois -Who won the Golden Boot award in 2022 Qatar?: +Who won the Golden Glove award in 2022 Qatar?: - Emiliano Martínez - Martínez - Martinez From 907a3f7561c074600f4f545cef960cc0f253c4c1 Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Wed, 28 Aug 2024 15:47:35 +0200 Subject: [PATCH 2/6] Split out non-Python assets in Publish Release workflow (#6440) --- .github/workflows/publish_release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index e2251129944..975aefbf5be 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -98,14 +98,14 @@ jobs: env: APP_YML_FILE: "Red-DiscordBot-${{ github.ref_name }}-default-lavalink-application.yml" run: | - mkdir -p dist - python .github/workflows/scripts/get_default_ll_server_config.py "dist/$APP_YML_FILE" + mkdir -p release_assets + python .github/workflows/scripts/get_default_ll_server_config.py "release_assets/$APP_YML_FILE" - name: Upload default application.yml uses: actions/upload-artifact@v3 with: name: ll-default-server-config - path: ./dist + path: ./release_assets release_to_pypi: needs: @@ -129,13 +129,13 @@ jobs: uses: actions/download-artifact@v3 with: name: ll-default-server-config - path: dist/ + path: release_assets/ - name: Upload dists to GitHub Release env: GITHUB_TOKEN: "${{ github.token }}" run: | - gh release upload "$GITHUB_REF_NAME" dist/* --repo "$GITHUB_REPOSITORY" + gh release upload "$GITHUB_REF_NAME" dist/* release_assets/* --repo "$GITHUB_REPOSITORY" - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 From 05cf9b7f399e79f87c59f3353742e83c8b4538f4 Mon Sep 17 00:00:00 2001 From: Kreusada <67752638+Kreusada@users.noreply.github.com> Date: Sun, 1 Sep 2024 22:40:12 +0100 Subject: [PATCH 3/6] Add `header`, `hyperlink` and `subtext` utilities (#6102) Co-authored-by: Kowlin <10947836+Kowlin@users.noreply.github.com> --- redbot/core/utils/chat_formatting.py | 68 +++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/redbot/core/utils/chat_formatting.py b/redbot/core/utils/chat_formatting.py index b13d869dc02..a65417b298c 100644 --- a/redbot/core/utils/chat_formatting.py +++ b/redbot/core/utils/chat_formatting.py @@ -5,7 +5,7 @@ import math import textwrap from io import BytesIO -from typing import Iterator, List, Optional, Sequence, SupportsInt, Union +from typing import Iterator, List, Literal, Optional, Sequence, SupportsInt, Union import discord from babel.lists import format_list as babel_list @@ -21,11 +21,14 @@ "question", "bold", "box", + "header", + "hyperlink", "inline", "italics", "spoiler", "pagify", "strikethrough", + "subtext", "underline", "quote", "escape", @@ -39,6 +42,69 @@ _ = Translator("UtilsChatFormatting", __file__) +def hyperlink(text: str, url: str) -> str: + """Create hyperlink markdown with text and a URL. + + Parameters + ---------- + text : str + The text which will contain the link. + url : str + The URL used for the hyperlink. + + Returns + ------- + str + The new message. + + """ + return f"[{text}]({url})" + + +def header(text: str, size: Literal["small", "medium", "large"]) -> str: + """Formats a header. + + Parameters + ---------- + text : str + The text for the header. + url : Literal['small', 'medium', 'large'] + The size of the header ('small', 'medium' or 'large') + + Returns + ------- + str + The new message. + + """ + if size == "small": + multiplier = 3 + elif size == "medium": + multiplier = 2 + elif size == "large": + multiplier = 1 + else: + raise ValueError(f"Invalid size '{size}'") + return "#" * multiplier + " " + text + + +def subtext(text: str) -> str: + """Formats subtext from the given text. + + Parameters + ---------- + text : str + The text to format as subtext. + + Returns + ------- + str + The new message. + + """ + return "-# " + text + + def error(text: str) -> str: """Get text prefixed with an error emoji. From f3c89ad8bd9072264d816f598ddcb086f0b9abf0 Mon Sep 17 00:00:00 2001 From: Kreusada <67752638+Kreusada@users.noreply.github.com> Date: Sun, 1 Sep 2024 23:51:14 +0100 Subject: [PATCH 4/6] Fix `header` utility docstring (#6444) --- redbot/core/utils/chat_formatting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redbot/core/utils/chat_formatting.py b/redbot/core/utils/chat_formatting.py index a65417b298c..9a96ae380c6 100644 --- a/redbot/core/utils/chat_formatting.py +++ b/redbot/core/utils/chat_formatting.py @@ -68,7 +68,7 @@ def header(text: str, size: Literal["small", "medium", "large"]) -> str: ---------- text : str The text for the header. - url : Literal['small', 'medium', 'large'] + size : Literal['small', 'medium', 'large'] The size of the header ('small', 'medium' or 'large') Returns From d304da7a16bb61cd3692a67de8c5d88e2d5d0c6b Mon Sep 17 00:00:00 2001 From: Kreusada Ignar Yadrak <67752638+Kreusada@users.noreply.github.com> Date: Wed, 11 Sep 2024 04:32:18 +0100 Subject: [PATCH 5/6] [Downloader] Support `[botname]` substitutions in cog install messages (#6443) --- redbot/cogs/downloader/downloader.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/redbot/cogs/downloader/downloader.py b/redbot/cogs/downloader/downloader.py index 267d5e8d1c7..fc496f0c7ed 100644 --- a/redbot/cogs/downloader/downloader.py +++ b/redbot/cogs/downloader/downloader.py @@ -608,7 +608,11 @@ async def _repo_add( else: await ctx.send(_("Repo `{name}` successfully added.").format(name=name)) if repo.install_msg: - await ctx.send(repo.install_msg.replace("[p]", ctx.clean_prefix)) + await ctx.send( + repo.install_msg.replace("[p]", ctx.clean_prefix).replace( + "[botname]", ctx.me.display_name + ) + ) @repo.command(name="delete", aliases=["remove", "del"], require_var_positional=True) async def _repo_del(self, ctx: commands.Context, *repos: Repo) -> None: From 005b8af10aaddd471fca70c7960f271ddc671344 Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Wed, 11 Sep 2024 05:32:36 +0200 Subject: [PATCH 6/6] Update docs vars to work with RTD changes (#6410) --- docs/_templates/layout.html | 2 +- docs/conf.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index 996058f3102..4ee04f8e727 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -5,7 +5,7 @@

Warning

This document is for Red's development version, which can be significantly different from previous releases. - If you're a regular user, you should read the Red documentation for the current stable release. + If you're a regular user, you should read the Red documentation for the current stable release.

{% endif %} diff --git a/docs/conf.py b/docs/conf.py index b967f299d28..c280f1b2978 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -139,6 +139,9 @@ "github_user": "Cog-Creators", "github_repo": "Red-DiscordBot", "github_version": "V3/develop", + "version_slug": os.environ.get("READTHEDOCS_VERSION", ""), + "rtd_language": os.environ.get("READTHEDOCS_LANGUAGE", ""), + "READTHEDOCS": os.environ.get("READTHEDOCS", "") == "True", } # Add any paths that contain custom static files (such as style sheets) here,