     
   robot.respond /trello create list ["“'‘]((.+|\n)+)["”'’] ?(.+)?$/i, (msg) ->
     createList msg, msg.match[1], msg.match[3]
-
+  
+  robot.respond /trello relate cards ((.+|\n+)+)/i, (msg) ->
+    msg.reply "Attempting to relate cards"
+    relateCards msg, msg.match[1]
+ 
+  robot.respond /trello relate theme ["“'‘]((.+|\n)+)["”'’]/i, (msg) ->
+    relateTheme msg, msg.match[1]
+ 
   robot.respond /trello help/i, (msg) ->
     msg.reply "Here are all the commands for me."
     msg.send " *  trello new \"<ListName>\" <TaskName>"

     id = members[member_name.toLowerCase()].username
  msg.send "Unable to find person named: #{user_name}" unless id?
  if id?
    trello.get "/1/search", {query: "@"+id, idBoards: board.id, modelTypes: "cards", card_fields: "name,shortLink,url"}, (err, data) ->
      msg.reply "So sorry, I got an error and cannot give you that information" if err
      msg.reply "I got the following cards for you" unless err
      msg.send board.id

search = (msg, search) ->
  if (search?)
    msg.reply "I'm searching for results now"
    trello.get "/1/search", {query: "is:open #{search}",idBoards: board.id, modelTypes:"cards", card_fields: "name,shortLink,url"}, (err, data) ->
      msg.reply "Sorry, I was unable to search at this time. Please try again later." if err
      msg.reply "The following cards match your criteria" unless err
      for cards in data.cards
         msg.send " * #{cards.name} | #{cards.url}"

searchExtended = (msg,search) ->
  if (search?)
    msg.reply "I'm searching for results now"
    trello.get "/1/search", {query: search,idBoards: board.id, modelTypes:"cards", card_fields: "name,shortLink,url"}, (err, data) ->
      msg.reply "Sorry, I was unable to search at this time. Please try again later." if err
      msg.reply "The following cards match your criteria" unless err
      for cards in data.cards
         msg.send " * #{cards.name} | #{cards.url} | #{cards.shortLink}"

         
createList = (msg, list_name, position = "top") ->
  msg.reply "I'll get right on that!"
