# Types for events in deltachat\_rpc\_client

**URL:** <https://forum.delta.chat/t/types-for-events-in-deltachat-rpc-client/5119>\
**Category:** Bots\
**Tags:** development\
**Created:** [April 27, 2026, 4:50pm UTC](https://forum.delta.chat/t/types-for-events-in-deltachat-rpc-client/5119 "2026-04-27T16:50:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lunarequest](https://forum.delta.chat/user_avatar/forum.delta.chat/lunarequest/32/3234_2.png) [@Lunarequest](https://forum.delta.chat/u/Lunarequest)\
**Post date:** [April 27, 2026, 4:50pm UTC](https://forum.delta.chat/t/types-for-events-in-deltachat-rpc-client/5119/1 "2026-04-27T16:50:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![link2xt](https://forum.delta.chat/letter_avatar_proxy/v4/letter/l/ee7513/32.png) [@link2xt](https://forum.delta.chat/u/link2xt)\
**Post date:** [April 27, 2026, 5:08pm UTC](https://forum.delta.chat/t/types-for-events-in-deltachat-rpc-client/5119/2 "2026-04-27T17:08:38Z")

</div>

Currently the best starting point for JSON-RPC documentation is [https://jsonrpc.delta.chat/](https://jsonrpc.delta.chat/)  
You can see all event types at [EventType | @deltachat/jsonrpc-client](https://js.jsonrpc.delta.chat/types/T.EventType.html), it is a typescript documentation but the structure of events is the same.  
Alternatively, look at the Rust source from which these types are generated:  
[core/deltachat-jsonrpc/src/api/types/events.rs at main · chatmail/core · GitHub](https://github.com/chatmail/core/blob/main/deltachat-jsonrpc/src/api/types/events.rs)

---

<div class="post-metadata">

**Author:** ![Lunarequest](https://forum.delta.chat/user_avatar/forum.delta.chat/lunarequest/32/3234_2.png) [@Lunarequest](https://forum.delta.chat/u/Lunarequest)\
**Post date:** [April 27, 2026, 7:27pm UTC](https://forum.delta.chat/t/types-for-events-in-deltachat-rpc-client/5119/3 "2026-04-27T19:27:00Z")

</div>

Is there a list if functions I can call? For example this is a snippet from the echo bot example.

```python
@hooks.on(events.NewMessage)
def echo(event):
    snapshot = event.message_snapshot
    snapshot.chat.send_text(snapshot.text)

```

Can one call `chat.send_text` on all events? Sorry if these are silly questions, the documentation is a little lacking

---

<div class="post-metadata">

**Author:** ![link2xt](https://forum.delta.chat/letter_avatar_proxy/v4/letter/l/ee7513/32.png) [@link2xt](https://forum.delta.chat/u/link2xt)\
**Post date:** [April 27, 2026, 8:11pm UTC](https://forum.delta.chat/t/types-for-events-in-deltachat-rpc-client/5119/4 "2026-04-27T20:11:10Z")

</div>

`message_snapshot` is added here, by the `Bot`/`Client` implementation:

> <https://github.com/chatmail/core/blob/b806efa0965e4f06ca8b8572589efca9d8e54508/deltachat-rpc-client/src/deltachat_rpc_client/client.py#L168>

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](https://py.delta.chat/jsonrpc/reference.html#deltachat_rpc_client.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`](https://py.delta.chat/jsonrpc/reference.html#deltachat_rpc_client.Chat.send_text).

I would suggest using

> <https://github.com/deltachat-bot/echo/blob/9e726cc3683cc67197291dc4d9de595bc71b3046/python/echo_bot.py>

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.

---

<div class="post-metadata">

**Author:** ![Lunarequest](https://forum.delta.chat/user_avatar/forum.delta.chat/lunarequest/32/3234_2.png) [@Lunarequest](https://forum.delta.chat/u/Lunarequest)\
**Post date:** [April 28, 2026, 3:05am UTC](https://forum.delta.chat/t/types-for-events-in-deltachat-rpc-client/5119/5 "2026-04-28T03:05:28Z")

</div>

Thank you, just to confirm there aren’t any types/library stubs for `deltachat_rpc_client` right?

---

<div class="post-metadata">

**Author:** ![r10s](https://forum.delta.chat/user_avatar/forum.delta.chat/r10s/32/1513_2.png) [@r10s](https://forum.delta.chat/u/r10s)\
**Post date:** [October 6, 2026, 3:41pm UTC](https://forum.delta.chat/t/types-for-events-in-deltachat-rpc-client/5119/6 "2026-10-06T15:41:09Z")

</div>


