generated from nhcarrigan/template
feat: initial project prototype #1
@ -22,6 +22,17 @@ export const translate = async(
|
||||
await interaction.deferReply({ flags: [ MessageFlags.Ephemeral ] });
|
||||
const targetLocale = getLocale(interaction);
|
||||
|
||||
const isEntitled = interaction.entitlements.find((entitlement) => {
|
||||
return entitlement.userId === interaction.user.id && entitlement.isActive();
|
||||
});
|
||||
|
||||
if (!isEntitled && interaction.user.id !== "465650873650118659") {
|
||||
await interaction.editReply(
|
||||
"You must be subscribed to translate messages.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!supportedLocales.includes(targetLocale)) {
|
||||
await interaction.editReply("Unsupported locale.");
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user