mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-13 20:56:11 +01:00
20 lines
515 B
TypeScript
20 lines
515 B
TypeScript
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, t`bot.common.buttons.refresh`);
|
|
}
|
|
|
|
return null;
|
|
}
|