{"id":16580882,"url":"https://github.com/alexpineda/charmflow","last_synced_at":"2025-03-06T00:16:06.827Z","repository":{"id":57197083,"uuid":"435268998","full_name":"alexpineda/charmflow","owner":"alexpineda","description":"An easy bot configurator for Eris","archived":false,"fork":false,"pushed_at":"2021-12-16T16:54:07.000Z","size":192,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-19T16:06:25.102Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexpineda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-05T20:16:24.000Z","updated_at":"2021-12-16T16:54:09.000Z","dependencies_parsed_at":"2022-09-16T13:11:36.600Z","dependency_job_id":null,"html_url":"https://github.com/alexpineda/charmflow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpineda%2Fcharmflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpineda%2Fcharmflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpineda%2Fcharmflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpineda%2Fcharmflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexpineda","download_url":"https://codeload.github.com/alexpineda/charmflow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242123334,"owners_count":20075348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T22:27:39.275Z","updated_at":"2025-03-06T00:16:06.794Z","avatar_url":"https://github.com/alexpineda.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CharmFlow\r\n\r\nEasily create Discord interaction sequences with [Eris](https://github.com/abalabahaha/eris).\r\n\r\n## Table of contents\r\n- [CharmFlow](#charmflow)\r\n  - [Table of contents](#table-of-contents)\r\n  - [Features](#features)\r\n  - [Setup](#setup)\r\n  - [Quick Example](#quick-example)\r\n  - [License](#license)\r\n\r\n## Features\r\n- Easily create sequential flows without worrying about interaction or message id's\r\n- Branch depending on user choices\r\n- Delete or keep messages easily\r\n- Cleanup at the end or after timing out\r\n- Low API surface mostly exposing Eris.ComponentInteraction at each step in the sequence\r\n- Automatically acknowledges interactions\r\n\r\n## Setup\r\nTo run this project, install it locally using npm:\r\n\r\n```\r\n$ npm install --save charmflow\r\n```\r\n\r\nor with yarn\r\n\r\n```\r\n$ yarn add -S charmflow\r\n```\r\n\r\n## Quick Example\r\n```js\r\nconst charmFlow = new CharmFlow(erisClient);\r\n\r\ncharmFlow.onCommand(\"setup\")\r\n    .flow(interaction =\u003e interaction.createFollowup(\"Hey welcome to My Bot, this is a quick setup guide!\"))\r\n    .keepMessage()\r\n    .flow(interaction =\u003e interaction.createFollowup(/* ... message with components ... */))\r\n    .flow((interaction, flow) =\u003e { \r\n    \t// next step, handle response, store stuff in db, etc..\r\n        if (interaction.data.values.includes(\"yes\")) {\r\n\t      // conditionally kick off other subflows with flow()\r\n        }\r\n    })\r\n    .deleteMessages() // delete top level messages except for the first\r\n    .end(interaction =\u003e interaction.editOriginalMessage(\"all done!\"))\r\n```\r\n\r\nMore examples can be found in the examples folder.\r\n\t\r\n## License\r\nMIT\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpineda%2Fcharmflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexpineda%2Fcharmflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpineda%2Fcharmflow/lists"}