[nextgen] working prototype

This commit is contained in:
bignutty 2025-02-11 21:19:57 +01:00
parent 043c65a36c
commit c2630da9e2
2 changed files with 76 additions and 33 deletions

View file

@ -26,6 +26,16 @@ module.exports = {
createEmbed("default", context, { description: "page 2. this has a conditional button."})
].map((p, index)=>page(p, {}, { key: `t_${index}` })),
interactive: {
always_active_button: {
label: "single sub page",
inline: true,
visible: true,
resolvePage: ()=>{
return [
createEmbed("success", context, "smiley")
].map((p)=>page(p))
}
},
conditional_button: {
// Button Label
label: "Conditional",
@ -36,9 +46,10 @@ module.exports = {
console.log(page.getState("t_1"));
return (page.getState("key") === "t_1")
},
resolvePage: (page) => {
resolvePage: (pg) => {
return [
createEmbed("default", context, { description: "this is a conditional sub page"})
createEmbed("default", context, { description: "this is a conditional sub page"}),
createEmbed("default", context, { description: "this is a conditional sub page two"})
].map((p)=>page(p));
}
},
@ -56,9 +67,13 @@ module.exports = {
description: "-# Subpage Loading :)",
})
},
resolvePage: (page) => {
resolvePage: async (pg) => {
console.log("resolving page")
return [
createEmbed("default", context, { description: "this is a conditional sub page"})
createEmbed("default", context, { description: "this is a dynamic sub page " + Math.random()}),
createEmbed("default", context, { description: "this is a dynamic sub page " + Math.random()}),
createEmbed("default", context, { description: "this is a dynamic sub page " + Math.random()}),
createEmbed("default", context, { description: "this is a dynamic sub page " + Math.random()})
].map((p)=>page(p));
}
}