       else
         update key, value
 
+    return
+
+  # Karma query
+  else if (/^karma\s+for\s+/i).test(msg)
+    key = msg.replace(/^karma\s+for\s+/i, '').replace(/\?+$/, '')
+    getKarma team, key, (err, current) ->
+      current or= 0
+      if err
+        log.error err
+        if isVerbose then reply "There was an error getting the karma. Please try again."
+      else
+        reply "Karma for #{key} is #{current}"
+      return
+    return
+
+  # Karma increment/decrement
+  else if /\+\+(\s#.+)?$/.test(msg)
+    if isDirect then return reply "You cannot secretly change the karma for something!"
+    key = msg.split(/\+\+/)[0]
+    getKarma team, key, (err, current) ->
+      if err then return log.error(err)
+      value = Number(current or 0)
+      value++
+      setKarma team, key, value, (err) ->
+        if err
+          log.error err
+          if isVerbose then reply "There was an error changing the karma. Please try again."
+        return
+      return
+    return
+
+  # Karma decrement
+  else if /\-\-(\s#.+)?$/.test(msg)
+    if isDirect then return reply "You cannot secretly change the karma for something!"
+    key = msg.split(/\-\-/)[0]
+    getKarma team, key, (err, current) ->
+      if err then return log.error(err)
+      value = Number(current or 0)
+      value--
+      setKarma team, key, value, (err) ->
+        if err
+          log.error err
+          if isVerbose then reply "There was an error changing the karma. Please try again."
+        return
+      return
     return
 
   # Getting regular factoids, last chance {{{3

    log.info "Set factoid key #{key} for team #{team}"
    return cb null


# BOTS ---------------------------------------------------------------------#{{{1


      async.series [
        (cb) -> db.run "CREATE TABLE metadata (key TEXT PRIMARY KEY, value TEXT)", cb
        (cb) -> db.run "CREATE TABLE factoids (key TEXT PRIMARY KEY, value TEXT, last_edit TEXT)", cb
        (cb) -> db.run "CREATE TABLE karma (key TEXT PRIMARY KEY, value INTEGER)", cb
        (cb) -> db.run "INSERT INTO metadata VALUES($key, $value)", {$key: key, $value: value}, cb
        (cb) -> db.run "INSERT INTO metadata VALUES('direct', 'no')", cb
        (cb) -> db.run "INSERT INTO metadata VALUES('ambient', 'yes')", cb
