def main(login, debug, verbose, pid): if debug: logging.getLogger(__name__) coloredlogs.install(level='DEBUG') chatbot.default(settings.CHATBOT_DEFUALT) chatbot.login(enableCmdQR=True, hotReload=True) if not login: chatbot.run(debug=debug)
def chat(): if request.method == 'POST': Dict1 = request.form question = Dict1['question'] return chatbot.run(question) else: return render_template('chatbot.html')
import chatbot import draw # draw.randomThing() username = "******" client_id = "your_client_id" token = "your_token" channel = "your_channel" chatbot.run(username, client_id, token, channel)
elif ans == "activatemenu": menu() elif ans == "customize": import options color = options.run() cursor.execute("update users set color=%s where usernumber like %s and name like %s and password like %s", (color,usernumber, username, password)) os.system("color" + " " + str(color)) print("color changed") conn.commit() elif ans == "originalchatbot": import chatbot chatbot.run() else: if admin == "yes": if ans == "sql": while True: try: sql = input("sql> ").strip() if sql == "\\q": # press \q to exit sql mode break else: cursor.execute(sql) print(cursor.fetchall()) except Exception as e: print(e) elif ans == "resettable": # these are the extra commands resettable()