Yeah that was my first thought. Better to write down the allowed urls. There are way less allowed urls than urls to kick for. You can't possibly think of all the urls you dont want posted in your room.
Also, I don't think it is wise to do a loop through every line in a text file for every text event.
I also don't see any flood protection. What does this code do during a text flood?