Skip to content

Commit

Permalink
fixes shop small event #2318
Browse files Browse the repository at this point in the history
  • Loading branch information
BastLast committed Dec 17, 2024
1 parent a9c5b19 commit 8c31cf0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions Discord/src/smallEvents/shop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export async function smallShopCollector(packet: ReactionCollectorCreationPacket
price: data.price,
type: `${Constants.REACTIONS.ITEM_CATEGORIES[data.item.category]}${i18n.t("smallEvents:shop.types", {
returnObjects: true,
lng: interaction.userLanguage,
interpolation: {escapeValue: false}
})[data.item.category]}`
lng: interaction.userLanguage
})[data.item.category]}`,
interpolation: {escapeValue: false}
}),
interaction.user,
interaction.userLanguage
Expand All @@ -45,14 +45,18 @@ export async function smallShopCollector(packet: ReactionCollectorCreationPacket
}

export async function baseFunctionHandler(context: PacketContext, translationKey: string): Promise<void> {
const interaction = DiscordCache.getInteraction(context.discord!.interaction);
await interaction?.followUp({
const originalInteraction = DiscordCache.getInteraction(context.discord!.interaction!);
if (!originalInteraction) {
return;
}
const buttonInteraction = DiscordCache.getButtonInteraction(context.discord!.buttonInteraction!);
await buttonInteraction?.editReply({
embeds: [
new DraftbotSmallEventEmbed(
"shop",
StringUtils.getRandomTranslation(translationKey, interaction.userLanguage),
interaction.user,
interaction.userLanguage
StringUtils.getRandomTranslation(translationKey, originalInteraction.userLanguage),
buttonInteraction.user,
originalInteraction.userLanguage
)
]
});
Expand Down
2 changes: 1 addition & 1 deletion Lang/fr/smallEvents.json
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@
"Vous tendez une bourse vide en espérant que cela passe sans emcombre mais vous vous faites vite chasser, vous reprenez votre chemin triste et déçu."
],
"refused": [
"Vous déclinez gentiment l'offre et reprenez votre chemin."
"Vous déclinez l'offre et reprenez votre chemin."
]
}
}

0 comments on commit 8c31cf0

Please sign in to comment.