ttbp/bin/chatter.py

15 lines
290 B
Python
Raw Normal View History

2016-05-01 00:19:00 +00:00
#!/usr/bin/python
import random
import json
import os
SOURCE = os.path.join("/home", "endorphant", "projects", "ttbp")
langfile = open(os.path.join(SOURCE, "lib", "lang.json"), 'r')
LANG = json.load(langfile)
langfile.close()
def say(keyword):
return random.choice(LANG.get(keyword))