Skip to content

Commit fc45589

Browse files
committed
Ensure option locales are always requested
1 parent 1e103e4 commit fc45589

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arc/command/slash.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,13 @@ async def _on_autocomplete(
183183

184184
def _request_command_locale(self) -> None:
185185
"""Request the locale for this command."""
186-
if self.name_localizations or self.description_localizations or self._client is None:
186+
if self._client is None or not self._client._provided_locales or not self._client._command_locale_provider:
187187
return
188188

189-
if not self._client._provided_locales or not self._client._command_locale_provider:
189+
for option in self.options.values():
190+
option._request_option_locale(self._client, self)
191+
192+
if self.name_localizations or self.description_localizations:
190193
return
191194

192195
name_locales: dict[hikari.Locale, str] = {}
@@ -203,9 +206,6 @@ def _request_command_locale(self) -> None:
203206
self.name_localizations: t.Mapping[hikari.Locale, str] = name_locales
204207
self.description_localizations: t.Mapping[hikari.Locale, str] = desc_locales
205208

206-
for option in self.options.values():
207-
option._request_option_locale(self._client, self)
208-
209209

210210
@attr.define(slots=True, kw_only=True)
211211
class SlashGroup(CommandBase[ClientT, hikari.api.SlashCommandBuilder]):

0 commit comments

Comments
 (0)