Skip to content
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

Open
skshadan opened this issue Feb 6, 2023 · 2 comments
Open

Looping old messages ( I am Building a chatbot for Whatsapp) #63

skshadan opened this issue Feb 6, 2023 · 2 comments

Comments

@skshadan
Copy link

skshadan commented Feb 6, 2023

if i re deploy the bot on heruku, it's looping through the old messages and spamming.
PLS HELP TO FIX IT!'

HEREUKU LOGS!
image

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"]

@Kalebu
Copy link
Contributor

Kalebu commented Feb 12, 2023

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?

@Kissabi
Copy link

Kissabi commented Feb 29, 2024

I've the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants