2023-10-11 18:26:35 -05:00
|
|
|
import { ChatInputCommandInteraction } from 'discord.js';
|
2023-10-14 11:36:10 -05:00
|
|
|
import buttonPrimary from './buttonPrimary';
|
2023-10-11 18:26:35 -05:00
|
|
|
|
2023-10-14 11:36:10 -05:00
|
|
|
export function buttonRefresh(
|
2023-10-11 18:26:35 -05:00
|
|
|
interaction: ChatInputCommandInteraction,
|
|
|
|
|
path: string,
|
|
|
|
|
) {
|
|
|
|
|
if (
|
2024-03-06 16:19:29 -06:00
|
|
|
interaction.appPermissions?.has('ReadMessageHistory') &&
|
2023-10-11 18:26:35 -05:00
|
|
|
interaction.appPermissions?.has('ViewChannel')
|
|
|
|
|
) {
|
2024-03-06 16:19:29 -06:00
|
|
|
return buttonPrimary(path, 'Refresh', '🔄️');
|
2023-10-11 18:26:35 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|