/[sudobot]/trunk/src/utils/Pagination.ts
ViewVC logotype

Diff of /trunk/src/utils/Pagination.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 467 by rakin, Mon Jul 29 17:30:23 2024 UTC revision 484 by rakin, Mon Jul 29 17:30:27 2024 UTC
# Line 2  import DiscordClient from "../client/Cli Line 2  import DiscordClient from "../client/Cli
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>;
# Line 79  export default class Pagination<T> { Line 80  export default class Pagination<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;

Legend:
Removed from v.467  
changed lines
  Added in v.484

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26