mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 14:13:02 -04:00
[core](paginator) custom button system
This commit is contained in:
parent
72828b408f
commit
6526b79c86
3 changed files with 46 additions and 41 deletions
|
@ -1,4 +1,5 @@
|
|||
const { Constants } = require('detritus-client');
|
||||
const { InteractionCallbackTypes } = require('detritus-client/lib/constants');
|
||||
const { paginator } = require('../../../../labscore/client');
|
||||
|
||||
const createEmbedMessage = (title, description) => ({
|
||||
|
@ -20,9 +21,18 @@ module.exports = {
|
|||
createEmbedMessage("Page2", "eee"),
|
||||
createEmbedMessage("Page 3", "h")
|
||||
]
|
||||
const paging = await paginator.createPaginator({
|
||||
const buttons = ["previous","next", {customId: "german", emoji: `<:german:856501761857683486>`, style: 4}]
|
||||
const page = await paginator.createPaginator({
|
||||
context,
|
||||
pages
|
||||
pages,
|
||||
buttons
|
||||
});
|
||||
|
||||
// Custom button example, event only triggers for
|
||||
page.on("interaction", async (e) => {
|
||||
if(e.context.customId == "german"){
|
||||
await e.context.respond(InteractionCallbackTypes.UPDATE_MESSAGE, {"content": "german button activated"})
|
||||
}
|
||||
})
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue