Skip to content

heckad/python-bot-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Python Bot SDK for Dialog

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%