Skip to content
Python Bot SDK for Dialog
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci fix(ci): fix ci May 30, 2019
dialog_bot_sdk feat(python): add group stub Jul 4, 2019
.whitesource
CHANGELOG fix(python): unread and unreceived messages Mar 18, 2019
LICENSE feat(python): prepare for pypi publishing Feb 11, 2019
README.md Update README.md Feb 27, 2019
setup_unfilled.py fix(python): remove dialog_api hardcode Jul 1, 2019

README.md

Dialog Python Bot SDK

PyPI PyPI - Downloads PyPI - License

Python Bot SDK for Dialog messenger.

Full documentation is available here.

Usage

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)
You can’t perform that action at this time.