import { ButtonInteraction, Client } from 'discord.js'; import { Button } from '../types'; import { getNoteMessage } from '../utils'; class NotePreviousButton implements Button { id = 'note-previous'; async execute(context: Client, interaction: ButtonInteraction, userId: string, page: string): Promise { await interaction.deferUpdate(); const message = await getNoteMessage(userId, parseInt(page) - 1); if (!message) return; await interaction.editReply(message); } } export default new NotePreviousButton();