small demon, a familiar of a witch. imp is a set of bot creating utilities built on top of libcwtch-rs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sarah Jamie Lewis f704ffc574
Merge pull request 'echobot example' (#1) from echobot into main
1 month ago
examples echobot example 1 month ago
src drop serde dep 11 months ago
.gitignore initial import of imp bot framework from update_bot 1 year ago
Cargo.toml echobot example 1 month ago
LICENSE license 1 year ago
README.md version update 11 months ago
imp.jpg initial import of imp bot framework from update_bot 1 year ago
imp_color.jpg initial import of imp bot framework from update_bot 1 year ago
imp_details.txt initial import of imp bot framework from update_bot 1 year ago
rustfmt.toml First cut of canonical events 1 year ago

README.md

imp

small demon, a familiar of a witch

imp is a set of bot creating utilities built on top of libcwtch-rs

It is in the very early prototype stage with one prototype use in the Cwtch update bot

Usage

Start with creating a Behaviour struct and populating it with your desired set of bot behaviours, then imp::spawn your bot with the behaviour.

To handle Cwtch events you can either

  • Define a struct fulfilling the imp::EventHandler::event_loop function which has the capacity to support all the events libCwtch can emit
  • Override specific on_x_event functions in imp::EventHandler such as on_new_message_from_contact
    • This is newer and more will be defined in later versions

Finally, run the imp my_imp.event_loop::<MyEventHandlerType>(update_bot.borrow_mut());

Examples