0.0.5 • Published 2 years ago

charmflow v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

CharmFlow

Easily create Discord interaction sequences with Eris.

Table of contents

Features

  • Easily create sequential flows without worrying about interaction or message id's
  • Branch depending on user choices
  • Delete or keep messages easily
  • Cleanup at the end or after timing out
  • Low API surface mostly exposing Eris.ComponentInteraction at each step in the sequence
  • Automatically acknowledges interactions

Setup

To run this project, install it locally using npm:

$ npm install --save charmflow

or with yarn

$ yarn add -S charmflow

Quick Example

const charmFlow = new CharmFlow(erisClient);

charmFlow.onCommand("setup")
    .flow(interaction => interaction.createFollowup("Hey welcome to My Bot, this is a quick setup guide!"))
    .keepMessage()
    .flow(interaction => interaction.createFollowup(/* ... */))
    .flow((interaction, flow) => { 
        // do this if they picked yes
        if (interaction.data.values.includes("yes")) {
	      // optionally kick off other subflows with flow() or store stuff in db
        }
    })
    .deleteMessages() // delete top level messages except for the first
    .end(interaction => interaction.editOriginalMessage("all done!"))

More examples can be found in the examples folder.

License

MIT

0.0.5

2 years ago

0.0.4

2 years ago

0.0.40

2 years ago

0.0.31

2 years ago

0.0.3

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago