If you don’t mind writing your own code, RiveScript is a chatbot scripting engine I wrote that can be used from JavaScript, Python, Go, Java or Perl (there are native libraries for each of those languages). With it you can create your own bot however you want: offline as a text program, a GUI program, wire it up to an instant messenger service, etc.
There are a lot of links with more details, including a few full open source chatbots using it on https://aichaos.github.io/
The JavaScript and Python libraries also come with a lot of good examples, many of which are stand-alone scripts, for how to run bots in various environments, both local and networked.