Line-Of-Sight for a Nextbot

I have a bot that can shoot enemies, but if the enemy if behind cover, or a wall, my bot won’t know, and thus try to shoot the wall between its enemy and itself.

Is there a simple way i can check to see if i can draw a straight line from my bot it its enemy without hitting anything, an return false or something if it does?

I think http://wiki.garrysmod.com/page/Entity/IsLineOfSightClear would be more accurate here.