Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Python client for FB Messenger Platform Bot

Project description Build Status

Python client for Messenger Platform API


pip install messengerbot


Read about Messenger Platform

from messengerbot import MessengerClient, messages, attachments, templates, elements

# Manully initialise client
messenger = MessengerClient(access_token='your_token')

# With env var export MESSENGER_PLATFORM_ACCESS_TOKEN=your_token
from messengerbot import messenger

recipient = messages.Recipient(recipient_id='123')

# Send text message
message = messages.Message(text='Hello World')
request = messages.MessageRequest(recipient, message)

# Send button template
web_button = elements.WebUrlButton(
   title='Show website',
postback_button = elements.PostbackButton(
   title='Start chatting',
template = templates.ButtonTemplate(
   text='What do you want to do next?',
       web_button, postback_button
attachment = attachments.TemplateAttachment(template=template)

message = messages.Message(attachment=attachment)
request = messages.MessageRequest(recipient, message)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for messengerbot, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size messengerbot-0.1.4.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page