added chatter function

This commit is contained in:
endorphant
2016-04-30 20:19:00 -04:00
parent 6dab09e611
commit d50c4d5d2c
4 changed files with 67 additions and 10 deletions

14
bin/chatter.py Normal file
View File

@@ -0,0 +1,14 @@
#!/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))