Appearance
Attachment menu โ
A bot can place an entry in the attachment menu โ the ๐ next to the input field โ and in the side menu, so its Mini App is one tap away inside any chat, not just the chat with the bot. It is the difference between an app the user has to go find and one that rides along everywhere.
Not implemented
The attachment menu needs a Mini App runtime to open into and @GromCore to configure the entry โ neither ships yet. This page describes the shape so it can be reviewed and built against. Implementation status.
Setting up the entry โ
Configured through @GromCore (/setattach), an entry declares:
- A name and an icon set โ static, animated, a macOS variant, and a side-menu variant, so the icon matches wherever it appears and adapts to the current theme (colour or monochrome).
- Which peer types it appears in โ any of
bot_pm(the chat with the bot),users,bots,groups,channels. An entry meant for group utilities need not clutter one-to-one chats. request_write_accessโ whether installing also asks the user to let the bot message them, shown as a checkbox in the install dialog.
The install flow โ
A user adds the entry one of two ways: from the attachment menu directly, or by opening a deep link. The link form carries an install intent and an optional start parameter:
https://code.casinoplaneta.info/<botname>?attach=&startattach=<param>From there the client:
- Calls
getAttachMenuBot(bot)to read the entry's metadata. - Shows the install dialog โ with the write-access checkbox if
request_write_accesswas set. - On confirmation, calls
toggleBotInAttachMenu(bot, enabled, write_allowed?)and sets theattach_menu_enabledflag.
The installed set is read with getAttachMenuBots(hash) and cached client-side. Removing an entry is a long-press โ Remove from menu.
Attachment menu vs. Mini App open modes โ
Installing the entry is not the same as opening the app. The attachment menu is one of the Mini App opening modes โ it is where the app launches from. Everything about the app itself โ reading the launch context, verifying initData, the event bridge โ is identical to every other open mode. This page is only about getting the entry into the menu; once it opens, you are building an ordinary Mini App.
The startattach parameter reaches your app the same way a deep-link start parameter does: as non-secret context you read from the launch data, never as a place to put a secret.