daveebbelaar / python-whatsapp-bot Goto Github PK
View Code? Open in Web Editor NEWBuild AI WhatsApp Bots with Pure Python
Home Page: https://www.datalumina.com
License: MIT License
Build AI WhatsApp Bots with Pure Python
Home Page: https://www.datalumina.com
License: MIT License
In whatsapp_utils.py
module the function process_whatsapp_message(body)
gets the wa_id
parameter, but in line 92 we sent the response to the hardcoded environment parameter "RECIPIENT_WAID"
.
In order to answer to any number that send us a message, get_text_message_input(current_app.config["RECIPIENT_WAID"], response)
should change to get_text_message_input(wa_id, response)
?
Or is there another way to respond to any number?
views.py
Change the end to the following. I commented out the original code and got the verification to work. I was getting a 403 error before.
@webhook_blueprint.route("/webhook", methods=["GET"])
def webhook_get():
return verify()
@webhook_blueprint.route("/webhook", methods=["POST"])
@signature_required
def webhook_post():
return handle_message()
"""
@webhook_blueprint.route("/webhook", methods=["POST", "GET"])
@signature_required
def webhook():
if request.method == "GET":
return verify()
elif request.method == "POST":
return handle_message()
"""
The code in assistants_quickstart.py will fail to run unless you programmatically define the assistant_id
.
i.e. line 94 goes from this:
assistant = client.beta.assistants.retrieve("asst_7Wx2nQwoPWSf710jrdWTDlfE")
to this:
assistant = client.beta.assistants.retrieve(assistant.id)
Any advice on how to deploy the app to production? It's my first time deploying a web app, and i'm having trouble on how to run both the run.py
file and the webhook command ngrok http --domain=your-domain.ngrok-free.app 8000
. Any hosting service recommendation/tutorial?
Comment out line 86 since this is for future. The program fails with this in it.
Love this project! Though, before I dive in: any way to limit access to the bot? I'd like to set it up for personal use/testing and obviously don't want to bear the costs of the whole world chatting with it 😁
Also would be nice to set a threshold on costs, let's say if above 100 Dollar/month warn and above 150 disable access.
I've been following the instructions up until the ngrok section and noticed that a Pro or Enterprise tier is required to proceed. I've only used the free tier so far. Is there a way to use that to proceed? If not, might be a good idea to write in the requirements that a paid subscription is required to proceed. Thanks for a great video & repo, keep up the good work!
Hi im facing some issues with randomness I dont know what it is, but sometimes messages are resending, open ai assitante send a message with no user interaction in th e chat..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.