Skip to content

pypandorabot is a python module used to send and retrieve message from pandorabots.

License

Notifications You must be signed in to change notification settings

JasonMalik/pypandorabot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Coverage Status

pypandorabot

pypandorabot is a python API for Pandorabots

Requirements

This code is written in python 2.7. The modules used are:

Installation

Soon on PyPi.

Usage

import pypandorabot

you have to specify the bot id provided by the pandorabot as parameter for the objext Pandorabot In this case a new session is created:

bot_id = "f5d922d97e345aa1" #A.L.I.C.E.
bot = pypandorabot.Pandorabot(bot)

If the bot is missing (wrong id) a MissingBot exception is raised.

Message are sent using the talk(string) method:

bot.talk("Hello bot, how are you?")

you can also specify a custom id, a parameter used like a session id in order to keep track of the messages previously exchanged:

cust = "e40fcd461e360607"
bot = pypandorabot.Pandorabot(bot,custId)

Started a chat you can retrieve the current custom id using:

bot.getCustId()

The custom id it's generated by the server and it's auto stored by the code, however if you want you can set it to None by calling the method reset():

bot.reset()

Example

import pypandorabot

bot_id = "f5d922d97e345aa1"
cust = "e40fcd461e360607"

bot = pypandorabot.Pandorabot(bot_id)

print bot.talk("My name is Jason")
print bot.talk("whats my name?")
print bot.getCustId()
print bot.talk("whats my name?")
bot.reset()
print bot.getCustId()
print bot.talk("whats my name?")
print bot.getCustId()

About

pypandorabot is a python module used to send and retrieve message from pandorabots.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages