mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 06:33:05 -04:00
[core] fully migrate to InteractionPaginator
This commit is contained in:
parent
b1cc10c6ef
commit
eb0ba140f3
15 changed files with 176 additions and 303 deletions
|
@ -22,11 +22,6 @@ const categories = {
|
|||
"dev": `${icon("analytics")} Development`
|
||||
}
|
||||
|
||||
const reactions = {
|
||||
previousPage: "⬅️",
|
||||
nextPage: "➡️"
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
name: 'help',
|
||||
label: 'command',
|
||||
|
@ -58,10 +53,9 @@ module.exports = {
|
|||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const message = context.message
|
||||
const paging = await paginator.createReactionPaginator({
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
pages,
|
||||
reactions
|
||||
pages
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
const { Constants } = require('detritus-client');
|
||||
const { paginator } = require('../../../../labscore/client');
|
||||
|
||||
const reactions = {
|
||||
previousPage: "⬅️",
|
||||
nextPage: "➡️"
|
||||
};
|
||||
|
||||
const createEmbedMessage = (title, description) => ({
|
||||
embeds: [{ title, description }]
|
||||
});
|
||||
|
@ -25,13 +20,11 @@ module.exports = {
|
|||
createEmbedMessage("Page2", "eee"),
|
||||
createEmbedMessage("Page 3", "h")
|
||||
]
|
||||
const paging = await paginator.createReactionPaginator({
|
||||
const paging = await paginator.createPaginator({
|
||||
// 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
|
||||
pages
|
||||
});
|
||||
},
|
||||
};
|
|
@ -25,11 +25,6 @@ function createImageResultPage(context, result){
|
|||
return res;
|
||||
}
|
||||
|
||||
const reactions = {
|
||||
previousPage: "⬅️",
|
||||
nextPage: "➡️"
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
name: 'bingimage',
|
||||
label: 'query',
|
||||
|
@ -54,10 +49,9 @@ module.exports = {
|
|||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const message = context.message
|
||||
const paging = await paginator.createReactionPaginator({
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
pages,
|
||||
reactions
|
||||
pages
|
||||
});
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
|
|
|
@ -21,11 +21,6 @@ function createSearchResultPage(context, result){
|
|||
return res;
|
||||
}
|
||||
|
||||
const reactions = {
|
||||
previousPage: "⬅️",
|
||||
nextPage: "➡️"
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
name: 'bing',
|
||||
label: 'query',
|
||||
|
@ -50,10 +45,9 @@ module.exports = {
|
|||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const message = context.message
|
||||
const paging = await paginator.createReactionPaginator({
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
pages,
|
||||
reactions
|
||||
pages
|
||||
});
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
|
|
|
@ -25,11 +25,6 @@ function createImageResultPage(context, result){
|
|||
return res;
|
||||
}
|
||||
|
||||
const reactions = {
|
||||
previousPage: "⬅️",
|
||||
nextPage: "➡️"
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
name: 'image',
|
||||
label: 'query',
|
||||
|
@ -54,10 +49,9 @@ module.exports = {
|
|||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const message = context.message
|
||||
const paging = await paginator.createReactionPaginator({
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
pages,
|
||||
reactions
|
||||
pages
|
||||
});
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
|
|
|
@ -22,11 +22,6 @@ function createSearchResultPage(context, result){
|
|||
return res;
|
||||
}
|
||||
|
||||
const reactions = {
|
||||
previousPage: "⬅️",
|
||||
nextPage: "➡️"
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
name: 'google',
|
||||
label: 'query',
|
||||
|
@ -51,10 +46,9 @@ module.exports = {
|
|||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const message = context.message
|
||||
const paging = await paginator.createReactionPaginator({
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
pages,
|
||||
reactions
|
||||
pages
|
||||
});
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
|
|
|
@ -5,11 +5,6 @@ const { STATICS } = require('../../../labscore/utils/statics')
|
|||
const { lyrics } = require('../../../labscore/api');
|
||||
const { paginator } = require('../../../labscore/client');
|
||||
|
||||
const reactions = {
|
||||
previousPage: "⬅️",
|
||||
nextPage: "➡️"
|
||||
};
|
||||
|
||||
function createLyricsPage(context, search, fields){
|
||||
let em= createEmbed("default", context, {
|
||||
description: `**${search.body.song.title}**\n*Released ${search.body.song.release}*\n\n`,
|
||||
|
@ -70,10 +65,9 @@ module.exports = {
|
|||
const message = context.message
|
||||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const paging = await paginator.createReactionPaginator({
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
pages,
|
||||
reactions
|
||||
pages
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -23,11 +23,6 @@ function createWolframPage(context, pod){
|
|||
return res;
|
||||
}
|
||||
|
||||
const reactions = {
|
||||
previousPage: "⬅️",
|
||||
nextPage: "➡️"
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
name: 'wolframalpha',
|
||||
label: 'query',
|
||||
|
@ -52,10 +47,9 @@ module.exports = {
|
|||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const message = context.message
|
||||
const paging = await paginator.createReactionPaginator({
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
pages,
|
||||
reactions
|
||||
pages
|
||||
});
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue