-2

I'm sending message with button attachment to mattermost channel :

props = {
  "attachments": [
    {
      "pretext": "This is the attachment pretext.",
      "text": "This is the attachment text.",
      "actions": [
  {
    "id": "vote0",
    "type": "button",
    "name": "Yes",
    "style": "default"
  }]}]}

What I'm expecting: when the user clicks the button, a message is sent with some button text to the same channel, for example button name. In this case if the user clicked button, he sends message "Yes" to this channel.

In other words, I want the user not to type message, but select his choice, and this choice will be sent as a text.

My mattermost server has slash commands, including /echo command. How can I achieve this behavior?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Denisov Jr.
  • 91
  • 3
  • 11

0 Answers0