首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Botkit回复一张图片

Botkit回复一张图片
EN

Stack Overflow用户
提问于 2018-12-05 05:46:08
回答 1查看 661关注 0票数 0

你好,我试图让botkit在我的回调函数中回复一个图像,但不确定convo.say()bot.reply()将如何处理发送图像。有没有人有让slackbot回复图片的经验?

EN

回答 1

Stack Overflow用户

发布于 2019-02-24 05:05:05

由于您使用的是slack,因此应该可以使用交互式消息。

下面是slack自己的交互式消息文档中的一个示例消息对象(可在此处找到:https://api.slack.com/docs/message-buttons)

代码语言:javascript
复制
{
    "text": "New comic book alert!",
    "attachments": [
        {
            "title": "The Further Adventures of Slackbot",
            "fields": [
                {
                    "title": "Volume",
                    "value": "1",
                    "short": true
                },
                {
                    "title": "Issue",
                    "value": "3",
            "short": true
                }
            ],
            "author_name": "Stanford S. Strickland",
            "author_icon": "http://a.slack-edge.com/7f18https://a.slack-edge.com/a8304/img/api/homepage_custom_integrations-2x.png",
            "image_url": "http://i.imgur.com/OJkaVOI.jpg?1"
        },
        {
            "title": "Synopsis",
            "text": "After @episod pushed exciting changes to a devious new branch back in Issue 1, Slackbot notifies @don about an unexpected deploy..."
        },
        {
            "fallback": "Would you recommend it to customers?",
            "title": "Would you recommend it to customers?",
            "callback_id": "comic_1234_xyz",
            "color": "#3AA3E3",
            "attachment_type": "default",
            "actions": [
                {
                    "name": "recommend",
                    "text": "Recommend",
                    "type": "button",
                    "value": "recommend"
                },
                {
                    "name": "no",
                    "text": "No",
                    "type": "button",
                    "value": "bad"
                }
            ]
        }
    ]
}

您还可以从此处的https://api.slack.com/docs/messages/builder创建自己的自定义消息

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53621916

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档