Skip to main content

A library to create hooks for facebook messenger

Project description

Messenger Hook
==============

Description
-----------

This is a basic implementation of a facebook messenger Hook.
It's working with falcon but should be easily modify to work with Flask or Django.

Install
-------

You can run `pip install messenger_hook` to install it.

Build a ping application
------------------------

```python
import falcon
from messenger_hook.falcon_messenger import FalconMessenger

app = falcon.API()
hook = FalconMessenger('verify_key', 'your_token')
app.add_route('/hook/', hook)
```

You need to install falcon to use it with falcon.
You can launch it with gunicorn or uwsgi


Transform message
-----------------

```python
import falcon
from messenger_hook.falcon_messenger import FalconMessenger

class MyMessenger(FalconMessenger):
def transform_message(self, text, attachments):
if text:
return 'You sent {}'.format(message)
elif attachments:
return 'Yout sent an attachment'
return 'You sent nothing'

app = falcon.API()
hook = FalconMessenger('verify_key', 'your_token')
app.add_route('/hook/', hook)
```

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
messenger_hook-0.2.1.tar.gz (2.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page