Slash command gets a JSON payload from PHP and prints correctly (i.e. printing the contents of “text”, but seems to ignore “channel”. No matter what this is set to, the output is posted to the channel the command was called from.
Steps to reproduce
Version 4.2.0 on server, run slash command /hello from off-topic returning payload {“response_type”: “in_channel”, “channel”: “town-square”, “text”: “hello world”}
Expected/observed behavior
Expect output to be piped to “town-square”, but instead it is displayed in “off-topic”.
Additional question
If this can be made to work, is there a way for a command to output to multiple channels at once? (e.g. an announce command that posts to off-topic, town-square and ‘announcements’ at the same time?)
Essentially, yes. At the moment I’m still at the stage of testing what’s possible, but once it’s deployed to my team it would be useful for the outputs of certain bot commands to be sent to a “bot-output” channel no matter where they were run from (ideally it would be nice to be able to also have the announce command to print to multiple channels, but “sending to a single defined channel” is proving to be enough of a hurdle as-is)