mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 21:53:07 -04:00
[fix] paginator editing works properly now
This commit is contained in:
parent
a68b840af7
commit
41721f941f
13 changed files with 32 additions and 37 deletions
|
@ -96,9 +96,8 @@ module.exports = {
|
|||
}
|
||||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const message = context.message
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
context,
|
||||
pages
|
||||
});
|
||||
return;
|
||||
|
@ -125,9 +124,8 @@ module.exports = {
|
|||
}
|
||||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const message = context.message
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
context,
|
||||
pages
|
||||
});
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ const { Constants } = require('detritus-client');
|
|||
const { paginator } = require('../../../../labscore/client');
|
||||
|
||||
const createEmbedMessage = (title, description) => ({
|
||||
embeds: [{ title, description }]
|
||||
embeds: [{ title, description }]
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
|
@ -14,17 +14,15 @@ module.exports = {
|
|||
usage: 'page'
|
||||
},
|
||||
run: async (context) => {
|
||||
const message = context.message
|
||||
const message = context
|
||||
const pages = [
|
||||
createEmbedMessage("Page", "ddd"),
|
||||
createEmbedMessage("Page2", "eee"),
|
||||
createEmbedMessage("Page 3", "h")
|
||||
]
|
||||
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
|
||||
});
|
||||
context,
|
||||
pages
|
||||
});
|
||||
},
|
||||
};
|
|
@ -48,9 +48,8 @@ module.exports = {
|
|||
}
|
||||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const message = context.message
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
context,
|
||||
pages
|
||||
});
|
||||
}catch(e){
|
||||
|
|
|
@ -44,9 +44,8 @@ module.exports = {
|
|||
}
|
||||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const message = context.message
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
context,
|
||||
pages
|
||||
});
|
||||
}catch(e){
|
||||
|
|
|
@ -48,9 +48,8 @@ module.exports = {
|
|||
}
|
||||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const message = context.message
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
context,
|
||||
pages
|
||||
});
|
||||
}catch(e){
|
||||
|
|
|
@ -45,9 +45,8 @@ module.exports = {
|
|||
}
|
||||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const message = context.message
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
context,
|
||||
pages
|
||||
});
|
||||
}catch(e){
|
||||
|
|
|
@ -62,11 +62,10 @@ module.exports = {
|
|||
while(fields.length) {
|
||||
pages.push({embeds:[createLyricsPage(context, search, fields.splice(0,3))]})
|
||||
}
|
||||
const message = context.message
|
||||
|
||||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
context,
|
||||
pages
|
||||
});
|
||||
return;
|
||||
|
|
|
@ -46,9 +46,8 @@ module.exports = {
|
|||
}
|
||||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const message = context.message
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
context,
|
||||
pages
|
||||
});
|
||||
}catch(e){
|
||||
|
|
|
@ -47,9 +47,8 @@ module.exports = {
|
|||
}
|
||||
|
||||
pages = formatPaginationEmbeds(pages)
|
||||
const message = context.message
|
||||
const paging = await paginator.createPaginator({
|
||||
message,
|
||||
context,
|
||||
pages
|
||||
});
|
||||
}catch(e){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue