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

Slack bot.info returns bot_not_found for bot id B01 #1260

Closed
nzlosh opened this issue Sep 3, 2022 · 2 comments
Closed

Slack bot.info returns bot_not_found for bot id B01 #1260

nzlosh opened this issue Sep 3, 2022 · 2 comments
Labels
question M-T: User needs support to use the project Version: 3x web-client

Comments

@nzlosh
Copy link
Contributor

nzlosh commented Sep 3, 2022

The errbot project uses the Python Slack SDK, users are reporting exceptions being raised when username resolution is applied to some bot messages.

Based on discussions here errbotio/err-backend-slackv3#74 (comment), B01 is being passed as a bot id, but will return not found when querying the slack API.

Is there any official documentation for this magic id and are there others that would need to be taken into account. I'm unable to find any official documentation regarding the bot id B01, with exception to the hubot slack SDK containing a mapping.

https://github.com/slackapi/hubot-slack/blob/c0c0d8d348b1522afa9835ef84a46f2bfbc6cdaf/src/client.coffee#L53

Why does the hubot code appear to have special handling of this id (and others) but the Python SDK does not? Are projects dependant on Python Slack SDK expected to implement their own error handling around this?

Reproducible in:

pip freeze | grep slack
python --version
sw_vers && uname -v # or `ver`

The Slack SDK version

slack-sdk==3.18.1
slackeventsapi==3.0.1

Python runtime version

Python 3.7.5

OS info

#203-Ubuntu SMP Wed Aug 10 17:40:03 UTC 2022

Steps to reproduce:

(Share the commands to run, source code, and project settings (e.g., setup.py))

Expected result:

Expect all bot id's sent from Slack's API to be resolvable via bot_info method.

Actual result:

API responds with bot found error when search bot id B01.

@seratch seratch added question M-T: User needs support to use the project web-client Version: 3x and removed untriaged labels Sep 5, 2022
@seratch
Copy link
Member

seratch commented Sep 5, 2022

Hi @nzlosh, thanks for writing in!

Is there any official documentation for this magic id and are there others that would need to be taken into account. I'm unable to find any official documentation regarding the bot id B01, with exception to the hubot slack SDK containing a mapping.

We're sorry about the confusion here and your understanding of the magic numbers here are correct. Also, unfortunately, there is no detailed guide about these special IDs (Bot ID: B01, user ID: USLACKBOT).

Why does the hubot code appear to have special handling of this id (and others) but the Python SDK does not? Are projects dependant on Python Slack SDK expected to implement their own error handling around this?

Ideally, all the official SDKs should have some feature similar to hubot-slack but we are not planning to add such at least in the short term. So, as a workaround, please go ahead with the same approach with hubot-slack, meaning skipping bots.info API calls with B01.

I hope this was helpful to you and we'd be grateful if you could understand this.

@nzlosh
Copy link
Contributor Author

nzlosh commented Sep 5, 2022

Thank you for taking the time to confirm that, I'll apply a workaround as suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question M-T: User needs support to use the project Version: 3x web-client
Projects
None yet
Development

No branches or pull requests

2 participants