Send messages without waiting on a chat

Hi all,

I’m playing around with the DeltaChat python bindings (GitHub - deltachat/deltachat-core-rust: Delta Chat Rust Core library, used by Android/iOS/desktop apps and bindings) and could run the echo_and_quit.py successfully. All of the bot examples assume, that one account send them a message which they can reply.

Now my question:
Is it possible to send a message to a regular DeltaChat contact (e.g. for IoT devices reporting certain state information)?

Thanks for some clarification,
Matthias

yes it’s possible to send messages with the python bindings, without the need for it being a reply to a user sent message.

Though I currently don’t have an example for this usage ready.
You might look at the code for run_cmdline copy its code, remove what you don’t need and use Account directly as you please.

You can create a contact (admin@example.com in this case) and then open 1:1 chat with them like this:

contact = account.create_contact("admin@example.com", name="Someone")
chat = contact.create_chat()
msg = chat.send_text("Report device metrics here")

There are many examples in the tests:

Hi @Simon @link2xt ,

thanks for your help! Will try it within the next days.

Cheers
Matthias