mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 14:13:02 -04:00
wip
This commit is contained in:
parent
7195d43c74
commit
6173b085a3
26 changed files with 1112 additions and 91 deletions
37
commands/message/dev/debug/page.js
Normal file
37
commands/message/dev/debug/page.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
const { Constants } = require('detritus-client');
|
||||
const { paginator } = require('../../../../labscore/client');
|
||||
|
||||
const reactions = {
|
||||
previousPage: "⬅️",
|
||||
nextPage: "➡️"
|
||||
};
|
||||
|
||||
const createEmbedMessage = (title, description) => ({
|
||||
embeds: [{ title, description }]
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
name: 'page',
|
||||
metadata: {
|
||||
description: 'pagination test',
|
||||
examples: ['page'],
|
||||
category: 'dev',
|
||||
usage: 'page'
|
||||
},
|
||||
run: async (context) => {
|
||||
const message = context.message
|
||||
const pages = [
|
||||
createEmbedMessage("Page", "ddd"),
|
||||
createEmbedMessage("Page2", "eee"),
|
||||
createEmbedMessage("Page 3", "h")
|
||||
]
|
||||
const paging = await paginator.createReactionPaginator({
|
||||
// message is the message the user has sent
|
||||
message,
|
||||
// pages is an array of pages (will be passed as parameter in Message#edit)
|
||||
pages,
|
||||
// reactions is an object that includes `previousPage` and `nextPage` emojis (defined above)
|
||||
reactions
|
||||
});
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue