Updated prof_init hook args

This commit is contained in:
James Booth
2016-04-13 00:14:31 +01:00
parent a8d64f9b21
commit 0110764b2d
14 changed files with 83 additions and 13 deletions

View File

@@ -1,6 +1,7 @@
import prof
from chatterbotapi import ChatterBotFactory, ChatterBotType
factory = ChatterBotFactory()
bot = factory.create(ChatterBotType.CLEVERBOT)
# bot = factory.create(ChatterBotType.JABBERWACKY)
@@ -8,6 +9,7 @@ bot = factory.create(ChatterBotType.CLEVERBOT)
bot_session = {}
bot_state = False
def prof_post_chat_message_display(jid, message):
if bot_state:
if jid not in bot_session:
@@ -15,6 +17,7 @@ def prof_post_chat_message_display(jid, message):
response = bot_session[jid].think(message)
prof.send_line("/msg " + jid + " " + response)
def _cmd_chatterbot(state):
global bot_state
@@ -31,7 +34,8 @@ def _cmd_chatterbot(state):
else:
prof.cons_show("ChatterBot is stopped - /chatterbot enable to activate.")
def prof_init(version, status):
def prof_init(version, status, account_name, fulljid):
synopsis = [
"/chatterbot",
"/chatterbot enable|disable"