Add userIsBot field to User type - #158
Merged
Merged
Conversation
The Slack API returns is_bot on user objects (from users.list, users.info, etc.) but the library was not decoding it. This field is useful for filtering bot users from channel member lists. Uses Maybe Bool for backwards compatibility with responses that may not include the field. Made-with: Cursor
ldub
approved these changes
Apr 3, 2026
lf-
reviewed
Apr 3, 2026
| , userIsPrimaryOwner :: Maybe Bool | ||
| , userIsRestricted :: Maybe Bool | ||
| , userIsUltraRestricted :: Maybe Bool | ||
| , userIsBot :: Maybe Bool |
Contributor
There was a problem hiding this comment.
ideally we have coverage for this on a golden test if possible.
rjmholt
added a commit
that referenced
this pull request
Apr 3, 2026
Covers users.list response deserialization with a fixture containing a human user, a bot user (is_bot: true), and a deleted user. Exercises the userIsBot field added in #158. Made-with: Cursor
2 tasks
rjmholt
added a commit
that referenced
this pull request
Apr 3, 2026
Covers users.list response deserialization with a fixture containing a human user, a bot user (is_bot: true), and a deleted user. Exercises the userIsBot field added in #158. Made-with: Cursor
rjmholt
added a commit
that referenced
this pull request
Apr 3, 2026
## Summary - Adds golden test coverage for `users.list` response deserialization (`ListRsp`) - The fixture includes three users exercising key fields: - A human user (`is_bot: false`) with full profile - A bot user (`is_bot: true`) without a profile - A deleted human user (`is_bot: false`, `deleted: true`) - Exercises the `userIsBot` field added in #158 ## Test plan - [x] All 83 tests pass (82 existing + 1 new golden test) - [x] Golden file correctly captures `userIsBot = Just True` for the bot and `Just False` for humans Made with [Cursor](https://cursor.com)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
userIsBot :: Maybe Boolto theUserrecord type inWeb.Slack.Useris_boton user objects (fromusers.list,users.info, etc.) but the library was not decoding itMaybe Boolfor backwards compatibility, consistent with the other boolean fields (userIsAdmin,userIsOwner, etc.)Motivation
We need to filter bot users from channel member lists in MWB's Good Morning bot. Without
is_boton theUsertype, there's no reliable way to distinguish bots from humans using the library.Test plan
deriveFromJSONTH handles the new field automatically)Maybe Boolso existing JSON withoutis_botdeserializes asNothingMade with Cursor