The use case I am trying to implement is actually to just get hubot to /leave. Since 99% of users on our slack team can't /kick rebot, it'd be nice to be able to ask hubot to leave instead of asking an admin to come into the channel and kick it for us.
However, it seems hubot can only send raw text messages. I can't get it to send commands to slack. Not sure if I'm doing something wrong or what. I guess a mechanism to send any arbitray /slash commands to slack would be pretty useful.
Unless there are some security/abuse issues there. E.g. usage of the /kick command on slack teams where anyone can kick, or usage of commands like /msg to message other users via hubot without the receiver knowing who it was really from. Similar for /invite and not even sure what /feedback could be abused for but i'm sure it could.
@tigris, until there's something official, I've made a Hubot wrapper for the Slack web API that'd allow you to leave a channel with robot.slack.channels.leave({channel: "#somechan"}).
Edit (5 Jul): Nevermind, I'm an idiot, channels.leave can't be called by bots. That's a bit silly.
Under the hood, most of the slash commands you've cited are just API methods that you'd be able to call. The main restriction is that bot users can't call everything, as @ORBAT pointed out. channel.leave isn't one of those though. https://api.slack.com/bot-users is the list of function.
So, I think we can close this as a feature request to be able to run slash commands, and instead open something to make it possible for hubot to leave a room. Does that sound reasonable?
Still looking for a solution to bot users being able to trigger slash commands. In my case, I want to trigger prompts to slash commands with cron, but maintain only one CLI.
Edit: I found an answer here: https://stackoverflow.com/questions/39829741/execute-slash-command-as-slack-bot
Unfortunately, the chat.command endpoint requires a scope that is no longer available to third party developers, so the only way to call it is by logging in as a user, with username and password鈥nd then we veer into highly undocumented and super insecure territory 馃槩 (馃憢 ex-Slack platform engineer and developer relations here 馃槈)
Most helpful comment
Unfortunately, the
chat.commandendpoint requires a scope that is no longer available to third party developers, so the only way to call it is by logging in as a user, with username and password鈥nd then we veer into highly undocumented and super insecure territory 馃槩 (馃憢 ex-Slack platform engineer and developer relations here 馃槈)