You could store lines to say in a text file, yes. However, that's not all it is used for, nor is that the only way to have a bot say something. A text file, as mentioned, is simply a file that is (usually) used to hold text.

If you want to have a bot do something specific, it would help to explain what you want it to do and we can help you with a script to do it.