How can I make it so that slack bots can use Giphy?

后端 未结 2 1515
执笔经年
执笔经年 2021-02-19 01:41

For some reason, the existing Giphy app for slack does not allow bots to call a GIF from giphy.com

If I type \"/Giphy sad\", the Giphy app will automatically load a sad

相关标签:
2条回答
  • 2021-02-19 02:09

    The official API does not support invoking other slash commands, but there is an unofficial API method that does it:chat.command.

    Note that this will only work in situations where you have full control over a Slack workspace and can use legacy tokens.

    0 讨论(0)
  • 2021-02-19 02:11

    I'm assuming this is because giphy intentionally excluded bots from being able to call the command? Or is it that bots can't call commands in general?

    Bot users cannot invoke Slash commands. This is a restriction by Slack and not Giphy or any other integration. :(

    So if you want to get gifs from Giphy, you will have to implement that yourself using the Giphy API. Thankfully, the Giphy API is super easy to use. Giphy API

    In a recent hackathon project I built this for Slack, which you may find useful. It get's a random gif that is tagged "fail" from Giphy and then posts it as a message in Slack.

    0 讨论(0)
提交回复
热议问题