Add locale fields to interaction structure (#2042)

* Add locale fields to interaction structure

* making locale and guildLocale optional and add a warning to guildLocale

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
This commit is contained in:
LTS20050703
2022-02-12 23:32:37 -05:00
committed by GitHub
co-authored by Skillz4Killz
parent be7833a184
commit 3c10622d69
2 changed files with 12 additions and 0 deletions
+7
View File
@@ -25,6 +25,8 @@ export function transformInteraction(bot: Bot, payload: SnakeCasedPropertiesDeep
type: payload.type,
token: payload.token,
version: payload.version,
locale: payload.locale,
guildLocale: payload.guild_locale,
// TRANSFORMED STUFF BELOW
guildId,
@@ -198,4 +200,9 @@ export interface DiscordenoInteraction {
/** The target id if this is a context menu command. */
targetId?: bigint;
};
/** The selected language of the invoking user */
locale?: string;
/** The guild's preferred locale, if invoked in a guild. WARNING HIGHLY INACCURATE IN MOST SERVERS! */
guildLocale?: string;
}
+5
View File
@@ -27,4 +27,9 @@ export interface Interaction {
message?: Message;
data?: InteractionData;
/** The selected language of the invoking user */
locale?: string;
/** The guild's preferred locale, if invoked in a guild */
guildLocale?: string;
}