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', 'why', 'how']

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.0.tar.gz (5.1 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for helga-facts-0.2.0.tar.gz
Algorithm Hash digest
SHA256 90f6555012b945a88faca6ed44178b762d749dbbdfaff0b6e963d3a39f7c8404
MD5 15395cabdedecbde4f8ce068ed351ba3
BLAKE2b-256 28a269392c7d55656de512f39cfae67b22c470bb1371e1e66c5f772edce2c5f7

See more details on using hashes here.

Provenance

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