MCPcopy Create free account
hub / github.com/codebymitch/TitanBot / createNavigationRow

Function createNavigationRow

src/commands/Moderation/cases.js:97–120  ·  view source on GitHub ↗
(page)

Source from the content-addressed store, hash-verified

95 };
96
97 const createNavigationRow = (page) => {
98 const row = new ActionRowBuilder();
99
100 const prevButton = new ButtonBuilder()
101 .setCustomId('prev_page')
102 .setLabel('⬅️ Previous')
103 .setStyle(ButtonStyle.Secondary)
104 .setDisabled(page === 1);
105
106 const pageInfoButton = new ButtonBuilder()
107 .setCustomId('page_info')
108 .setLabel(`Page ${page}/${totalPages}`)
109 .setStyle(ButtonStyle.Primary)
110 .setDisabled(true);
111
112 const nextButton = new ButtonBuilder()
113 .setCustomId('next_page')
114 .setLabel('Next ➡️')
115 .setStyle(ButtonStyle.Secondary)
116 .setDisabled(page === totalPages);
117
118 row.addComponents(prevButton, pageInfoButton, nextButton);
119 return row;
120 };
121
122 const message = await interaction.editReply({
123 embeds: [createCasesEmbed(currentPage)],

Callers 1

executeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected