Execute slash command as slack bot

ubuntudroid picture ubuntudroid · Oct 3, 2016 · Viewed 11.1k times · Source

I'm writing a simple slack bot which should execute other slack commands upon being called. Everything is up and running, however the slack commands this bot issues don't seem to be executed.

For instance my bot posts /giphy kitten every hour and the message appears just like that in the channel (so the sending side seems to work), but the slash command itself isn't executed. If I post the same command into the same channel myself it works as expected. Are bots not allowed to execute slash commands?

Answer

Erik Kalkoken picture Erik Kalkoken · Dec 15, 2016

Bots can use the undocumented API method chat.command to invoke slash commands.

See here for an unofficial documentation page of this API method.

This question was also answered here.