Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bot_profile to messages #794

Merged
merged 1 commit into from
Sep 9, 2020
Merged

Add bot_profile to messages #794

merged 1 commit into from
Sep 9, 2020

Conversation

Jmainguy
Copy link
Contributor

@Jmainguy Jmainguy commented Sep 8, 2020

Add testing for new fields

@Jmainguy
Copy link
Contributor Author

Jmainguy commented Sep 8, 2020

I am not a slack expert, but with slack.OptionDebug(true), I get this output when receiving a message from a bot.

{
    "type": "message",
    "subtype": "bot_message",
    "text": "<@U01AN1UT741> has created a new story for estimation.",
    "suppress_notification": false,
    "bot_id": "B01AZA490HE",
    "team": "T01A9CUMPQA",
    "bot_profile": {
        "id": "B01AZA490HE",
        "deleted": false,
        "name": "storypoker",
        "updated": 1599574335,
        "app_id": "A6DB2SWUW",
        "icons": {
            "image_36": "https://slack-files2.s3-us-west-2.amazonaws.com/avatars/2017-10-24/261138718469_ada58732a18da119678d_36.png",
            "image_48": "https://slack-files2.s3-us-west-2.amazonaws.com/avatars/2017-10-24/261138718469_ada58732a18da119678d_48.png",
            "image_72": "https://slack-files2.s3-us-west-2.amazonaws.com/avatars/2017-10-24/261138718469_ada58732a18da119678d_72.png"
        },
        "team_id": "T01A9CUMPQA"
    },
    "blocks": [],
    "channel": "C01AZ844Z32",
    "event_ts": "1599574912.002300",
    "ts": "1599574912.002300"
}

Username/Icons is not always passed, but the bot_profile appears to be in my testing, so adding it as a possibility here is super helpful.

Also, why this output is so different from https://api.slack.com/events/message/bot_message I would be glad to hear, is Slacks API docs just lagging behind?

Add testing for new fields
@kanata2
Copy link
Member

kanata2 commented Sep 9, 2020

Also, why this output is so different from https://api.slack.com/events/message/bot_message I would be glad to hear, is Slacks API docs just lagging behind?

Yes, Slack API doc does not necessarily show the latest specifications...

Copy link
Member

@kanata2 kanata2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
Looks good to me :)

@kanata2 kanata2 merged commit cc94355 into slack-go:master Sep 9, 2020
@kanata2 kanata2 added this to the v0.7.0 milestone Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants