Skip to content

Commit 396949f

Browse files
committed
fix: CI pipeline failures
1 parent 0fc4411 commit 396949f

15 files changed

Lines changed: 51 additions & 31 deletions

File tree

locales/en/utils/translator.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ id = Indonesian
2424
it = Italian
2525
ja = Japanese
2626
ko = Korean
27+
ky = Kyrgyz
2728
li = Limburgish
2829
lt = Lithuanian
2930
lv = Latvian

locales/ko/utils/translator.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ id = 인도네시아어
2424
it = 이탈리아어
2525
ja = 일본어
2626
ko = 한국어
27+
ky = 키르기스어
2728
li = 림뷔르흐어
2829
lt = 리투아니아어
2930
lv = 라트비아어

locales/zh-TW/utils/translator.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ id = 印尼語
2424
it = 意大利語
2525
ja = 日語
2626
ko = 韓語
27+
ky = 吉爾吉斯語
2728
li = 林堡語
2829
lt = 立陶宛語
2930
lv = 拉脫維亞語

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
aiofiles~=24.1.0
12
deep-translator~=1.11.4
23
discord.py~=2.3.2
34
langid~=1.1.6
@@ -11,5 +12,5 @@ motor~=3.6.0
1112
fluent.runtime~=0.4.0
1213
argostranslate~=1.9.1
1314
cryptography~=42.0.8
14-
ruff~=0.8.1
15+
ruff~=0.12.10
1516
google-genai[aiohttp]~=1.31.0

src/commands/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Contains the decorators that are used in the commands."""
22

3-
import os
43
from collections.abc import Callable, Coroutine
54
from pathlib import Path
65

@@ -38,8 +37,8 @@ def command(*, nsfw: bool = False, **params: str) -> [Callable[..., Command]]:
3837
loc = Localization(
3938
DEFAULT_LANGUAGE,
4039
[
41-
Path("commands") / name
42-
for name in os.listdir(LOCALES_DIR / DEFAULT_LANGUAGE.code / "commands")
40+
Path("commands") / path.name
41+
for path in (LOCALES_DIR / DEFAULT_LANGUAGE.code / "commands").iterdir()
4342
],
4443
)
4544

src/commands/channel.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def __init__(self, bot: Bot) -> None:
3838
)
3939
)
4040
async def translator(
41-
self, interaction: Interaction, this: bool = THIS_DEFAULT # noqa: FBT001
41+
self,
42+
interaction: Interaction,
43+
this: bool = THIS_DEFAULT, # noqa: FBT001
4244
) -> None:
4345
"""Set or remove the languages to be translated for channels."""
4446
loc = Localization(interaction.locale, resources)
@@ -51,7 +53,7 @@ async def on_submit(interaction: Interaction) -> None:
5153
channels = (
5254
[interaction.channel_id]
5355
if this
54-
else [channel.id for channel in channel_select.values] # noqa: PD011
56+
else [channel.id for channel in channel_select.values]
5557
)
5658
for channel in channels:
5759
config = await get_channel(channel)
@@ -81,7 +83,9 @@ async def on_submit(interaction: Interaction) -> None:
8183
)
8284
)
8385
async def language(
84-
self, interaction: Interaction, this: bool = THIS_DEFAULT # noqa: FBT001
86+
self,
87+
interaction: Interaction,
88+
this: bool = THIS_DEFAULT, # noqa: FBT001
8589
) -> None:
8690
"""Set or remove the main language of the channels."""
8791
loc = Localization(interaction.locale, resources)
@@ -95,7 +99,7 @@ async def on_submit(interaction: Interaction) -> None:
9599
channels = (
96100
[interaction.channel_id]
97101
if this
98-
else [channel.id for channel in channel_select.values] # noqa: PD011
102+
else [channel.id for channel in channel_select.values]
99103
)
100104

101105
if len(channels) == 0:

src/commands/dashboard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ async def dashboard(interaction: Interaction) -> None:
7575

7676
async def callback(select_interaction: Interaction) -> None:
7777
embeds = []
78-
for channel in channel_select.values: # noqa: PD011
78+
for channel in channel_select.values:
7979
config = await get_channel(channel.id)
8080

8181
languages = [

src/commands/help_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async def callback(self, interaction: Interaction) -> None:
5353
@command(help_description_name=BOT_NAME, help_header_name=BOT_NAME)
5454
async def help_(interaction: Interaction) -> None:
5555
"""Show the help message."""
56-
from main import bot
56+
from main import bot # noqa: PLC0415
5757

5858
send = await defer_response(interaction)
5959

src/commands/movie.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import itertools
44
import json
55
import math
6-
import os
76
import threading
87
from pathlib import Path
98
from typing import ClassVar
@@ -104,7 +103,8 @@ def _cache_movies(cls) -> None:
104103
DESKTOP_CACHE_PATH.mkdir(parents=True, exist_ok=True)
105104

106105
movie_names = [
107-
file for file in os.listdir(constants.ASSETS_DIR) if file.endswith(".mp4")
106+
file.name for file in constants.ASSETS_DIR.iterdir()
107+
if file.suffix == ".mp4"
108108
]
109109
for is_mobile in (True, False):
110110
for movie_name in movie_names:

src/commands/translator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ async def on_submit(interaction: Interaction) -> None:
170170
user = await get_user(interaction.user.id)
171171
user.translate_to = list(language_view.selected)
172172
user.translate_in = (
173-
[] if all_channels else [channel.id for channel in channel_select.values] # noqa: PD011
173+
[] if all_channels else [channel.id for channel in channel_select.values]
174174
)
175175
await set_user(user)
176176

0 commit comments

Comments
 (0)