Skip to content

fix: WhatsApp bot undefined var, hardcoded URL, wrong package#1039

Open
mattcarrollcode wants to merge 1 commit into
meta-llama:mainfrom
mattcarrollcode:fix/whatsapp-bot-bugs
Open

fix: WhatsApp bot undefined var, hardcoded URL, wrong package#1039
mattcarrollcode wants to merge 1 commit into
meta-llama:mainfrom
mattcarrollcode:fix/whatsapp-bot-bugs

Conversation

@mattcarrollcode
Copy link
Copy Markdown

Summary

  • Replace undefined ACCESS_TOKEN with META_ACCESS_TOKEN (runtime crash on line 59/72)
  • Replace hardcoded ngrok tunnel URL with BASE_URL env var
  • Fix file handle leak in send_audio_message (file opened twice)
  • Remove wrong dotenv==0.9.9 package (correct python-dotenv already listed)

Motivation

send_audio_message() crashes at runtime because ACCESS_TOKEN is never defined — only META_ACCESS_TOKEN is. A developer's ngrok URL was committed. The dotenv PyPI package is not python-dotenv.

Test plan

  • Verify webhook_utils.py has no references to undefined variables
  • Verify no hardcoded URLs remain
  • Verify requirements.txt installs cleanly

- Replace undefined ACCESS_TOKEN with META_ACCESS_TOKEN (runtime crash)
- Replace hardcoded ngrok URL with BASE_URL env var
- Fix file handle leak in send_audio_message (double-open)
- Remove wrong dotenv==0.9.9 package (python-dotenv already present)
@meta-cla meta-cla Bot added the cla signed label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant