Skip to main content

messengerbot

https://img.shields.io/pypi/v/messengerbot.svg https://img.shields.io/pypi/dm/messengerbot.svg Build Status https://img.shields.io/gratipay/geeknam.svg

Python client for Messenger Platform API

Installation

pip install messengerbot

Usage

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)
messenger.send(request)

# Send button template
web_button = elements.WebUrlButton(
   title='Show website',
   url='https://petersapparel.parseapp.com'
)
postback_button = elements.PostbackButton(
   title='Start chatting',
   payload='USER_DEFINED_PAYLOAD'
)
template = templates.ButtonTemplate(
   text='What do you want to do next?',
   buttons=[
       web_button, postback_button
   ]
)
attachment = attachments.TemplateAttachment(template=template)

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

Metadata

Release files for messengerbot 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for messengerbot 0.1.4
File Size Uploaded Provenance
messengerbot-0.1.4.tar.gz 4.0 kB Without provenance Details

Release files / messengerbot-0.1.4.tar.gz

Download URL messengerbot-0.1.4.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f5d019d95736793cae2a249531862371b81fd6b16ce501f78f837e3886cde949
BLAKE2b-256 checksum
How to use checksums
e9e5874e7853fc3cd64c87e8a5c013723ecb33ee55eb9d6f7fc4188090b75188
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for messengerbot 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page