[Buttons] Update buttons to use classes (#24)

This commit is contained in:
2026-10-26 07:59:34 -07:00
committed by Cinder
parent 567916dafb
commit 584c342fca
29 changed files with 447 additions and 329 deletions
+18
View File
@@ -0,0 +1,18 @@
import { ButtonInteraction, Client } from 'discord.js';
import { Button } from '../types';
import { getNoteMessage } from '../utils';
class NotePreviousButton implements Button<Client> {
id = 'note-previous';
async execute(context: Client<boolean>, interaction: ButtonInteraction, userId: string, page: string): Promise<void> {
await interaction.deferUpdate();
const message = await getNoteMessage(userId, parseInt(page) - 1);
if (!message) return;
await interaction.editReply(message);
}
}
export default new NotePreviousButton();