✨ (conversation) Add introduction text and menu methods
Introduction text introduce a space, and menu gives what are the available options for a given space.
Here an example of use of these new methods:
import { setTimeout } from "timers/promises";
const clientId = "i0Rp********";
const clientSecret = "qaG********"
const sdk = new DecidimSDKImpl({
apiBaseUrl: "https://nca.voca.city",
clientId,
clientSecret
});
const run = async () => {
const conversationId = await sdk.createConversation("my-chat-bot", "hadrien");
const conversation = await sdk.conversation(conversationId);
const intro = await conversation.introductionText();
await Promise.all(
intro.texts.map(async (text) => {
console.log("~~~~~~~~");
console.log(text);
console.log("~~~~~~~~");
await setTimeout(3200);
}),
);
const menu = await conversation.menu();
console.log("~~~~~~~~");
await Promise.all(
menu.texts.map(async (text) => {
console.log(text);
await setTimeout(3200);
}),
);
menu.buttons.forEach((sectionButton) => {
console.log(
` * ${sectionButton.label} [type=${sectionButton.section}, params=${JSON.stringify(sectionButton.params)}]`,
);
});
console.log("~~~~~~~~");
};
run().then(() => console.log("DONE"));
With Result:
debug: create conversation..... [chatBotId=my-chat-bot, userId=hadrien] {"sdk":"DecidimSDK"}
debug: get machine-to-machine token for i0Rp***** {"sdk":"DecidimSDK"}
debug: search chatbotUserid=hadrien {"sdk":"DecidimSDK"}
debug: search chatbotUserid=hadrien...... found 1 {"sdk":"DecidimSDK"}
debug: create conversation: done. [convId=eyJzcGFjZV9pZCI6IjEiLCJzcGFjZV90eXBlIjoicGFydGljaXBhdG9yeV9wcm9jZXNzZXMiLCJkZWNpZGltX3Vzcl9pZCI6IjEwIn0, decidimUserId=10] {"sdk":"DecidimSDK"}
debug: get machine-to-machine token for i0Rp***** {"sdk":"DecidimSDK"}
debug: get machine-to-machine token for i0Rp***** {"sdk":"DecidimSDK"}
~~~~~~~~
## Increasing Political Literacy
This participatory process is designed to empower Pemba residents by increasing their understanding of political systems, civic rights, and democratic processes. Through interactive workshops, community dialogues, and this digital platform, participants will learn about governance structures, decision-making processes, and how to advocate for their interests effectively.
This participatory process is designed to empower residents of Pemba by increasing their understanding of political systems, civic rights, and democratic processes. The initiative combines traditional and digital methods to engage the community in meaningful and accessible ways.
~~~~~~~~
~~~~~~~~
Through a series of interactive workshops, community forums, and hands-on activities, participants will explore key topics such as governance structures, the role of civic institutions, citizen rights and responsibilities, and strategies for effective advocacy and participation.Central to the process is the use of digital tools, including the Decidim platform, to create a space for open dialogue, collaborative learning, and collective decision-making. Participants will learn how to use these tools to voice their concerns, propose ideas, and engage with local authorities and stakeholders in a structured and impactful manner.By fostering a culture of active citizenship, this process seeks
~~~~~~~~
~~~~~~~~
to strengthen community bonds, enhance residents’ confidence in participating in governance, and build a foundation for more inclusive and democratic decision-making.
~~~~~~~~
debug: get machine-to-machine token for i0Rp***** {"sdk":"DecidimSDK"}
debug: get machine-to-machine token for i0Rp***** {"sdk":"DecidimSDK"}
debug: get machine-to-machine token for i0Rp***** {"sdk":"DecidimSDK"}
debug: get machine-to-machine token for i0Rp***** {"sdk":"DecidimSDK"}
debug: get machine-to-machine token for i0Rp***** {"sdk":"DecidimSDK"}
debug: get machine-to-machine token for i0Rp***** {"sdk":"DecidimSDK"}
debug: get machine-to-machine token for i0Rp***** {"sdk":"DecidimSDK"}
debug: get machine-to-machine token for i0Rp***** {"sdk":"DecidimSDK"}
debug: get machine-to-machine token for i0Rp***** {"sdk":"DecidimSDK"}
warn: Published manifest accountability has no chat binding. {"sdk":"DecidimSDK"}
warn: Published manifest meetings has no chat binding. {"sdk":"DecidimSDK"}
warn: Published manifest pages has no chat binding. {"sdk":"DecidimSDK"}
~~~~~~~~
You can do one of these actions:
* News [type=0, params={"component_id":"3","component_manifest":"blogs","space_manifest":"Decidim::ParticipatoryProcess","space_id":"1"}]
* Share your stories [type=1, params={"component_id":"5","component_manifest":"proposals","space_manifest":"Decidim::ParticipatoryProcess","space_id":"1"}]
* Vote on statements [type=1, params={"component_id":"1","component_manifest":"proposals","space_manifest":"Decidim::ParticipatoryProcess","space_id":"1"}]
* Ideas for better political literacy [type=1, params={"component_id":"4","component_manifest":"proposals","space_manifest":"Decidim::ParticipatoryProcess","space_id":"1"}]
~~~~~~~~