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

[FIX] Persistent menu #15

Merged
merged 2 commits into from
Mar 11, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions ampalibe/messenger.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, access_token):
access_token (str): A facebook page access token
"""
self.token = access_token
self.url = "https://graph.facebook.com/v8.0/me"
self.url = "https://graph.facebook.com/v13.0/me"

@retry(requests.exceptions.ConnectionError, tries=3, delay=3)
def send_message(self, dest_id, message, prio=False):
Expand Down Expand Up @@ -292,7 +292,13 @@ def persistent_menu(self, dest_id, persistent_menu, action='PUT'):
if action == "PUT":
dataJSON = {
"psid": dest_id,
persistent_menu: persistent_menu
persistent_menu: [
{
"locale": "default",
"composer_input_disabled": 'false',
"call_to_actions": persistent_menu
}
]
}

res = requests.post(
Expand Down