diff --git a/src/buttons/records-next.ts b/src/buttons/records-next.ts new file mode 100644 index 0000000..a2ae9b5 --- /dev/null +++ b/src/buttons/records-next.ts @@ -0,0 +1,15 @@ +import { ButtonInteraction, Client } from 'discord.js'; +import { getRecordMessageFromDiscordId } from '../utils'; + +export default { + name: 'records-next', + handler: async function (client: Client, interaction: ButtonInteraction, userId: string, page: string) { + await interaction.deferUpdate(); + + const message = await getRecordMessageFromDiscordId(userId, parseInt(page) + 1, interaction.guild!); + + if (!message) return; + + interaction.editReply(message); + } +}; \ No newline at end of file diff --git a/src/buttons/records-previous.ts b/src/buttons/records-previous.ts new file mode 100644 index 0000000..dd54ac1 --- /dev/null +++ b/src/buttons/records-previous.ts @@ -0,0 +1,15 @@ +import { ButtonInteraction, Client} from 'discord.js'; +import { getRecordMessageFromDiscordId } from '../utils'; + +export default { + name: 'records-previous', + handler: async function (client: Client, interaction: ButtonInteraction, userId: string, page: string) { + await interaction.deferUpdate(); + + const message = await getRecordMessageFromDiscordId(userId, parseInt(page) - 1, interaction.guild!); + + if (!message) return; + + interaction.editReply(message); + } +}; \ No newline at end of file