(buttons): Hook up buttons. Pre-testing.

This commit is contained in:
2026-10-14 12:18:35 +08:00
parent 12cdba21b5
commit 71e2d1c088
15 changed files with 42 additions and 16 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();