• Stars
    star
    144
  • Rank 255,590 (Top 6 %)
  • Language
    Python
  • Created over 8 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python client for Facebook Messenger Platform Bot

messengerbot

Build Status Code Health https://coveralls.io/repos/github/geeknam/messengerbot/badge.svg?branch=master

Python client for Messenger Platform API

Installation

pip install messengerbot

Usage

Read about Messenger Platform

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

# Manually initialize 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)

More Repositories

1

python-gcm

Python client for Google Cloud Messaging for Android (GCM)
Python
458
star
2

Push-Contacts

Pushing SMS from/to Android phone via web browser (C2DM implementation)
Python
54
star
3

esser

Event Sourcing Serverlessly
Python
28
star
4

tastypie-angular-example

Boilerplate project for integrating Angular.js with django-tastypie.
JavaScript
26
star
5

asx-terminus

All things ASX in your terminal
Python
13
star
6

py-xiaomi-home

Pythonic bindings for Xiaomi Smart Home Suite
Python
13
star
7

tocker

tocker: TDD for Dockerfile
Python
12
star
8

docker-confluent-python

Docker image for confluent-python with librdkafka
8
star
9

aws-neptune-aml

Personal take on GraphDB + AML with AWS Neptune + Glue + Lambda.
Python
6
star
10

python-google-shopping

Python Google Shopping client for Humans
Python
5
star
11

midimoco

Django - Event sourcing - CQRS - Serverless
Python
5
star
12

django-fig-template

Django project template that quickly builds containerised development environment with Docker and Fig
Python
4
star
13

django-instant-api

Create instant REST API with Django
Python
3
star
14

django-sherlock

A customizable notifications framework
Python
3
star
15

Bitflurry

A proof-of-concept video streaming server with RAID-style of file splitting over a network, coded from scratch. Supports up to RAID6.
C
3
star
16

World-Heritage-Site

Android assignment, integration with GAE web service, eye-pleasing UI
Java
3
star
17

drone.io-fig

Fig template to quickly setup Drone.io in 5 min.
Nginx
2
star
18

cloudarmy

A better workflow for developing AWS Cloudformation templates
Python
2
star
19

zappa-bitbucket-pipelines

Docker image to use Zappa as part of Bitbucket Pipelines
2
star
20

python-postgres-bitbucket

Postgres image with python 2.7 for bitbucket pipelines
2
star
21

dotfiles

My dotfiles
Shell
2
star
22

django-kutter

Python
1
star
23

geeknam.github.com

My Octopress Blog
JavaScript
1
star
24

kogan-android

Kogan Android client
Java
1
star
25

thumbor-consul

Thumbor containers with configs populated by Consul
Shell
1
star
26

foneng.in

foneng.in
JavaScript
1
star
27

docker_workshop

Workshop
1
star
28

melbdjango-demo

Demo for "Learning Design Patterns from Django"
Python
1
star
29

spark-kogan

Spark DataSource for Kogan.com API
Scala
1
star