一个HelGa插件,可以用来存储可以从一个问题中返回的响应
helga-facts的Python项目详细描述
一个helga插件,可用于存储问题返回的响应。例如:
<sduncan> foo is bar <sduncan> foo? <helga> foo is bar (sduncan on 12/01/2014 08:15) <sduncan> bar baz are qux <sduncan> bar baz? <helga> bar baz is qux (sduncan on 12/01/2014 08:15)
使用fact?表单查询事实,并使用表单自动存储事实 fact (is|are) term。在这个简单的事实存储表单中,事实与用户的昵称一起保存 说它和它被说的时间戳。事实也只能存储为答复 使用标记“<;reply>;”时没有刻痕或时间戳:
<sduncan> foo is <reply> bar <sduncan> foo? <helga> bar
或者,如果设置FACTS_REQUIRE_NICKNAME设置为true,则需要bot的nick 显示存储的事实:
<sduncan> foo is <reply> bar <sduncan> foo? <sduncan> helga foo? <helga> bar
重要
此插件需要数据库访问
事实存储有时有点贪婪,因为事实的形式是fact (is|are) term。这个 可能会导致你看到一个词的代词事实,可能是恼人的情况。例如:
<sduncan> who is going to the party? <sduncan> who? <helga> who is going to the party? (sduncan on 12/01/2014 08:15)
因此,您可以自定义设置FACTS_WORD_BLACKLIST,它应该是一个单词列表 这将导致一个事实被存储。一般来说这是代词。默认值为:
FACTS_WORD_BLACKLIST = ['who', 'what', 'where', 'when', 'why', 'how', 'and', 'hmm', 'huh', 'no', 'oh', 'ok', 'right', 'well', 'yes']
请注意,这仅适用于不包含<reply>的事实。这仍然有效:
<sduncan> when is <reply> now <sduncan> when? <helga> now