def detectCommand(userInput): # Check if there is a command matching user input for trigger,commandKey in triggers.items(): if trigger in userInput.lower(): command = commands[commandKey] if 'botMessage' in command: utils.jprint(command['botMessage']) if 'sysMessage' in command: utils.jsysprint(command['sysMessage']) if 'command' in command: exec(command['command']) return True # If there is not utils.jprint(junkIa) return True
def detectCommand(userInput): # Check if there is a command matching user input for trigger, commandKey in triggers.items(): if trigger in userInput.lower(): command = commands[commandKey] if "botMessage" in command: utils.jprint(command["botMessage"]) if "sysMessage" in command: utils.jsysprint(command["sysMessage"]) if "command" in command: exec(command["command"]) return True # If there is not utils.jprint(junkIa) return True
##### ## Junk Bot ## A junk but awesome bot ##### import time import sys import utils.utils as utils import conf.conf as conf import bot.answer as answer import bot.ask as ask utils.jmode(conf.botName + " Bot " + conf.botVersion) # Boot process utils.jsysprint("Initializing...") utils.jprogressbar(2) utils.jmode(conf.botName + " boot sequence completed") # Greetings ask.greetings() userInput = utils.jinput() answer.greetings(userInput) # Commands utils.jmode("Command mode enabled") while ask.askLoop(): pass