Skip to main content

Python Bot SDK for Dialog Messenger

Project description

Dialog Python Bot SDK

PyPI PyPI - License PyPI - Downloads

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dialog-bot-sdk-2.0.0.tar.gz (160.3 kB view hashes)

Uploaded Source

Built Distribution

dialog_bot_sdk-2.0.0-py3-none-any.whl (202.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page