import * from require("@cinara/botkit") import * from require("@cinara/BotServer") var bot = new Bot(lang=["en","fr","ta"]) var db = new SQLAlchemy("sql/*.db",use_linguito=True,ext=["pandas","pygal"]) db.init_interprener() bot.import_python_nltk("bots/*.pybot",db=db) bot.methods.event .def("onrecv")(function(message,console){ if (message == None){ console.raise("You sent the message without any text",level=1) } else if (message != None) { bot.digest(message,category=bot.decide_category()) .spawn("onsend",function(method){ this.createService(service=`$_BOOT["SERVICE"]`) this.run("glue.spawn") method.feed(bot.Renderer.renderOutput()) }) } }) .def("onsend")(function(message,console){ console.send(message) ) .init() bot.start_session() server = new BotServer("0.0.0.0","4040",ssl_cert_data="ssl/*") server.useBot(bot)