/[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 484 by rakin, Mon Jul 29 17:30:27 2024 UTC revision 543 by rakin, Mon Jul 29 17:30:44 2024 UTC
# Line 1  Line 1 
1    /**
2    * This file is part of SudoBot.
3    *
4    * Copyright (C) 2021-2022 OSN Inc.
5    *
6    * SudoBot is free software; you can redistribute it and/or modify it
7    * under the terms of the GNU Affero General Public License as published by
8    * the Free Software Foundation, either version 3 of the License, or
9    * (at your option) any later version.
10    *
11    * SudoBot is distributed in the hope that it will be useful, but
12    * WITHOUT ANY WARRANTY; without even the implied warranty of
13    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14    * GNU Affero General Public License for more details.
15    *
16    * You should have received a copy of the GNU Affero General Public License
17    * along with SudoBot. If not, see <https://www.gnu.org/licenses/>.
18    */
19    
20  import DiscordClient from "../client/Client";  import DiscordClient from "../client/Client";
21  import MessageEmbed from "../client/MessageEmbed";  import MessageEmbed from "../client/MessageEmbed";
22  import { v4 as uuid } from 'uuid';  import { v4 as uuid } from 'uuid';
# Line 81  export default class Pagination<T> { Line 100  export default class Pagination<T> {
100                  .setCustomId(`pagination_first_${this.id}`)                  .setCustomId(`pagination_first_${this.id}`)
101                  .setStyle("PRIMARY")                  .setStyle("PRIMARY")
102                  .setDisabled(!first)                  .setDisabled(!first)
103                  .setEmoji(emoji('ChevronLeft')!),                  .setEmoji(emoji('ArrowLeft')!),
104              new MessageButton()              new MessageButton()
105                  .setCustomId(`pagination_back_${this.id}`)                  .setCustomId(`pagination_back_${this.id}`)
106                  .setStyle("PRIMARY")                  .setStyle("PRIMARY")
107                  .setDisabled(!back)                  .setDisabled(!back)
108                  .setEmoji(emoji('ArrowLeft')!),                  .setEmoji(emoji('ChevronLeft')!),
109              new MessageButton()              new MessageButton()
110                  .setCustomId(`pagination_next_${this.id}`)                  .setCustomId(`pagination_next_${this.id}`)
111                  .setStyle("PRIMARY")                  .setStyle("PRIMARY")
112                  .setDisabled(!next)                  .setDisabled(!next)
113                  .setEmoji(emoji('ArrowRight')!),                  .setEmoji(emoji('ChevronRight')!),
114              new MessageButton()              new MessageButton()
115                  .setCustomId(`pagination_last_${this.id}`)                  .setCustomId(`pagination_last_${this.id}`)
116                  .setStyle("PRIMARY")                  .setStyle("PRIMARY")
117                  .setDisabled(!last)                  .setDisabled(!last)
118                  .setEmoji(emoji('ChevronRight')!)                  .setEmoji(emoji('ArrowRight')!)
119          );          );
120    
121          return actionRow;          return actionRow;
# Line 116  export default class Pagination<T> { Line 135  export default class Pagination<T> {
135                  }                  }
136    
137                  if (interaction.isRepliable()) {                  if (interaction.isRepliable()) {
138                      interaction.reply({ content: 'That\'t not under your control or the button controls are expired', ephemeral: true });                      interaction.reply({ content: 'That\'s not under your control or the button controls are expired', ephemeral: true });
139                  }                  }
140    
141                  return false;                  return false;
# Line 175  export default class Pagination<T> { Line 194  export default class Pagination<T> {
194              await message.edit({ components: [component] });              await message.edit({ components: [component] });
195          });          });
196      }      }
 }  
197    }

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26