     @github = require('githubot')(@robot)
     @org = "tsoha-syksy2012"
 
+  formatRepoName: (username) ->
+    "harkka-#{username}"
+
   formatRepo: (username) ->
-    "#{@org}/#{username}"
+    "#{@org}/#{@formatRepoName username}"
 
   formatRepoUrl: (username) ->
     "/repos/#{@formatRepo username}"
 
   createRepository: (username, cb) ->
     @github.post "/orgs/#{@org}/repos", {
-      name: username,
+      name: @formatRepoName(username),
       has_wiki: false,
       auto_init: true,
       team_id: @getTeamId()
     }, cb
+
+  addNewStudent: (username, cb) ->
+    _this = this
+    @github.request "PUT", "/teams/#{@getTeamId()}/members/#{username}", {}, (data) ->
+      console.log "liitetty tiimiin"
+      _this.createRepository username, cb
 
   getRepository: (username, cb) ->
     @github.get @formatRepoUrl(username), cb

        if pullRequest?
          msg.send "tsohaohjaajat: #{pullRequest.html_url}"
        else
          msg.send "#{nick}: Sinulla ei ole avointa pull requestia"

    if users.length is 1
      user = users[0]
      tsohahub.createWeek user.username, msg.match[1].trim(), (pullRequest) ->
        msg.send "#{nick}: Haara luotu, joten: git fetch && git checkout #{pullRequest.head.ref}"

  robot.respond /kommentoi/i, (msg) ->
    nick = msg.message.user.name
