'Does slack have a method for triggering a command?

I built a slackbot for my startup. I would like to trigger things like /poll. Using client.chat_postMessage posts rather as plain text without triggering the command. I tried to follow How do you invoke the /poll command using the Slack API?, but of no use since that method doesn't exist anymore.



Solution 1:[1]


There are certain types of interaction triggers provided by slack:

  1. Interactions that happen on a schedule
  2. Interactions initiated by external services
  3. Events API pushes
  4. User invocation

https://api.slack.com/interactivity#triggers

Since you have mentioned about chat.PostMessage,
you might want to look into Interactivity in Block Kit (User Invokation)
https://api.slack.com/block-kit/interactivity

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Suyash Gaur