This repository contains a collection of ready-to-use examples for the Programmable Chat feature.
Each example is a self-contained .js
file that demonstrates how to extend chat behavior using JavaScript logic.
Each file in /handlers
follows the format:
const handler = async (message, user, accept, resolve, reject, fetch) => {
// Your logic here
};
export default await handler(env.MESSAGE, env.USER, env.ACCEPT, env.RESOLVE, env.REJECT, env.FETCH);
Copy the contents of an example file into your programmable chat editor, test it, and save.
You can find more details in the Programmable Chat Documentation.
Got a useful snippet? Feel free to open a PR and share it with the community.