Hi I’m trying to write a bot with deltachat_rpc_client. However, I’ve run into an issue where I have no idea what I can and can’t call on each event. Is there a list of types for each type of event? Mainly I’m looking for help with adding members
@hooks.on(events.MemberListChanged) def on_memberlist_changed(event): if event.member_added: pass
I would like to know if I can send a message similar to events.NewMessage? I have not been able to find examples of the types with deltachat_rpc_client.With deltabot_cli I am unable to find out how I can listen for when a member was added, if the later is possible I would prefer that
message_snapshot is added here, by the Bot/Client implementation:
This is indeed not well documented what this Bot/Client wrapping does. Raw event itself does not have message_snapshot. Event has chat_id and msg_id properties. When you have a chat_id and you have Account object, you can call Account.get_chat_by_id to get a Chat object (that is just a lightweight wrapper for chat ID and account ID) and from there call Chat.send_text.
I would suggest using
as the starting point, it has less abstraction layers (like hooks) and a simple event loop where you get raw events. Hooks look nice but will need some feedback from users and better documentation to make them work and not do what you don’t want them to do, e.g. you may sometimes not want to load the messages from some chat and hook implementation always loads the message snapshot for you currently.