danswer-ai / danswer

Gen-AI Chat for Teams - Think ChatGPT if it had access to your team's unique knowledge.
https://docs.danswer.dev/
Other
9.73k stars 1.08k forks source link

Fix "cannot access local variable" for bot direct messages #1737

Open cpwetteronline opened 2 days ago

cpwetteronline commented 2 days ago

On my Danswer installation I noticed this error in the background service when I sent a direct message to the bot user:

06/28/2024 09:40:19 AM          listener.py 415 : Failed to process slack event
  File "/app/danswer/danswerbot/slack/listener.py", line 413, in process_slack_event
  File "/app/danswer/danswerbot/slack/listener.py", line 353, in process_message
  File "/app/danswer/danswerbot/slack/handlers/handle_message.py", line 277, in handle_message
    if respond_slack_group_list:
UnboundLocalError: cannot access local variable 'respond_slack_group_list' where it is not associated with a value

I'm not familiar with the code or why the error is occuring now but this minor change should fix it (I already tested it on my installation)

vercel[bot] commented 2 days ago

@cpwetteronline is attempting to deploy a commit to the Danswer Team on Vercel.

A member of the Team first needs to authorize it.