Let's have a brief talk about shortcuts, bot actions, message actions or just menus. All of the words i just listed describe the same feature and let's officially call them shortcuts.
So what exactly are shortcuts in the tekos chat?
They appear in the chat menu as a programmable blocks for you to use. And don't worry, by programming i mean connecting nodes in the flow, as usual.
Where i can find them in the chat?
We split them to two types: global shortcut & message shortcut.
For the Global shortcut. You can find the menu under the message input in the chat. It appears as a three bar hamburger with a plus sign next to it. Don't worry if you can't find the menu right now, by the default this one is empty. Similar case is for the mobile, You can find the menu under the message input it also appears as a three bar hamburger.
Contrary to global, the Message shortcut have some basic options like: Remove, Forward Message, Share Content, Quote. Maybe you already know where that menu is placed, if not you can find it after hovering on any message in the tekos chat. It's a three dots menu on the right side. And for the mobile you have to press and hold down the message to see the options.
But what can i do with the shortcuts?
As always your imagination is the limit and also the three types of shortucts action type.
"Display Modal" - Popup that displays the Adaptive Card.
"External URL" - Link to external page, you can also display pages from flow by GET request.
"Backend action" - It is used to trigger an POST request. Most of use cases will work with this action type. And also here we can find a big difference between global and message shortcut. Global shortcut sends only the roomID in the payload, and the message sends roomID, sender of the message and the most important one eventID.
Let's start building!
You can find here bunch of examples.
Take a look on the red subflow named "Create 1 shortcut" - we have prepared it for you to easily create a shortcut.
- Input Name to be displayed in the Menu.
- Select a type Global | Message
- Choose select response type: Display Moda | External URL | Backend Action
- For the response URL stuff get a little bit more complicted, but don't worry. Link may vary on the response type. For the Extermal Url just paste the link to the page, but for the Display Modal and Backend Action enter the link to the post action. Let's take an example on the image above about "Send simple message to the current room".
https://hg1dxk.tekos.co/message should contain yours tekos instance name as a prefix before .tekos.co and the trigger for the post webhook. Remember that you can trigger POST action outside of the tekos.
Technically that's it for the shortcuts, but that's not enough to get them working. Shortcuts are appended to the bot/app created that's why you need to create one in the same flow tab.
Here you can find complex shortcut framework (Click me)
- Right now we work on how to delete specific shortcut not all of them at once.