All Projects → bearyinnovative → bearychat.py

bearyinnovative / bearychat.py

Licence: MIT license
Python SDK for BearyChat

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to bearychat.py

hubot-bearychat
BearyChat Adapter for Hubot
Stars: ✭ 99 (+482.35%)
Mutual labels:  bearychat
agora-react-native-rtm
React Native around the Agora RTM SDKs for Android and iOS agora
Stars: ✭ 55 (+223.53%)
Mutual labels:  rtm
laravel-bearychat
Laravel integration for BearyChat.
Stars: ✭ 72 (+323.53%)
Mutual labels:  bearychat
bearychat
BearyChat notifications channel for Laravel
Stars: ✭ 22 (+29.41%)
Mutual labels:  bearychat
thinx-device-api
Remote IoT Device Management Platform
Stars: ✭ 19 (+11.76%)
Mutual labels:  rtm
ARChatRoom
应用场景包括:语聊房,语音开黑,狼人杀,陌生人交友,组队PK。支持Android 端、iOS 端。
Stars: ✭ 39 (+129.41%)
Mutual labels:  rtm

Python SDK for BearyChat

@BearyChat Build Status Development Status Documentation Status

Documentation

Requirements

Installation

Use pip to install bearychat SDK.

$ pip install bearychat

or for development:

$ git clone https://github.com/bearyinnovative/bearychat.py.git
$ cd bearychat.py
$ python setup.py install

Examples

Incoming

from bearychat import incoming

def main():
    data = {
        "text": "hello, **world**",
        "markdown": True,
        "notification": "Hello, BearyChat in Notification",
        "channel": "testing"
    }

    resp = incoming.send(
        "https://hook.bearychat.com/=bw52O/incoming/token",
        data)

    print(resp.status_code)
    print(resp.text)


if __name__ == "__main__":
    main()

Real Time Message

BearyChat SDK DOES NOT provide rtm loop, you should implement it with your favorite websocket library.

A reference implmenetation can be found at examples/rtm_loop.py

OpenApi

from bearychat import openapi

client = openapi.Client('<your token>')
message_query_param = {
    "vchannel_id": "=bw52O",
    "query": {
        "latest": {
            "limit": 1
        }
    }
}
client.message.query(json = message_query_param)

"""
{u'messages': [{u'updated': u'2018-10-19T07:23:51.000+0000', u'attachments': [], u'is_channel': True, u'created': u'2018-10-19T07:23:51.000+0000', u'text': u'hello \u9080\u8bf7 \u80e1\u4f2f\u673a\u5668\u4eba \u52a0\u5165\u8be5\u8ba8\u8bba\u7ec4', u'created_ts': 1539933830697, u'subtype': u'info', u'team_id': u'=bwDBo', u'key': u'1539933830697.0487', u'refer_key': None, u'robot_id': None, u'fallback': None, u'vchannel_id': u'=bwPzN', u'uid': u'=bwZbY'}]}
"""

OpenApi Online Document: http://openapi.bearychat.help

Development

OpenAPI Client Building

$ ./scripts/gen_api.py > bearychat/openapi/_api.py

Using Other Libraries

User Demos

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].