Bots Buttons & Command auto-completion

Message Reply Suggestion Buttons

Like in Telegram - show buttons beneath a message that act as a shortcut for typing in the next command.
On click it sends the command.

Command Auto completion

As you type you get auto complete suggestions for commands that the bot with whom you’re chatting has.

1 Like

my notes about a way how we could realize it - protocol wise:

Reply Suggestion Buttons

Could look like in telegram. On click it sends the command.
It gets delivered in an Header (or in an attached file and the header just notifies dc that there is this file).
(also there might be a maximum of like 8 or 10 button and then a show more button in the ui that shows all buttons in a new dialogue)

Only show on Latest message / or only as special keyboard to avoid clutter?

Information:

Layout: Grid | List | table with x{2-3} columns
Buttons:
- Label (might contain emoji unicode)
- Message to be send in this channel

index/ ?Manifest? / Presets

one file that has lists all comands for autocompletion and presets for Reply Suggestion Buttons that can be refered by the Reply Suggestion Buttons headers to safe trafic.

DC always use the last one it got from a particular bot and the bot is responsible for sending the client a new one when the hash canged (automatic handling for updating clients could be integrated in dc core)

Information

Hash of data // for integrity chacks and to compare versions
Commands List:
 Array of Commands:
 - command (special syntax to enable typed placeholders that there can be suggestions for enums and the keyboard can switch to a numeric one on number input and so on.)
 - (optional) scope: only Group | only Direct Chat with the bot
Reply Suggestion Buttons presets List:
[id]: Reply Suggestion Buttons Data

When an Message references an preset id that isn’t defined in there, the dc ui will instead show a button to send an system message to the bot to resend its “index/Manifest”. When the bot doesn’t have it it’ll log the incident it somewhere for the bot admin to check.

@adbenitez

Ah also note worthy is that @adbenitez uses HTML files with mailto links as a way to provide a GUI for his simplebot.
And I threw together a small companion app that opens zipped html files, because unziped ones are a waste of mobile data(html compresses super well). Though Custom GUI / DeltaChat-webapps are a topic for a dedicated Feature Proposal.

Mentioned Projects:

I think gzipped html, through deflate implementations already in software such as Apache HTTP https://httpd.apache.org/docs/current/mod/mod_deflate.html (and supported by most of web browsers), it would be better. Anyways @adbenitez told me about that, I only think you had the intention to implement it on another way and @adbenitez did not know about that.

We can add gzip and gzipped tarball support to zhv.
I used plain zip because I think it’s easier for a user to understand. (also - does it make a big difference? :eyes:)
Can you elaborate more on your point on how browser support helps? The ZHV app is only a wrapper for the system installed webview (thats why it is so small) - It extracts the zipfile and then loads it into the webview.

Also this discussion is a bit offtopic for the bot buttons, so lets rather keep it short.

I think you are confused, this kind of compression is supported with the http protocol, when the server and the client are communicating, the client advertises it supports some kind of compression and the server send a reply with a header set to the type of compressed data, but I don’t think it is possible to have a local .html file compressed and open it with a browser, if it is possible please elaborate and provide steps to reproduce

1 Like