Crates.io | cwtch-imp |
lib.rs | cwtch-imp |
version | 0.3.1 |
source | src |
created_at | 2022-07-31 15:21:40.361095 |
updated_at | 2024-08-31 01:17:11.662563 |
description | small demon, a familiar of a witch. imp is a set of bot creating utilities built on top of libcwtch-rs |
homepage | |
repository | https://git.openprivacy.ca/cwtch.im/imp |
max_upload_size | |
id | 636189 |
size | 581,612 |
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
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
imp::EventHandler::event_loop
function which has the capacity to support all the events libCwtch can emiton_x_event
functions in imp::EventHandler
such as on_new_message_from_contact
Finally, run the imp my_imp.event_loop::<MyEventHandlerType>(update_bot.borrow_mut());