mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
Inject guild locale information in app commands (#6579)
This commit is contained in:
parent
f68580fab9
commit
8c3cdf20a6
@ -19,7 +19,10 @@ from .app_commands import (
|
|||||||
TransformerError,
|
TransformerError,
|
||||||
UserFeedbackCheckFailure,
|
UserFeedbackCheckFailure,
|
||||||
)
|
)
|
||||||
from .i18n import Translator
|
from redbot.core.i18n import (
|
||||||
|
Translator,
|
||||||
|
set_contextual_locales_from_guild,
|
||||||
|
)
|
||||||
from .utils.chat_formatting import humanize_list, inline
|
from .utils.chat_formatting import humanize_list, inline
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
@ -395,3 +398,9 @@ class RedTree(CommandTree):
|
|||||||
|
|
||||||
for key in remove:
|
for key in remove:
|
||||||
del self._disabled_global_commands[key]
|
del self._disabled_global_commands[key]
|
||||||
|
|
||||||
|
# DEP-WARN
|
||||||
|
async def _call(self, interaction: discord.Interaction, *args, **kwargs) -> None:
|
||||||
|
"""Configure the contextual locale based on the interaction guild prior to invoking."""
|
||||||
|
await set_contextual_locales_from_guild(interaction.client, interaction.guild)
|
||||||
|
await super()._call(interaction, *args, **kwargs)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user