python-facebook icon indicating copy to clipboard operation
python-facebook copied to clipboard

Send a Basic Text can not tto send from pyfacebook

Open Antonkoch999 opened this issue 2 years ago • 0 comments

I try to send text message with help this enpount: https://developers.facebook.com/docs/messenger-platform/send-messages/

but if I do

        data = {"recipient": {"id": recipient_id}, "message": {"text": message}}
        return GraphAPI(
            app_id=settings.FACEBOOK_APP_ID,
            app_secret=settings.FACEBOOK_APP_SECRET_KEY,
            access_token=access_token,
            version=self.version,
        ).post_object(object_id=page_id, connection="messages", data=data)

I have a problem, recipient is empty, because if I send data=data, {"recipient": {"id": recipient_id}} become recipient=id

Antonkoch999 avatar Dec 05 '23 10:12 Antonkoch999