From 07d1a8bc0f8fe9ef45e45140669eafd8f525fa4c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 12 Jul 2023 20:00:08 +0400 Subject: [PATCH 01/28] [meta] update pre-commit (#224) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.3.0 → 23.7.0](https://github.com/psf/black/compare/23.3.0...23.7.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0066cee5..5f74df2a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ default_language_version: python: python3.11 repos: - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.7.0 hooks: - id: black - repo: https://github.com/pycqa/isort From c2f482be83df2333ecd40f4c485c73e852c70a8d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jul 2023 16:05:25 +0000 Subject: [PATCH 02/28] [meta]: Bump crowdin/github-action from 1.8.1 to 1.11.0 (#222) Bumps [crowdin/github-action](https://github.com/crowdin/github-action) from 1.8.1 to 1.11.0. - [Release notes](https://github.com/crowdin/github-action/releases) - [Commits](https://github.com/crowdin/github-action/compare/v1.8.1...v1.11.0) --- updated-dependencies: - dependency-name: crowdin/github-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/crowdin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index 1d64e01d..5f242d82 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v3 - name: Update translations - uses: crowdin/github-action@v1.8.1 + uses: crowdin/github-action@v1.11.0 with: download_translations: true commit_message: '[automated] update translations from Crowdin' From c977b1d127629b858235b23dd86e5fe0756d1edb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Aug 2023 14:09:03 +0400 Subject: [PATCH 03/28] [meta]: Bump crowdin/github-action from 1.11.0 to 1.12.0 (#226) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/crowdin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index 5f242d82..53ff4276 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v3 - name: Update translations - uses: crowdin/github-action@v1.11.0 + uses: crowdin/github-action@v1.12.0 with: download_translations: true commit_message: '[automated] update translations from Crowdin' From 3bb3aca93eb38aa20d04a1413d5cb7d6d94897f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 02:23:41 +0400 Subject: [PATCH 04/28] [meta]: Bump actions/checkout from 3 to 4 (#227) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/black.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/crowdin.yml | 2 +- .github/workflows/dependency-review.yml | 2 +- .github/workflows/isort.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index d87dfaa9..f6caaad3 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -8,7 +8,7 @@ jobs: name: Style Check with Black runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "3.8" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index fc01a5a7..63c26e04 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index 53ff4276..2dbe0e02 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Update translations uses: crowdin/github-action@v1.12.0 diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 96aaafd2..4c4e676c 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Checkout Repository' - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 'Dependency Review' uses: actions/dependency-review-action@v3 with: diff --git a/.github/workflows/isort.yml b/.github/workflows/isort.yml index e5c1d506..adf379fb 100644 --- a/.github/workflows/isort.yml +++ b/.github/workflows/isort.yml @@ -8,7 +8,7 @@ jobs: name: Style Check with Isort runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "3.8" From 98ab3ac3455310fe40a2ebb5a393653c0d770abc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 17:14:16 +0400 Subject: [PATCH 05/28] [meta] update pre-commit (#228) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5f74df2a..b7d51c54 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ default_language_version: python: python3.11 repos: - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 23.9.1 hooks: - id: black - repo: https://github.com/pycqa/isort From 0affbbc38343669db8702eb2c824ae56d90b553f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 13:29:08 +0000 Subject: [PATCH 06/28] [meta]: Bump crowdin/github-action from 1.12.0 to 1.13.1 (#229) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/crowdin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index 2dbe0e02..c4149b92 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 - name: Update translations - uses: crowdin/github-action@v1.12.0 + uses: crowdin/github-action@v1.13.1 with: download_translations: true commit_message: '[automated] update translations from Crowdin' From 46873fbb09bb5a3c662b2a5891e50e75c11274c5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 13:34:50 +0400 Subject: [PATCH 07/28] [meta] update pre-commit (#231) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b7d51c54..901b6b6f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ default_language_version: python: python3.11 repos: - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.10.1 hooks: - id: black - repo: https://github.com/pycqa/isort From b6357a88443e26695e5641953c926b43eb48ed91 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:24:10 +0400 Subject: [PATCH 08/28] [meta]: Bump crowdin/github-action from 1.13.1 to 1.14.1 (#233) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/crowdin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index c4149b92..5fac195d 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 - name: Update translations - uses: crowdin/github-action@v1.13.1 + uses: crowdin/github-action@v1.14.1 with: download_translations: true commit_message: '[automated] update translations from Crowdin' From efe2e365839c853bde3d8c990ff69075cf911778 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 18 Nov 2023 23:42:14 +0400 Subject: [PATCH 09/28] [meta] update pre-commit (#234) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 901b6b6f..b7ac9cff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ default_language_version: python: python3.11 repos: - repo: https://github.com/psf/black - rev: 23.10.1 + rev: 23.11.0 hooks: - id: black - repo: https://github.com/pycqa/isort From 630dc4497f057b66b82445cc88751cbf46afcf41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 18:59:45 +0400 Subject: [PATCH 10/28] [meta]: Bump crowdin/github-action from 1.14.1 to 1.15.2 (#235) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/crowdin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index 5fac195d..841f7db4 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 - name: Update translations - uses: crowdin/github-action@v1.14.1 + uses: crowdin/github-action@v1.15.2 with: download_translations: true commit_message: '[automated] update translations from Crowdin' From b73f33c3da971438e25657cfcbbd15cd07dc0f11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Dec 2023 00:20:05 +0400 Subject: [PATCH 11/28] [meta]: Bump github/codeql-action from 2 to 3 (#238) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 63c26e04..822aadff 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -33,7 +33,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: setup-python-dependencies: false languages: ${{ matrix.language }} @@ -45,7 +45,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -59,4 +59,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 From c9b12baa5e4e0c59186e8b98e851c916a3eea62b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 30 Dec 2023 21:02:08 +0400 Subject: [PATCH 12/28] [meta] update pre-commit (#237) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b7ac9cff..5f3b56b0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,11 +4,11 @@ default_language_version: python: python3.11 repos: - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 23.12.1 hooks: - id: black - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort ci: From a85230a4a9df8c28511c7d98badd3df529694125 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 30 Dec 2023 17:06:54 +0000 Subject: [PATCH 13/28] [meta]: Bump actions/setup-python from 4 to 5 (#236) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/black.yml | 2 +- .github/workflows/isort.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index f6caaad3..416932d9 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.8" - run: "python -m pip install black" diff --git a/.github/workflows/isort.yml b/.github/workflows/isort.yml index adf379fb..3b4ecb8c 100644 --- a/.github/workflows/isort.yml +++ b/.github/workflows/isort.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.8" - run: "python -m pip install isort" From 351c26c7e5c7ac1ae963fdfd40ffbbca7332e228 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Jan 2024 14:27:41 +0400 Subject: [PATCH 14/28] [meta]: Bump crowdin/github-action from 1.15.2 to 1.16.0 (#239) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/crowdin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index 841f7db4..03eb4b66 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 - name: Update translations - uses: crowdin/github-action@v1.15.2 + uses: crowdin/github-action@v1.16.0 with: download_translations: true commit_message: '[automated] update translations from Crowdin' From d7d4a04e02b7de2c8b211834fd2b54599c79c8a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 11 Feb 2024 18:09:38 +0400 Subject: [PATCH 15/28] [meta]: Bump crowdin/github-action from 1.16.0 to 1.17.0 (#243) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/crowdin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index 03eb4b66..187392c4 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 - name: Update translations - uses: crowdin/github-action@v1.16.0 + uses: crowdin/github-action@v1.17.0 with: download_translations: true commit_message: '[automated] update translations from Crowdin' From 443315ae4df1b1e1774e2648ce8d7a2186519611 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 11 Feb 2024 18:10:32 +0400 Subject: [PATCH 16/28] [meta]: Bump hmarr/auto-approve-action from 3 to 4 (#244) Bumps [hmarr/auto-approve-action](https://github.com/hmarr/auto-approve-action) from 3 to 4. - [Release notes](https://github.com/hmarr/auto-approve-action/releases) - [Commits](https://github.com/hmarr/auto-approve-action/compare/v3...v4) --- updated-dependencies: - dependency-name: hmarr/auto-approve-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/auto-approve.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 0168a8bb..9105422c 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -8,7 +8,7 @@ jobs: auto-approve: runs-on: ubuntu-latest steps: - - uses: hmarr/auto-approve-action@v3 + - uses: hmarr/auto-approve-action@v4 if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'pre-commit-ci[bot]' || github.actor == 'github-actions[bot]' }} with: github-token: "${{ secrets.REVIEW_TOKEN }}" From 2fbebf6e7cbfa2f7f2cddd88b199de154e0b9458 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 11 Feb 2024 20:25:24 +0400 Subject: [PATCH 17/28] [meta] update pre-commit (#242) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- adminutils/adminutils.py | 24 ++++--- captcha/commands/settings.py | 18 ++--- datautils/datautils.py | 96 +++++++++++++++++--------- datautils/menus.py | 6 +- godvilledata/godvilledata.py | 16 +++-- leveler/commands/lvladmin/badge.py | 6 +- leveler/commands/lvladmin/debugging.py | 8 ++- leveler/commands/lvlset/badge.py | 6 +- leveler/commands/top.py | 25 ++++--- leveler/exp.py | 16 +++-- leveler/menus/top.py | 8 ++- minecraftdata/minecraftdata.py | 26 +++---- steamcommunity/steamcommunity.py | 8 ++- 14 files changed, 160 insertions(+), 105 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5f3b56b0..47119eec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ default_language_version: python: python3.11 repos: - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black - repo: https://github.com/pycqa/isort diff --git a/adminutils/adminutils.py b/adminutils/adminutils.py index 66849830..b905eb95 100644 --- a/adminutils/adminutils.py +++ b/adminutils/adminutils.py @@ -202,9 +202,11 @@ async def emoji_add(self, ctx, name: str, url: str, *roles: discord.Role): roles=roles, reason=get_audit_reason( ctx.author, - _("Restricted to roles: {}").format(", ".join(role.name for role in roles)) - if roles - else None, + ( + _("Restricted to roles: {}").format(", ".join(role.name for role in roles)) + if roles + else None + ), ), ) except discord.InvalidArgument: @@ -245,9 +247,11 @@ async def emote_steal( roles=roles, reason=get_audit_reason( ctx.author, - _("Restricted to roles: {}").format(", ".join(role.name for role in roles)) - if roles - else None, + ( + _("Restricted to roles: {}").format(", ".join(role.name for role in roles)) + if roles + else None + ), ), ) await ctx.tick() @@ -283,9 +287,11 @@ async def emoji_rename( roles=roles, reason=get_audit_reason( ctx.author, - _("Restricted to roles: ").format(", ".join(role.name for role in roles)) - if roles - else None, + ( + _("Restricted to roles: ").format(", ".join(role.name for role in roles)) + if roles + else None + ), ), ) except discord.Forbidden: diff --git a/captcha/commands/settings.py b/captcha/commands/settings.py index 6ae2235f..ba4326f3 100644 --- a/captcha/commands/settings.py +++ b/captcha/commands/settings.py @@ -308,14 +308,14 @@ async def add_roles(self, ctx: commands.Context, *roles: discord.Role): for role in roles: async with self.data.guild(ctx.guild).autoroles() as roles_list: if role.position >= ctx.me.top_role.position: - error[ - role.name - ] = "This role is higher than my highest role in the role hierarchy." + error[role.name] = ( + "This role is higher than my highest role in the role hierarchy." + ) continue if role.position >= ctx.author.top_role.position: - error[ - role.name - ] = "This role is higher than your own in the discord hierarchy." + error[role.name] = ( + "This role is higher than your own in the discord hierarchy." + ) continue if role.id not in roles_list: roles_list.append(role.id) @@ -356,9 +356,9 @@ async def remove_roles(self, ctx: commands.Context, *roles: discord.Role): async with self.data.guild(ctx.guild).autoroles() as roles_list: for role in roles: if role.position >= ctx.author.top_role.position: - error[ - role.name - ] = "This role is higher than your own in the discord hierarchy." + error[role.name] = ( + "This role is higher than your own in the discord hierarchy." + ) continue if role.id in roles_list: roles_list.remove(role.id) diff --git a/datautils/datautils.py b/datautils/datautils.py index 1b2d91df..470fbe5c 100644 --- a/datautils/datautils.py +++ b/datautils/datautils.py @@ -127,8 +127,12 @@ async def fetchwidget(self, ctx, *, server_id: int): em.add_field( name=_("Features"), value="\n".join(_(GUILD_FEATURES.get(f, f)) for f in guild.features).format( - banner=guild.banner and f" [🔗]({guild.banner_url_as(format='png')})" or "", - splash=guild.splash and f" [🔗]({guild.splash_url_as(format='png')})" or "", + banner=guild.banner + and f" [🔗]({guild.banner_url_as(format='png')})" + or "", + splash=guild.splash + and f" [🔗]({guild.splash_url_as(format='png')})" + or "", discovery=getattr(guild, "discovery_splash", None) and f" [🔗]({guild.discovery_splash_url_as(format='png')})" or "", @@ -263,35 +267,55 @@ async def sinfo(self, ctx, *, server: commands.GuildConverter = None): ) em.add_field( name=_("Verification level"), - value=_("None") - if server.verification_level == discord.VerificationLevel.none - else _("Low") - if server.verification_level == discord.VerificationLevel.low - else _("Medium") - if server.verification_level == discord.VerificationLevel.medium - else _("High") - if server.verification_level == discord.VerificationLevel.high - else _("Highest") - if server.verification_level == discord.VerificationLevel.extreme - else _("Unknown"), + value=( + _("None") + if server.verification_level == discord.VerificationLevel.none + else ( + _("Low") + if server.verification_level == discord.VerificationLevel.low + else ( + _("Medium") + if server.verification_level == discord.VerificationLevel.medium + else ( + _("High") + if server.verification_level == discord.VerificationLevel.high + else ( + _("Highest") + if server.verification_level == discord.VerificationLevel.extreme + else _("Unknown") + ) + ) + ) + ) + ), ) em.add_field( name=_("Explicit content filter"), - value=_("Don't scan any messages.") - if server.explicit_content_filter == discord.ContentFilter.disabled - else _("Scan messages from members without a role.") - if server.explicit_content_filter == discord.ContentFilter.no_role - else _("Scan messages sent by all members.") - if server.explicit_content_filter == discord.ContentFilter.all_members - else _("Unknown"), + value=( + _("Don't scan any messages.") + if server.explicit_content_filter == discord.ContentFilter.disabled + else ( + _("Scan messages from members without a role.") + if server.explicit_content_filter == discord.ContentFilter.no_role + else ( + _("Scan messages sent by all members.") + if server.explicit_content_filter == discord.ContentFilter.all_members + else _("Unknown") + ) + ) + ), ) em.add_field( name=_("Default notifications"), - value=_("All messages") - if server.default_notifications == discord.NotificationLevel.all_messages - else _("Only @mentions") - if server.default_notifications == discord.NotificationLevel.only_mentions - else _("Unknown"), + value=( + _("All messages") + if server.default_notifications == discord.NotificationLevel.all_messages + else ( + _("Only @mentions") + if server.default_notifications == discord.NotificationLevel.only_mentions + else _("Unknown") + ) + ), ) em.add_field(name=_("2FA admins"), value=bool_emojify(server.mfa_level)) if server.rules_channel: @@ -432,15 +456,19 @@ async def cinfo( changed_roles = sorted(channel.changed_roles, key=lambda r: r.position, reverse=True) em = discord.Embed( title=chat.escape(str(channel.name), formatting=True), - description=topic - if (topic := getattr(channel, "topic", None)) - else "\N{SPEECH BALLOON}: {} | \N{SPEAKER}: {} | \N{SATELLITE ANTENNA}: {}".format( - len(channel.text_channels), - len(channel.voice_channels), - len(channel.stage_channels), - ) - if isinstance(channel, discord.CategoryChannel) - else discord.Embed.Empty, + description=( + topic + if (topic := getattr(channel, "topic", None)) + else ( + "\N{SPEECH BALLOON}: {} | \N{SPEAKER}: {} | \N{SATELLITE ANTENNA}: {}".format( + len(channel.text_channels), + len(channel.voice_channels), + len(channel.stage_channels), + ) + if isinstance(channel, discord.CategoryChannel) + else discord.Embed.Empty + ) + ), color=await ctx.embed_color(), ) em.add_field(name=_("ID"), value=channel.id) diff --git a/datautils/menus.py b/datautils/menus.py index d78c9fba..d2157a4f 100644 --- a/datautils/menus.py +++ b/datautils/menus.py @@ -168,9 +168,9 @@ def __init__(self, entries): async def format_page(self, menu: ChannelsMenu, entries): e = discord.Embed( title="{}:".format(_(KNOWN_CHANNEL_TYPES[menu.channel_type][1])), - description=chat.box("\n".join(c.name for c in entries)) - if entries - else _("No channels"), + description=( + chat.box("\n".join(c.name for c in entries)) if entries else _("No channels") + ), ) e.set_footer( text=_("Page {}/{} • {}: {} • Total channels: {}").format( diff --git a/godvilledata/godvilledata.py b/godvilledata/godvilledata.py index 69274a4a..c3fb3c9d 100644 --- a/godvilledata/godvilledata.py +++ b/godvilledata/godvilledata.py @@ -95,9 +95,11 @@ async def godville(self, ctx, *, god: GodConverter): text_header = "{} и его {}\n{}\n".format( chat.bold(profile.god), chat.bold(profile.name), - chat.italics(chat.escape(profile.motto.strip(), formatting=True)) - if profile.motto - else chat.inline("Здесь ничего нет"), + ( + chat.italics(chat.escape(profile.motto.strip(), formatting=True)) + if profile.motto + else chat.inline("Здесь ничего нет") + ), ) if profile.arena_is_in_fight: text_header += "В сражении: {}\n".format(profile.fight_type_rus) @@ -212,9 +214,11 @@ async def godvillegame(self, ctx, *, godname: str): text_header = "{} and his {}\n{}\n".format( chat.bold(profile.god), chat.bold(profile.name), - chat.italics(chat.escape(profile.motto.strip(), formatting=True)) - if profile.motto - else chat.inline("Nothing here"), + ( + chat.italics(chat.escape(profile.motto.strip(), formatting=True)) + if profile.motto + else chat.inline("Nothing here") + ), ) if profile.arena_is_in_fight: text_header += "In fight: {}\n".format(profile.fight_type_rus) diff --git a/leveler/commands/lvladmin/badge.py b/leveler/commands/lvladmin/badge.py index fa82aa84..dcbc8f08 100644 --- a/leveler/commands/lvladmin/badge.py +++ b/leveler/commands/lvladmin/badge.py @@ -123,9 +123,9 @@ async def addbadge( badge_name = "{}_{}".format(name, serverid) if badge_name in userbadges.keys(): user_priority_num = userbadges[badge_name]["priority_num"] - new_badge[ - "priority_num" - ] = user_priority_num # maintain old priority number set by user + new_badge["priority_num"] = ( + user_priority_num # maintain old priority number set by user + ) userbadges[badge_name] = new_badge await self.db.users.update_one( {"user_id": user["user_id"]}, diff --git a/leveler/commands/lvladmin/debugging.py b/leveler/commands/lvladmin/debugging.py index 8e823ada..ad4cb614 100644 --- a/leveler/commands/lvladmin/debugging.py +++ b/leveler/commands/lvladmin/debugging.py @@ -50,9 +50,11 @@ async def debug_info(self, ctx): ("DB lock locked", self._db_lock.locked()), ( "DB lock queue", - "N/A" - if self._db_lock._waiters is None - else len(self._db_lock._waiters), + ( + "N/A" + if self._db_lock._waiters is None + else len(self._db_lock._waiters) + ), ), ("pymongo version", pymongoversion), ("motor version", motorversion), diff --git a/leveler/commands/lvlset/badge.py b/leveler/commands/lvlset/badge.py index dcd6d2d4..6bcac17b 100644 --- a/leveler/commands/lvlset/badge.py +++ b/leveler/commands/lvlset/badge.py @@ -112,9 +112,9 @@ async def buy_badge(self, ctx, is_global: Optional[bool], *, name: str): return if badge_info["price"] <= await bank.get_balance(user): await bank.withdraw_credits(user, badge_info["price"]) - userinfo["badges"][ - "{}_{}".format(name, str(serverid)) - ] = server_badges[name] + userinfo["badges"]["{}_{}".format(name, str(serverid))] = ( + server_badges[name] + ) await self.db.users.update_one( {"user_id": userinfo["user_id"]}, {"$set": {"badges": userinfo["badges"]}}, diff --git a/leveler/commands/top.py b/leveler/commands/top.py index 9a930a6b..1d9fbb14 100644 --- a/leveler/commands/top.py +++ b/leveler/commands/top.py @@ -64,8 +64,8 @@ async def top( elif options.global_top and owner: is_level = True if await self.config.global_levels() else False title = "Global Exp Leaderboard for {}\n".format(self.bot.user.name) - async for userinfo in self.db.users.find({}).allow_disk_use(True).sort( - "total_exp", -1 + async for userinfo in ( + self.db.users.find({}).allow_disk_use(True).sort("total_exp", -1) ): pos += 1 if is_level: @@ -109,9 +109,11 @@ async def top( icon_url = self.bot.user.avatar_url elif options.rep: title = "Rep Leaderboard for {}\n".format(server.name) - async for userinfo in self.db.users.find( - {f"servers.{server.id}": {"$exists": True}} - ).allow_disk_use(True).sort("rep", -1): + async for userinfo in ( + self.db.users.find({f"servers.{server.id}": {"$exists": True}}) + .allow_disk_use(True) + .sort("rep", -1) + ): pos += 1 users.append( ( @@ -137,10 +139,15 @@ async def top( else: is_level = True title = "Exp Leaderboard for {}\n".format(server.name) - async for userinfo in self.db.users.find( - {f"servers.{server.id}": {"$exists": True}} - ).allow_disk_use(True).sort( - [(f"servers.{server.id}.level", -1), (f"servers.{server.id}.current_exp", -1)] + async for userinfo in ( + self.db.users.find({f"servers.{server.id}": {"$exists": True}}) + .allow_disk_use(True) + .sort( + [ + (f"servers.{server.id}.level", -1), + (f"servers.{server.id}.current_exp", -1), + ] + ) ): pos += 1 if str(user.id) == userinfo["user_id"]: diff --git a/leveler/exp.py b/leveler/exp.py index 5ba8fd0d..f2277461 100644 --- a/leveler/exp.py +++ b/leveler/exp.py @@ -206,10 +206,10 @@ async def _handle_levelup(self, user, userinfo, server, channel): async def _find_server_rank(self, user, server): rank = 1 - async for userinfo in self.db.users.find( - {f"servers.{server.id}": {"$exists": True}} - ).allow_disk_use(True).sort( - [(f"servers.{server.id}.level", -1), (f"servers.{server.id}.current_exp", -1)] + async for userinfo in ( + self.db.users.find({f"servers.{server.id}": {"$exists": True}}) + .allow_disk_use(True) + .sort([(f"servers.{server.id}.level", -1), (f"servers.{server.id}.current_exp", -1)]) ): if userinfo["user_id"] == str(user.id): return rank @@ -217,9 +217,11 @@ async def _find_server_rank(self, user, server): async def _find_server_rep_rank(self, user, server): rank = 1 - async for userinfo in self.db.users.find( - {f"servers.{server.id}": {"$exists": True}} - ).allow_disk_use(True).sort("rep", -1): + async for userinfo in ( + self.db.users.find({f"servers.{server.id}": {"$exists": True}}) + .allow_disk_use(True) + .sort("rep", -1) + ): if userinfo.get("user_id") == str(user.id): return rank rank += 1 diff --git a/leveler/menus/top.py b/leveler/menus/top.py index 68e65db6..cda07c6d 100644 --- a/leveler/menus/top.py +++ b/leveler/menus/top.py @@ -115,9 +115,11 @@ def __init__( async def format_page(self, menu: TopMenu, entries): table = tabulate( entries, - headers=["#", self.board_type, "Level", "Username"] - if self.is_level - else ["#", self.board_type, "Username"], + headers=( + ["#", self.board_type, "Level", "Username"] + if self.is_level + else ["#", self.board_type, "Username"] + ), tablefmt="rst", ) table_width = len(table.splitlines()[0]) diff --git a/minecraftdata/minecraftdata.py b/minecraftdata/minecraftdata.py index 56e95f71..52367b3f 100644 --- a/minecraftdata/minecraftdata.py +++ b/minecraftdata/minecraftdata.py @@ -304,18 +304,20 @@ async def java(self, ctx, query_data: Optional[bool], server_ip: str): name=_("Players"), value="{0.players.online}/{0.players.max}\n{1}".format( status, - chat.box( - list( - chat.pagify( - await self.clear_mcformatting( - "\n".join([p.name for p in status.players.sample]) - ), - page_length=992, - ) - )[0] - ) - if status.players.sample - else "", + ( + chat.box( + list( + chat.pagify( + await self.clear_mcformatting( + "\n".join([p.name for p in status.players.sample]) + ), + page_length=992, + ) + )[0] + ) + if status.players.sample + else "" + ), ), ) embed.add_field( diff --git a/steamcommunity/steamcommunity.py b/steamcommunity/steamcommunity.py index 7026e189..c36b77e1 100644 --- a/steamcommunity/steamcommunity.py +++ b/steamcommunity/steamcommunity.py @@ -136,9 +136,11 @@ async def steamprofile(self, ctx, profile: SteamUser): title=profile.personaname, description=profile.personastate(), url=profile.profileurl, - timestamp=datetime.utcfromtimestamp(profile.lastlogoff) - if profile.lastlogoff - else discord.Embed.Empty, + timestamp=( + datetime.utcfromtimestamp(profile.lastlogoff) + if profile.lastlogoff + else discord.Embed.Empty + ), color=profile.personastatecolor, ) if profile.gameid: From 31cd32a138eb85b49b6a6ba65e03437f4b7c8ca1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 20:33:38 +0400 Subject: [PATCH 18/28] [meta]: Bump crowdin/github-action from 1.17.0 to 1.19.0 (#248) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/crowdin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index 187392c4..590393f5 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 - name: Update translations - uses: crowdin/github-action@v1.17.0 + uses: crowdin/github-action@v1.19.0 with: download_translations: true commit_message: '[automated] update translations from Crowdin' From 4ed0f0a596a174bf5073e04f6f93af314d4d4b7c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 20:34:08 +0400 Subject: [PATCH 19/28] [meta] update pre-commit (#247) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 47119eec..3f2fc254 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ default_language_version: python: python3.11 repos: - repo: https://github.com/psf/black - rev: 24.1.1 + rev: 24.3.0 hooks: - id: black - repo: https://github.com/pycqa/isort From 0cdfd1c1e8eea919f283dbebc22a236ee01ff401 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Mar 2024 08:51:42 +0000 Subject: [PATCH 20/28] [meta]: Bump actions/dependency-review-action from 3 to 4 (#240) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependency-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 4c4e676c..eff884be 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -9,7 +9,7 @@ jobs: - name: 'Checkout Repository' uses: actions/checkout@v4 - name: 'Dependency Review' - uses: actions/dependency-review-action@v3 + uses: actions/dependency-review-action@v4 with: # Possible values: "critical", "high", "moderate", "low" # fail-on-severity: critical From ff50018b9459d3c3119bb9d045fc1feeec95d078 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Mar 2024 08:54:46 +0000 Subject: [PATCH 21/28] [meta]: Bump TimonVS/pr-labeler-action from 4 to 5 (#246) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/pr-labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index 299711dc..0f7b9645 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -7,7 +7,7 @@ jobs: pr-labeler: runs-on: ubuntu-latest steps: - - uses: TimonVS/pr-labeler-action@v4 + - uses: TimonVS/pr-labeler-action@v5 with: configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value env: From 2fd4c0b05760f062f17e19513408b85aee606722 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 6 Apr 2024 15:12:47 +0400 Subject: [PATCH 22/28] [meta]: Bump crowdin/github-action from 1.19.0 to 1.20.1 (#251) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/crowdin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index 590393f5..2911e3b4 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 - name: Update translations - uses: crowdin/github-action@v1.19.0 + uses: crowdin/github-action@v1.20.1 with: download_translations: true commit_message: '[automated] update translations from Crowdin' From c5a471ad4efa5b2df6cf886491285918b4a558f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 00:03:39 +0400 Subject: [PATCH 23/28] [meta]: Bump crowdin/github-action from 1.20.1 to 1.20.2 (#252) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/crowdin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index 2911e3b4..2207a45f 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 - name: Update translations - uses: crowdin/github-action@v1.20.1 + uses: crowdin/github-action@v1.20.2 with: download_translations: true commit_message: '[automated] update translations from Crowdin' From 5f2ccb428df70ea193d59553e6f0dd87b83cd8a5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 00:04:14 +0400 Subject: [PATCH 24/28] [meta] update pre-commit (#253) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 24.3.0 → 24.4.0](https://github.com/psf/black/compare/24.3.0...24.4.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f2fc254..0b9188c2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ default_language_version: python: python3.11 repos: - repo: https://github.com/psf/black - rev: 24.3.0 + rev: 24.4.0 hooks: - id: black - repo: https://github.com/pycqa/isort From f3223dbe16b07b0c00bab7851a66153eec6df831 Mon Sep 17 00:00:00 2001 From: Glas <48269777+DJTOMATO@users.noreply.github.com> Date: Wed, 17 Apr 2024 19:57:27 -0400 Subject: [PATCH 25/28] Update vocadb.py - Fix typing - Replace footer language map with translationtype - Now compatible with V3 Signed-off-by: Glas <48269777+DJTOMATO@users.noreply.github.com> --- vocadb/vocadb.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/vocadb/vocadb.py b/vocadb/vocadb.py index 92646b0e..ea36f56d 100644 --- a/vocadb/vocadb.py +++ b/vocadb/vocadb.py @@ -56,7 +56,9 @@ async def _fetch_data(self, ctx: commands.Context, query: str): "User-Agent": f"Red-DiscordBot/{red_version} Fixator10-cogs/VocaDB/{self.__version__}" } try: - async with self.session.get(BASE_API_URL, params=params, headers=headers) as resp: + async with self.session.get( + BASE_API_URL, params=params, headers=headers + ) as resp: if resp.status != 200: return f"https://http.cat/{resp.status}" result = await resp.json() @@ -123,19 +125,26 @@ def _info_embed(self, colour, data: Dict[str, Any]) -> discord.Embed: embed.add_field(name="Duration", value=f"{minutes} minutes, {seconds} seconds") favorites, score = (data.get("favoritedTimes", 0), data.get("ratingScore", 0)) embed.add_field(name="Published On", value=pub_date) - embed.add_field(name="Statistics", value=f"{favorites} favourite(s), {score} total score") + embed.add_field( + name="Statistics", value=f"{favorites} favourite(s), {score} total score" + ) embed.add_field(name="Artist(s)", value=all_artists) embed.set_footer(text="Powered by VocaDB") return embed @staticmethod - def _lyrics_embed(colour, page: Dict[str, Any], data: Dict[str, Any]) -> discord.Embed: + def _lyrics_embed( + colour, page: Dict[str, Any], data: Dict[str, Any] + ) -> discord.Embed: """Create an embed with the lyrics""" + print("Page:", page) # Add this debug print title = [ x.get("value") for x in data.get("names") - if x.get("language") == LANGUAGE_MAP.get(page["cultureCode"]) + if x.get("language") == LANGUAGE_MAP.get(page.get("translationType")) ] + + print("Title:", title) # Add this debug print em = discord.Embed( title=title[0] if title else data.get("defaultName"), colour=colour, @@ -143,12 +152,15 @@ def _lyrics_embed(colour, page: Dict[str, Any], data: Dict[str, Any]) -> discord em.set_thumbnail(url=data.get("thumbUrl") or "") if data.get("id"): em.url = f"https://vocadb.net/S/{data['id']}" - em.description = page["value"][:4090] if page.get("value") else "No lyrics found." + em.description = ( + page["value"][:4090] if page.get("value") else "No lyrics found." + ) if page.get("url"): em.add_field( name="Source", value=f"[{page.get('source') or 'Source'}]({page['url']})", ) + return em @commands.command() @@ -156,7 +168,7 @@ def _lyrics_embed(colour, page: Dict[str, Any], data: Dict[str, Any]) -> discord @commands.cooldown(1, 5, commands.BucketType.user) async def vocadb(self, ctx: commands.Context, *, query: str): """Fetch Vocaloid song lyrics from VocaDB.net database""" - await ctx.trigger_typing() + await ctx.channel.typing() data = await self._fetch_data(ctx, query) if type(data) == str: @@ -170,10 +182,12 @@ async def vocadb(self, ctx: commands.Context, *, query: str): embeds = [] for i, page in enumerate(data["lyrics"], start=1): - language = f"Language: {LANGUAGE_MAP.get(page.get('cultureCode', 'na'))}" + language = f"Language: {page.get('translationType', 'na')}" emb = self._lyrics_embed(await ctx.embed_colour(), page, data) emb.set_footer(text=f"{language} • Page {i} of {len(data['lyrics'])}") embeds.append(emb) - controls = {"\N{CROSS MARK}": close_menu} if len(embeds) == 1 else DEFAULT_CONTROLS + controls = ( + {"\N{CROSS MARK}": close_menu} if len(embeds) == 1 else DEFAULT_CONTROLS + ) await menu(ctx, embeds, controls=controls, timeout=90.0) From e8bb555a3c79b45b026300c04c2484d5c2e089ee Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 17 Apr 2024 23:57:57 +0000 Subject: [PATCH 26/28] [meta] pre-commit styling fix --- vocadb/vocadb.py | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/vocadb/vocadb.py b/vocadb/vocadb.py index ea36f56d..bf8589ee 100644 --- a/vocadb/vocadb.py +++ b/vocadb/vocadb.py @@ -56,9 +56,7 @@ async def _fetch_data(self, ctx: commands.Context, query: str): "User-Agent": f"Red-DiscordBot/{red_version} Fixator10-cogs/VocaDB/{self.__version__}" } try: - async with self.session.get( - BASE_API_URL, params=params, headers=headers - ) as resp: + async with self.session.get(BASE_API_URL, params=params, headers=headers) as resp: if resp.status != 200: return f"https://http.cat/{resp.status}" result = await resp.json() @@ -125,17 +123,13 @@ def _info_embed(self, colour, data: Dict[str, Any]) -> discord.Embed: embed.add_field(name="Duration", value=f"{minutes} minutes, {seconds} seconds") favorites, score = (data.get("favoritedTimes", 0), data.get("ratingScore", 0)) embed.add_field(name="Published On", value=pub_date) - embed.add_field( - name="Statistics", value=f"{favorites} favourite(s), {score} total score" - ) + embed.add_field(name="Statistics", value=f"{favorites} favourite(s), {score} total score") embed.add_field(name="Artist(s)", value=all_artists) embed.set_footer(text="Powered by VocaDB") return embed @staticmethod - def _lyrics_embed( - colour, page: Dict[str, Any], data: Dict[str, Any] - ) -> discord.Embed: + def _lyrics_embed(colour, page: Dict[str, Any], data: Dict[str, Any]) -> discord.Embed: """Create an embed with the lyrics""" print("Page:", page) # Add this debug print title = [ @@ -152,9 +146,7 @@ def _lyrics_embed( em.set_thumbnail(url=data.get("thumbUrl") or "") if data.get("id"): em.url = f"https://vocadb.net/S/{data['id']}" - em.description = ( - page["value"][:4090] if page.get("value") else "No lyrics found." - ) + em.description = page["value"][:4090] if page.get("value") else "No lyrics found." if page.get("url"): em.add_field( name="Source", @@ -187,7 +179,5 @@ async def vocadb(self, ctx: commands.Context, *, query: str): emb.set_footer(text=f"{language} • Page {i} of {len(data['lyrics'])}") embeds.append(emb) - controls = ( - {"\N{CROSS MARK}": close_menu} if len(embeds) == 1 else DEFAULT_CONTROLS - ) + controls = {"\N{CROSS MARK}": close_menu} if len(embeds) == 1 else DEFAULT_CONTROLS await menu(ctx, embeds, controls=controls, timeout=90.0) From 9b1c2c14188f81cf677841c15a3b9b671f6260ba Mon Sep 17 00:00:00 2001 From: Glas <48269777+DJTOMATO@users.noreply.github.com> Date: Wed, 17 Apr 2024 20:00:35 -0400 Subject: [PATCH 27/28] Update vocadb.py Fixes lol Signed-off-by: Glas <48269777+DJTOMATO@users.noreply.github.com> --- vocadb/vocadb.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vocadb/vocadb.py b/vocadb/vocadb.py index bf8589ee..0a82febe 100644 --- a/vocadb/vocadb.py +++ b/vocadb/vocadb.py @@ -131,14 +131,13 @@ def _info_embed(self, colour, data: Dict[str, Any]) -> discord.Embed: @staticmethod def _lyrics_embed(colour, page: Dict[str, Any], data: Dict[str, Any]) -> discord.Embed: """Create an embed with the lyrics""" - print("Page:", page) # Add this debug print + title = [ x.get("value") for x in data.get("names") if x.get("language") == LANGUAGE_MAP.get(page.get("translationType")) ] - print("Title:", title) # Add this debug print em = discord.Embed( title=title[0] if title else data.get("defaultName"), colour=colour, @@ -160,7 +159,7 @@ def _lyrics_embed(colour, page: Dict[str, Any], data: Dict[str, Any]) -> discord @commands.cooldown(1, 5, commands.BucketType.user) async def vocadb(self, ctx: commands.Context, *, query: str): """Fetch Vocaloid song lyrics from VocaDB.net database""" - await ctx.channel.typing() + await ctx.typing() data = await self._fetch_data(ctx, query) if type(data) == str: @@ -174,7 +173,7 @@ async def vocadb(self, ctx: commands.Context, *, query: str): embeds = [] for i, page in enumerate(data["lyrics"], start=1): - language = f"Language: {page.get('translationType', 'na')}" + language = f"Version: {page.get('translationType', 'na')}" emb = self._lyrics_embed(await ctx.embed_colour(), page, data) emb.set_footer(text=f"{language} • Page {i} of {len(data['lyrics'])}") embeds.append(emb) From 9d1cdc347763de5b3f8e6ee78a9a326d1f5c9a4a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 06:14:50 +0000 Subject: [PATCH 28/28] [meta] pre-commit styling fix --- captcha/commands/settings.py | 18 +++++++++--------- datautils/datautils.py | 8 ++------ leveler/commands/lvladmin/badge.py | 6 +++--- leveler/commands/lvlset/badge.py | 6 +++--- 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/captcha/commands/settings.py b/captcha/commands/settings.py index ba4326f3..6ae2235f 100644 --- a/captcha/commands/settings.py +++ b/captcha/commands/settings.py @@ -308,14 +308,14 @@ async def add_roles(self, ctx: commands.Context, *roles: discord.Role): for role in roles: async with self.data.guild(ctx.guild).autoroles() as roles_list: if role.position >= ctx.me.top_role.position: - error[role.name] = ( - "This role is higher than my highest role in the role hierarchy." - ) + error[ + role.name + ] = "This role is higher than my highest role in the role hierarchy." continue if role.position >= ctx.author.top_role.position: - error[role.name] = ( - "This role is higher than your own in the discord hierarchy." - ) + error[ + role.name + ] = "This role is higher than your own in the discord hierarchy." continue if role.id not in roles_list: roles_list.append(role.id) @@ -356,9 +356,9 @@ async def remove_roles(self, ctx: commands.Context, *roles: discord.Role): async with self.data.guild(ctx.guild).autoroles() as roles_list: for role in roles: if role.position >= ctx.author.top_role.position: - error[role.name] = ( - "This role is higher than your own in the discord hierarchy." - ) + error[ + role.name + ] = "This role is higher than your own in the discord hierarchy." continue if role.id in roles_list: roles_list.remove(role.id) diff --git a/datautils/datautils.py b/datautils/datautils.py index 470fbe5c..17923f46 100644 --- a/datautils/datautils.py +++ b/datautils/datautils.py @@ -127,12 +127,8 @@ async def fetchwidget(self, ctx, *, server_id: int): em.add_field( name=_("Features"), value="\n".join(_(GUILD_FEATURES.get(f, f)) for f in guild.features).format( - banner=guild.banner - and f" [🔗]({guild.banner_url_as(format='png')})" - or "", - splash=guild.splash - and f" [🔗]({guild.splash_url_as(format='png')})" - or "", + banner=guild.banner and f" [🔗]({guild.banner_url_as(format='png')})" or "", + splash=guild.splash and f" [🔗]({guild.splash_url_as(format='png')})" or "", discovery=getattr(guild, "discovery_splash", None) and f" [🔗]({guild.discovery_splash_url_as(format='png')})" or "", diff --git a/leveler/commands/lvladmin/badge.py b/leveler/commands/lvladmin/badge.py index 1c5638e8..3676c3e9 100644 --- a/leveler/commands/lvladmin/badge.py +++ b/leveler/commands/lvladmin/badge.py @@ -123,9 +123,9 @@ async def addbadge( badge_name = "{}_{}".format(name, serverid) if badge_name in userbadges.keys(): user_priority_num = userbadges[badge_name]["priority_num"] - new_badge["priority_num"] = ( - user_priority_num # maintain old priority number set by user - ) + new_badge[ + "priority_num" + ] = user_priority_num # maintain old priority number set by user userbadges[badge_name] = new_badge await self.db.users.update_one( {"user_id": user["user_id"]}, diff --git a/leveler/commands/lvlset/badge.py b/leveler/commands/lvlset/badge.py index f1448ad6..3fcb8b4c 100644 --- a/leveler/commands/lvlset/badge.py +++ b/leveler/commands/lvlset/badge.py @@ -112,9 +112,9 @@ async def buy_badge(self, ctx, is_global: Optional[bool], *, name: str): return if badge_info["price"] <= await bank.get_balance(user): await bank.withdraw_credits(user, badge_info["price"]) - userinfo["badges"]["{}_{}".format(name, str(serverid))] = ( - server_badges[name] - ) + userinfo["badges"][ + "{}_{}".format(name, str(serverid)) + ] = server_badges[name] await self.db.users.update_one( {"user_id": userinfo["user_id"]}, {"$set": {"badges": userinfo["badges"]}},