cwtch-imp

Crates.iocwtch-imp
lib.rscwtch-imp
version0.3.1
sourcesrc
created_at2022-07-31 15:21:40.361095
updated_at2024-08-31 01:17:11.662563
descriptionsmall demon, a familiar of a witch. imp is a set of bot creating utilities built on top of libcwtch-rs
homepage
repositoryhttps://git.openprivacy.ca/cwtch.im/imp
max_upload_size
id636189
size581,612
Dan Ballard (dballard)

documentation

https://docs.rs/cwtch-imp/

README

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

Commit count: 0

cargo fmt