2 |
import MessageEmbed from "../client/MessageEmbed"; |
import MessageEmbed from "../client/MessageEmbed"; |
3 |
import { v4 as uuid } from 'uuid'; |
import { v4 as uuid } from 'uuid'; |
4 |
import { ButtonInteraction, InteractionCollector, InteractionReplyOptions, Message, MessageActionRow, MessageButton, MessageEditOptions, MessageOptions, ReplyMessageOptions } from "discord.js"; |
import { ButtonInteraction, InteractionCollector, InteractionReplyOptions, Message, MessageActionRow, MessageButton, MessageEditOptions, MessageOptions, ReplyMessageOptions } from "discord.js"; |
5 |
|
import { emoji } from "./Emoji"; |
6 |
|
|
7 |
export interface EmbedBuilderOptions<T> { |
export interface EmbedBuilderOptions<T> { |
8 |
data: Array<T>; |
data: Array<T>; |
80 |
new MessageButton() |
new MessageButton() |
81 |
.setCustomId(`pagination_first_${this.id}`) |
.setCustomId(`pagination_first_${this.id}`) |
82 |
.setStyle("PRIMARY") |
.setStyle("PRIMARY") |
83 |
.setLabel('⏪') |
.setDisabled(!first) |
84 |
.setDisabled(!first), |
.setEmoji(emoji('ChevronLeft')!), |
85 |
new MessageButton() |
new MessageButton() |
86 |
.setCustomId(`pagination_back_${this.id}`) |
.setCustomId(`pagination_back_${this.id}`) |
87 |
.setStyle("PRIMARY") |
.setStyle("PRIMARY") |
88 |
.setLabel('◀') |
.setDisabled(!back) |
89 |
.setDisabled(!back), |
.setEmoji(emoji('ArrowLeft')!), |
90 |
new MessageButton() |
new MessageButton() |
91 |
.setCustomId(`pagination_next_${this.id}`) |
.setCustomId(`pagination_next_${this.id}`) |
92 |
.setStyle("PRIMARY") |
.setStyle("PRIMARY") |
93 |
.setLabel('▶') |
.setDisabled(!next) |
94 |
.setDisabled(!next), |
.setEmoji(emoji('ArrowRight')!), |
95 |
new MessageButton() |
new MessageButton() |
96 |
.setCustomId(`pagination_last_${this.id}`) |
.setCustomId(`pagination_last_${this.id}`) |
97 |
.setStyle("PRIMARY") |
.setStyle("PRIMARY") |
|
.setLabel('⏩') |
|
98 |
.setDisabled(!last) |
.setDisabled(!last) |
99 |
|
.setEmoji(emoji('ChevronRight')!) |
100 |
); |
); |
101 |
|
|
102 |
return actionRow; |
return actionRow; |