19 Commits

Author SHA1 Message Date
Mads Marquart
1d42c4d3a6 Updated to 1.0.4, added fetchThread&GroupInfo and improved models 2017-06-26 15:41:58 +02:00
Mads Marquart
11e59e023c Added GraphQL requests 2017-06-22 22:38:15 +02:00
Mads Marquart
c81d7d2bfb Removed deprecations and new event system, improved other things
Removed deprecations
Removed new event system
Added documentation for all events
Added FAQ
Changed Client.uid to Client.id
Improved User model
Prepared for support of pages
2017-06-20 14:57:23 +02:00
Mads Marquart
8dacc37ba9 More documentation work, changed addUsersToGroup back to taking a list of user IDs
Created new README, and finished `intro`
2017-05-28 21:11:16 +02:00
Mads Marquart
39eafa5a3e Fixed examples, added changeNickname and changeThreadEmoji, changed changeGroupTitle back to changeThreadTitle
I also removed the parameter `set_default_events` from __init__, since
it's not really necessary
Also added testing of examples and simple testing of listen functions
2017-05-26 18:48:37 +02:00
Mads Marquart
d2741ca419 Added baseline for sphinx documentation and on2FACode event
The docs are still very WIP, but they should be functional. Just
execute `make html` in the docs folder, and you should be able to
navigate to `/docs/_build/html` and view it in your browser
2017-05-26 13:38:54 +02:00
Mads Marquart
a76ebbb22a Added python 2.7 support, reworked events
- Reworked events, so now they support python 2.7 (I had to remove some
functionality though, but that was a little unnecessary anyway)
- Events now support the old style of writing, for people who's more
comfortable with that: ```python
class EchoBot(fbchat.Client):
    def onMessage(self, *args, **kwargs):
        self.something(*args, **kwargs)
```
While still supporting the new method:
```python
class EchoBot(fbchat.Client):
    def __init__(self, *args, **kwargs):
         super(EchoBot, self).__init__(*args, **kwargs)
         self.onMessage += lamda *args, **kwargs: self.something(*args,
**kwargs)
```
- Included `msg` as a parameter in every event function, since it's
useful if you want to extract some of the other data
- Moved test data to the folder `tests`
- Fixed various other functions, and improved stability
2017-05-22 20:33:00 +02:00
Mads Marquart
83a45ebc03 Changed names with Chat to Group or Thread respectively, improved error handling, and changed _doSendRequest to return a single message id 2017-05-21 23:12:30 +02:00
Mads Marquart
76c2c65a7b Fixed sendLocalImage, changed get_json, improved tests
- Changed get_json to take a `requests` response, and then return the
json (While checking encoding and removing unnecessary characters)
- Fixed sendLocalImage, the problem was that the `_getThread` call was
missing a parameter (Took me hours ;) )
- Removed 3 second delay between tests, I felt it was unnecessary
- Updated tests to no longer use deprecated functions
2017-05-21 21:56:56 +02:00
Dainius
4083348c40 add reaction to messages. move request URLs to utils 2017-05-16 19:20:46 +03:00
Dainius
b1cccf4173 fix emoji sending and tests
My bad. Test data is still being commited, changed it to a sample file instead
2017-05-16 14:02:09 +03:00
Dainius
e1e1a0d611 add thread color change 2017-05-16 12:03:20 +03:00
Mads Marquart
f63b9d7c4a Reworked old events, added deprecation warnings, and improved _send
- Added a new system to show an error if old events are used
- Removed `test_data.json`, since I don't want to risk that anyone
accidentally commits their username & password
- Finished work on `sendEmoji`
- Split `_send` into two parts:
`_getSendData` and `_doSendRequest`, which allows for an easier way of
adding new send requests
2017-05-11 12:55:44 +02:00
Dainius
ef352f097a update test_data.json 2017-05-10 18:44:20 +03:00
Mads Marquart
0d75c09036 Added support for deprecating items, and maybe support for python 2.7
- Changed `test_data.js` to `test_data.json`
- Added `deprecated` decorator
- Added `deprecation` function
- Readded old functions, and marked them as deprecated
- Changed parameters back to being type-in-specific (support for python
2.x)
- Deprecated `info_log` and `debug` init paramters
2017-05-10 14:54:07 +02:00
Dainius
5da3e5e4bf update tests 2017-05-09 21:27:32 +03:00
Mads Marquart
64243c20b2 Fixed tests, and improved send() 2017-05-05 20:12:17 +02:00
Mads Marquart
2280d31cbb Added an extra test 2017-05-05 18:59:38 +02:00
Mads Marquart
fa026021b2 Added unit/integration tests 2017-05-05 18:54:35 +02:00