Skip to content

Commit 107f55f

Browse files
authored
Merge pull request #11 from Cretezy/master
Add more send types
2 parents ec72b22 + 84349a1 commit 107f55f

File tree

6 files changed

+280
-31
lines changed

6 files changed

+280
-31
lines changed

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ Special thanks to the following people who has contributed to this project!
33
[tbsf](http://github.com/tbsf)
44
[h4ck3rk3y](http://github.com/h4ck3rk3y)
55
[bildzeitung](https://github.com/bildzeitung)
6+
[Cretezy](https://github.com/Cretezy)

README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,42 @@ __Disclaimer__: This wrapper is __NOT__ an official wrapper and do not attempt t
99
This wrapper has the following functions:
1010

1111
* send_text_message(recipient_id, message)
12+
* send_message(recipient_id, message)
13+
* send_generic_message(recipient_id, elements)
14+
* send_button_message(recipient_id, text, buttons)
15+
* send_image(recipient_id, image_path)
16+
* send_image_url(recipient_id, image_url)
17+
* send_action(recipient_id, action)
18+
* send_raw(payload)
19+
* send_audio(recipient_id, audio_path)
20+
* send_audio_url(recipient_id, audio_url)
21+
* send_video(recipient_id, video_path)
22+
* send_video_url(recipient_id, video_url)
23+
* send_file(recipient_id, file_path)
24+
* send_file_url(recipient_id, file_url)
25+
26+
You can see the code/documentation for there in [bot.py](pymessenger.bot.py)
1227

1328
The functions return the full JSON body of the actual API call to Facebook.
1429

1530
### Register for an Access Token
1631

17-
You'll need to setup a Facebook App, Facebook Page, get the Page Access Token and link the App to the Page before you can really start to use the Send/Receive service.
32+
You'll need to setup a [Facebook App](https://developers.facebook.com/apps/), Facebook Page, get the Page Access Token and link the App to the Page before you can really start to use the Send/Receive service.
1833

1934
[This quickstart guide should help](https://developers.facebook.com/docs/messenger-platform/quickstart)
2035

2136
### Installation
2237

2338
```bash
24-
$ pip install pymessenger
39+
pip install pymessenger
2540
```
2641

2742
### Usage
2843

2944
```python
3045
from pymessenger.bot import Bot
3146

32-
bot = Bot(<access_token>, <optional: app_secret>)
47+
bot = Bot(<access_token>, [optional: app_secret])
3348
bot.send_text_message(recipient_id, message)
3449
```
3550

@@ -60,7 +75,7 @@ Output:
6075

6176
![Generic Bot Output](https://cloud.githubusercontent.com/assets/68039/14519266/4c7033b2-0250-11e6-81a3-f85f3809d86c.png)
6277

63-
##### Sending an image using an URL:
78+
##### Sending an image/video/file using an URL:
6479

6580
```python
6681
from pymessenger.bot import Bot
@@ -69,13 +84,12 @@ image_url = "http://url/to/image.png"
6984
bot.send_image_url(recipient_id, image_url)
7085
```
7186

72-
__Note__: Images must be in JPG/PNG format only.
73-
74-
7587
### Todo
7688

7789
* Structured Messages
7890
* Receipt Messages
91+
* Quick Replies
92+
* Airlines
7993
* Tests!
8094

8195
### Example

dist/pymessenger-0.0.1.tar.gz

-964 Bytes
Binary file not shown.

pymessenger.egg-info/PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 1.1
22
Name: pymessenger
3-
Version: 0.0.6.0
3+
Version: 0.0.7.0
44
Summary: Python Wrapper for FB Messenger Bot
55
Home-page: https://github.com/davidchua/pymessenger
66
Author: David Chua

0 commit comments

Comments
 (0)