weixin_39681724
2021-01-12 19:34 阅读 1

Slack not showing images from message

  • BotMan Version: whatever composer gave
  • PHP Version: 7.1.2
  • Messaging Service(s): slack/facebook
  • Cache Driver: redis

Description:

using code below, slack channel only shows the text and not the image. Same code in facebook messenger shows the image

Steps To Reproduce:


$botman->hears('photo', function (BotMan $bot) {
        // Build message object
        $message = Message::create('This is a photo of me')
                ->image('https://www.gravatar.com/avatar/4c7eec676a9b4662214e9198afa29acb');

        // Reply message object
        $bot->reply($message);
});

该提问来源于开源项目:botman/botman

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

6条回答 默认 最新

  • weixin_39671467 weixin_39671467 2021-01-12 19:34

    Hi,

    Same trouble for me here, still unanswered :( Please share if you find something !

    点赞 评论 复制链接分享
  • weixin_39922769 weixin_39922769 2021-01-12 19:34

    I'll try to look into both issues later today

    点赞 评论 复制链接分享
  • weixin_39671467 weixin_39671467 2021-01-12 19:34

    Thanks a lot mate !

    点赞 评论 复制链接分享
  • weixin_39788572 weixin_39788572 2021-01-12 19:34

    Maybe what could be done to ease the understanding and the issue is to clone the starter version of botman, which is studio and add the code that is failling.

    点赞 评论 复制链接分享
  • weixin_39922769 weixin_39922769 2021-01-12 19:34

    Which Slack integration method are you all using? Slack has quite a few options. RTM API Incoming webhook Message events

    点赞 评论 复制链接分享
  • weixin_39804631 weixin_39804631 2021-01-12 19:34

    Hi thank you for your interest.

    There is more information in my thread. Whatever the driver I'm using I get unsuccessful results.

    Although it's not very clear what driver is in use in some cases, until there I thought webhooks and message events used the same drivers. It is made harder by the differences between botman / studio and different versions of botman. Latest (unreleased master) botman seem to have changes in it but I can't get to make it work in Studio.

    I've spent the whole day trying to debug the process with botman 1.5.6 without luck. I'd like to avoid the RTM API which is harder to setup and weaker.

    All that I could get is that when a file is uploaded, two POST requests (one file_shared and one message type) are sent to botman, containing every useful information possible (including a working image URL) so the Slack side should be correctly set up.

    But, unlike when you respond with plain text, the Mpociot\BotMan\Message Object is empty (message and payload) when an image is uploaded (this happens at Collection::make($this->getMessages()) in loadActiveConversation ) so the image pattern is never checked for, and the requests voids.

    Could you please post an example of the correct way to use the non RTM slack driver ? Preferably with dev-version and new Slack repo ?

    I'm desperate to find a working solution. I can do anything to help debugging.

    Thanks a lot

    点赞 评论 复制链接分享

相关推荐