feat: button translations

This commit is contained in:
TrèsAbhi committed 2024-03-09 12:05:28 -06:00
1 parent 9d6d893373
commit 8d5e78a510
2 files changed
+8 -1

No files matched your search

+4 -1
View File
@@ -1,15 +1,18 @@
import { ChatInputCommandInteraction } from 'discord.js';
import { translator } from '../localization/translator';
import buttonPrimary from './buttonPrimary';
export function buttonRefresh(
interaction: ChatInputCommandInteraction,
path: string,
) {
const { t } = translator(interaction.locale);
if (
interaction.appPermissions?.has('ReadMessageHistory') &&
interaction.appPermissions?.has('ViewChannel')
) {
return buttonPrimary(path, 'Refresh');
return buttonPrimary(path, t`bot.common.buttons.refresh`);
}
return null;