-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Looping old messages ( I am Building a chatbot for Whatsapp) #63
Comments
Hi @shadaenx Can you provide more context about the scenario, Like the snippet of webhook you're running and if there are errors being raised causing the messages to be resent? |
I've the same issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if i re deploy the bot on heruku, it's looping through the old messages and spamming.
PLS HELP TO FIX IT!'
HEREUKU LOGS!
if request.method == 'POST':
body = request.getjson()
print(body)
if body.get("object") and body.get("entry") and body["entry"][0].get("changes") and
body["entry"][0]["changes"][0].get("value").get("messages"):
from = body["entry"][0]["changes"][0]["value"]["messages"][0]["from"]
msg_id = body["entry"][0]["changes"][0]["value"]["messages"][0]["id"]
datetime_str = body["entry"][0]["changes"][0]["value"]["messages"][0]["timestamp"]
msgbody = body["entry"][0]["changes"][0]["value"]["messages"][0].get("text", {}).get("body", "")
name = body["entry"][0]["changes"][0]["value"]["contacts"][0]["profile"]["name"]
The text was updated successfully, but these errors were encountered: