         for rule, response of storage.rules
             reg = new RegExp(rule, 'i')
             if reg.test r.body
-                FactionUtil.send Bot.generateTemplate('@{player} ' + response).fillPlayer(player).fillSmily().toString()
+                FactionUtil.send Bot.generateTemplate('@{player} ' + response).fillPlayer(r.player).fillSmily().toString()
                 return callback()
 
         callback()

        match = r.body.match /^train\s+(\S+)$/
        if match
            delete storage.rules[match[1]]
            FactionUtil.send Bot.getTemplate('train.remove').fillPlayer(player).toString()
            storage.save() if not argv.debug
            return callback()


            try
                reg = new RegExp(match[1])
            catch e
                FactionUtil.send Bot.getTemplate('train.fail').fillPlayer(r.player).toString()
                return callback()
            storage.rules[match[1]] = match[2]
            FactionUtil.send Bot.getTemplate('train.ok').fillPlayer(r.player).toString()
            storage.save() if not argv.debug
            return callback()

