Skip to main content

A helga plugin that can be used to store responses that can be returned from a question

Project description

A helga plugin that can be used to store responses that can be returned from a question. For example:

<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)

Facts are queried using the form fact? and are stored automatically using the form fact (is|are) term. In this simple fact storing form, facts are saved with the nick of the user that saying it and the timestamp at which it was said. Facts can also be stored as a reply only without a nick or timestamp by using the token ‘<reply>’:

<sduncan> foo is <reply> bar
<sduncan> foo?
<helga> bar

Optionally, if the setting FACTS_REQUIRE_NICKNAME is set to True, the bot’s nick will be required to show a stored fact:

<sduncan> foo is <reply> bar
<sduncan> foo?
<sduncan> helga foo?
<helga> bar

Fact storage tends to be a bit greedy at times, since the form of a fact is fact (is|are) term. This can lead to situations where you may see one-word pronoun facts that can be annoying. For example:

<sduncan> who is going to the party?
<sduncan> who?
<helga> who is going to the party? (sduncan on 12/01/2014 08:15)

For this reason, you can customize the setting FACTS_WORD_BLACKLIST, which should be a list of words that will result in a fact being stored. Generally this will be pronouns. The default value for this is:

FACTS_WORD_BLACKLIST = ['who', 'what', 'where', 'when', 'why', 'how', 'and', 'hmm', 'huh', 'no', 'oh', 'ok', 'right', 'well', 'yes']

Note that this only occurs for facts that do not include <reply>. This will still work:

<sduncan> when is <reply> now
<sduncan> when?
<helga> now

License

Copyright (c) 2015 Shaun Duncan

Licensed under an MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

helga-facts-0.2.2.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file helga-facts-0.2.2.tar.gz.

File metadata

  • Download URL: helga-facts-0.2.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for helga-facts-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ae1eb1c46e901731c2d39bfaff0ddf4ce725b7846d06650a75aa61a7907a461b
MD5 688ae14add405b13dac941b7a15cc079
BLAKE2b-256 c96578a6c38a29e92fc69281300a50ada708f0812ab5bc88a2a8df56e29638b7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page