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

Bot user object missing the is_bot property #427

Closed
3 tasks done
Kleeahk opened this issue Jul 14, 2017 · 2 comments
Closed
3 tasks done

Bot user object missing the is_bot property #427

Kleeahk opened this issue Jul 14, 2017 · 2 comments
Labels
docs M-T: Documentation work only enhancement M-T: A feature request for new functionality

Comments

@Kleeahk
Copy link

Kleeahk commented Jul 14, 2017

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Description

Bot user objects are missing the is_bot property.

Reproducible in:

hubot-slack: 4.3.4
hubot: 2.19.0

Steps to reproduce:

  1. Add a hubot script to capture user objects from all messages
    robot.hear /.*/i, (res) ->
        console.log(JSON.stringify res.message.user)
  1. Put hubot in a channel with another bot
  2. Compare the output for messages from human users and bot users

Expected result:

  • Human user objects have is_bot: false
  • Bot user objects have is_bot: true
  • res.message.user.is_bot is true if a message came from a bot, false if it came from a human

Actual result:

  • Human user objects have is_bot: false
  • Bot user objects do not have the is_bot property.
  • res.message.user.is_bot always returns false

Attachments:

Sample output

# Human user
{  
   "user":{  
      "id":"U5D9X9TQR",
      "team_id":"T0CCQK2LA",
      "name":"katie",
      "deleted":false,
      "color":"9e3997",
      "real_name":"Katie",
      "tz":"America/Los_Angeles",
      "tz_label":"Pacific Daylight Time",
      "tz_offset":-25200,
      "profile":{  
         "avatar_hash":"gcdd8e1cb321",
         "first_name":"Katie",
         "last_name":"removed",
         "real_name":"Katie",
         "email":"removed",
         "image_24":"removed",
         "fields":null
      },
      "is_admin":false,
      "is_owner":false,
      "is_primary_owner":false,
      "is_restricted":false,
      "is_ultra_restricted":false,
      "is_bot":false,
      "updated":1499465955,
      "presence":"active"
   },
   "text":"test",
   "id":"1500059368.182916",
   "done":false,
   "room":"G5KJ9CLR3"
}
# Bot user
{  
   "user":{  
      "id":"B24KXQLQ5",
      "deleted":false,
      "name":"hubot",
      "updated":1472068471,
      "app_id":"A0F7XDU93",
      "icons":{  
         "image_36":"https://a.slack-edge.com/12b5a/plugins/hubot/assets/service_36.png",
         "image_48":"https://a.slack-edge.com/12b5a/plugins/hubot/assets/service_48.png",
         "image_72":"https://a.slack-edge.com/12b5a/plugins/hubot/assets/service_72.png"
      },
      "room":"G5KJ9CLR3"
   },
   "text":"test",
   "id":"1500059369.183102",
   "done":false,
   "room":"G5KJ9CLR3"
}
@aoberoi
Copy link
Contributor

aoberoi commented Aug 2, 2017

i agree that some normalization of these properties would be useful. at the very least, some documentation regarding what is and isn't expected on messages from a user or a bot. keep in mind that its not as simple as human versus bot because Authorship is complicated.

@aoberoi aoberoi added docs M-T: Documentation work only enhancement M-T: A feature request for new functionality labels Dec 18, 2017
@shaydewael shaydewael mentioned this issue Apr 5, 2018
2 tasks
@shaydewael
Copy link
Contributor

Fixed with #472

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs M-T: Documentation work only enhancement M-T: A feature request for new functionality
Projects
None yet
Development

No branches or pull requests

3 participants