Register a new deltachat email with a bot

Hi everyone, I’m working on a bot written in C++ for an industrial application. I would like the bot to acquire a new email from a deltachat relay (like nine.testrun.org) upon first install on a machine. I can’t find anything in the core library…what technique should I use to achieve this?

Maybe this will help:

you may find the basics for writing a bot here: GitHub - deltachat-bot/echo: An echo bot in multiple languages to get you started

instead of configuration with email address and password you would need to configure with qr code:

dc_set_config_from_qr(context, "dcaccount:https://nine.testrun.org/new")

See docs: dc_set_config_from_qr

If you are using the cffi bindings, if you are using jsonrpc api, then the method is the same, but you would call it differently.

Hi Simon, unfortunately, my bot will be running on an industrial device without any QR code scanning capabilities. I currently do this step manually… I use a smartphone to capture the QR code and then manually copy the email and password into my bot. It works, but I’d like to make this step automatic during bot installation. The deltachat app for Android, for example, does this without using the camera, but I haven’t figured out how it does it. :wink:

wow! it works :slight_smile:
email address and password are simply random character sequences
Tks 9er.

You don’t need no scanning :slight_smile: The function name Simon has pointed to is misleading - it actually deals with URLs (text strings, often, but not always encded as QRs), not with QR-coded pictures.

So maybe Simon’s answer is better. At least, you will be using single API in your code.

1 Like

Thanks for the info…I’ll try it!

The QR codes are just QR-encoded URLs (run them thru any QR decoder, or copy-paste them from the app into a text file). You can paste a URL into the client GUI instead of scanning a QR code, or use them in code.

The invite URLs are actually just encoded OpenPGP key fingerprints used to set up encryption, dressed up as delta.chat URLs so that Android will let Deltachat get them (by pretending to “open” them), and confused users can easily find a help page.

More here: SecureJoin Protocol, other standards used in DC.

But yeah, making stuff up works. :slightly_smiling_face:

3 Likes