def addRunk(name): connection = dbAccessor.db() user = connection.query(__getUserQuery, (name, ), False, True) if not user: connection.query(__insertUserQuery, (name, ), True) timestamp = datetime.today().isoformat() params = (name, timestamp) execution = connection.query(__addRunkQuery, params, True) return execution
def delCommand(phrase): connection = dbAccessor.db() return connection.query(__delCommandQuery, (phrase, ), True)
def listCommands(): connection = dbAccessor.db() return connection.query(__getAllCommandsQuery)
def getCommand(phrase): connection = dbAccessor.db() return connection.query(__getCommandQuery, (phrase, ), False, True)
def addCommand(phrase, msg): connection = dbAccessor.db() params = (phrase, msg) connection.query(__addCommandQuery, params, True)
def getRunkHighscore(): connection = dbAccessor.db() return connection.query(__getRunksHighscoreQuery)
def getRunkHighscoreByUsername(name): connection = dbAccessor.db() return connection.query(__getRunksHighscoreByUserQuery, (name, ), single=True)
def getUser(name): connection = dbAccessor.db() return connection.query(__getUserQuery, (name, ), False, True)
def saveUser(name): connection = dbAccessor.db() connection.query(__insertUserQuery, (name, ), True)