errbotio / errbot

Errbot is a chatbot, a daemon that connects to your favorite chat service and bring your tools and some fun into the conversation.
http://errbot.io
GNU General Public License v3.0
3.09k stars 608 forks source link

using errbot command from user results in channel not found slack #1645

Closed gondaliyasagar216 closed 6 months ago

gondaliyasagar216 commented 1 year ago

Need help with

Issue description i am running errbot with slack bot when using errbot commands from app itself or public/private channels it works fine but if i try from user it results in below error slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://www.slack.com/api/conversations.info) The server responded with: {'ok': False, 'error': 'channel_not_found'}

Steps to reproduce run errbot with slack backend try to run command from slack user !tryme

Environment (please complete the following information):

Additional info If you have any more information, please specify it here.

sijis commented 1 year ago

Is there a code sample, usage example that shows a working/non-working scenario?

I'm confused by the statement of "from app itself".

gondaliyasagar216 commented 1 year ago

[from](Screenshot 2023-06-15 at 7 20 58 AM) app i mean slack app/bot , i am attaching screenshot as well so from channel, Apps (action required) when i do !tryme it works

but when i do it from user(sagar gondaliya) i see error bot received command but

13:42:16 ERROR slack_sdk.socket_mode.bui Failed to run a request listener: The request to the Slack API failed. (url: https://www.slack.com/api/conversations.info) The server responded with: {'ok': False, 'error': 'channel_not_found'} Traceback (most recent call last): File "/../errbot/virtualenv/lib/python3.9/site-packages/slack_sdk/socket_mode/client.py", line 143, in run_message_listeners listener(self, request) # type: ignore File "/../errbot/backend/err-backend-slackv3/src/slackv3/slackv3.py", line 388, in _sm_generic_event_handler self._generic_wrapper(req.payload) File "/../errbot/backend/err-backend-slackv3/src/slackv3/slackv3.py", line 367, in _generic_wrapper return event_handler(self.slack_web, event) File "/../errbot/backend/err-backend-slackv3/src/slackv3/slackv3.py", line 539, in _handle_message msg.frm = SlackPerson(webclient, user, channel) File "/../errbot/virtualenv/lib/python3.9/site-packages/slackv3/person.py", line 52, in init self._cache_channel_info() File "/../errbot/virtualenv/lib/python3.9/site-packages/slackv3/person.py", line 157, in _cache_channel_info res = self._webclient.conversations_info(channel=self.channelid) File "/../errbot/virtualenv/lib/python3.9/site-packages/slack_sdk/web/client.py", line 2508, in conversations_info return self.api_call("conversations.info", http_verb="GET", params=kwargs) File "/../errbot/virtualenv/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 156, in api_call return self._sync_send(api_url=api_url, req_args=req_args) File "/../errbot/virtualenv/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 187, in _sync_send return self._urllib_api_call( File "/../errbot/virtualenv/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 309, in _urllib_api_call return SlackResponse( File "/../errbot/virtualenv/lib/python3.9/site-packages/slack_sdk/web/slack_response.py", line 199, in validate raise e.SlackApiError(message=msg, response=self) slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://www.slack.com/api/conversations.info) The server responded with: {'ok': False, 'error': 'channel_not_found'}