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)
```
==============
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)
```
Metadata
Release files for messenger_hook 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| messenger_hook-0.2.1.tar.gz | 2.0 kB | Details |
Release files / messenger_hook-0.2.1.tar.gz
| Download URL | messenger_hook-0.2.1.tar.gz |
|---|---|
| Size | 2.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c44578050657ab64ea44db5e0b161264a0c4eff5d6a8aee254803747987711d
|
|
BLAKE2b-256 checksum How to use checksums |
d9adb2196ad2badb49009132d593af9a2cda142ca418573ea51f559f0f858814
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |