Add initial support for app command localisation

This commit is contained in:
Rapptz committed 2022-08-05 22:35:30 -04:00
1 parent eb3bc7102b
commit 2d586ae805
16 files changed
+663 -91

No files matched your search

+9 -3
View File
@@ -878,9 +878,15 @@ class InteractionResponse:
if self._response_type:
raise InteractionResponded(self._parent)
payload: Dict[str, Any] = {
'choices': [option.to_dict() for option in choices],
}
translator = self._parent._state._translator
if translator is not None:
payload: Dict[str, Any] = {
'choices': [await option.get_translated_payload(translator) for option in choices],
}
else:
payload: Dict[str, Any] = {
'choices': [option.to_dict() for option in choices],
}
parent = self._parent
if parent.type is not InteractionType.autocomplete: