Metadata-Version: 2.1
Name: dialog-bot-sdk
Version: 2.2.2
Summary: Python Bot SDK for Dialog Messenger
Home-page: https://github.com/dialogs/python-bot-sdk
Author: Andrey Skiba, Dialog LLC
Author-email: a.skiba@dlg.im
License: Apache License 2.0
Keywords: dialog messenger bot sdk
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Requires-Python: >=3
Description-Content-Type: text/markdown
Requires-Dist: dialog-api (==0.0.50)
Requires-Dist: protobuf
Requires-Dist: google-api-python-client
Requires-Dist: googleapis-common-protos
Requires-Dist: gevent
Requires-Dist: grpcio
Requires-Dist: grpcio-tools
Requires-Dist: requests
Requires-Dist: pyopenssl
Requires-Dist: Pillow

Dialog Python Bot SDK
=================
![PyPI](https://img.shields.io/pypi/v/dialog-bot-sdk.svg) ![PyPI - Downloads](https://img.shields.io/pypi/dm/dialog-bot-sdk.svg) ![PyPI - License](https://img.shields.io/pypi/l/dialog-bot-sdk.svg) 

Python Bot SDK for [Dialog](https://dlg.im) messenger.

Full documentation is available [here](https://dialogs.github.io/bots-docs/).

Usage
-----

```python
from dialog_bot_sdk.bot import DialogBot
import grpc
import os


def on_msg(*params):
    bot.messaging.send_message(
        params[0].peer, 'Reply to : ' + str(params[0].message.textMessage.text)
    )


if __name__ == '__main__':
    bot = DialogBot.get_secure_bot(
        os.environ.get('BOT_ENDPOINT'),  # bot endpoint from environment
        grpc.ssl_channel_credentials(), # SSL credentials (empty by default!)
        os.environ.get('BOT_TOKEN')  # bot token from environment
    )

    bot.messaging.on_message(on_msg)
```


