Skip to content

Supybot Website

Sections
Personal tools
You are here: Home » Documentation » Official Plugins Documentation » Factoids

Factoids

Document Actions

Documentation for the Factoids plugin for Supybot

Purpose

Handles factoids, little tidbits of information held in a database and available on demand via several commands.

Commands

  • change [<channel>] <key> <number> <regexp>

    Changes the factoid #<number> associated with <key> according to <regexp>.

  • forget [<channel>] <key> [<number>|*]

    Removes the factoid <key> from the factoids database. If there are more than one factoid with such a key, a number is necessary to determine which one should be removed. A * can be used to remove all factoids associated with a key. <channel> is only necessary if the message isn't sent in the channel itself.

  • info [<channel>] <key>

    Gives information about the factoid(s) associated with <key>. <channel> is only necessary if the message isn't sent in the channel itself.

  • learn [<channel>] <key> as <value>

    Associates <key> with <value>. <channel> is only necessary if the message isn't sent on the channel itself. The word as is necessary to separate the key from the value. It can be changed to another word via the learnSeparator registry value.

  • lock [<channel>] <key>

    Locks the factoid(s) associated with <key> so that they cannot be removed or added to. <channel> is only necessary if the message isn't sent in the channel itself.

  • random [<channel>]

    Returns a random factoid from the database for <channel>. <channel> is only necessary if the message isn't sent in the channel itself.

  • search [<channel>] [--values] [--{regexp} <value>] [<glob> ...]

    Searches the keyspace for keys matching <glob>. If --regexp is given, it associated value is taken as a regexp and matched against the keys. If --values is given, search the value space instead of the keyspace.

  • unlock [<channel>] <key>

    Unlocks the factoid(s) associated with <key> so that they can be removed or added to. <channel> is only necessary if the message isn't sent in the channel itself.

  • whatis [<channel>] <key> [<number>]

    Looks up the value of <key> in the factoid database. If given a number, will return only that exact factoid. <channel> is only necessary if the message isn't sent in the channel itself.

Configuration

  • supybot.plugins.Factoids.public

    This config variable defaults to True and is not channel specific.

    Determines whether this plugin is publicly visible.

  • supybot.plugins.Factoids.learnSeparator

    This config variable defaults to "as" and is channel specific.

    Determines what separator must be used in the learn command. Defaults to as -- learn <key> as <value>. Users might feel more comfortable with is or something else, so it's configurable.

  • supybot.plugins.Factoids.showFactoidIfOnlyOneMatch

    This config variable defaults to True and is channel specific.

    Determines whether the bot will reply with the single matching factoid if only one factoid matches when using the search command.

  • supybot.plugins.Factoids.replyWhenInvalidCommand

    This config variable defaults to True and is channel specific.

    Determines whether the bot will reply to invalid commands by searching for a factoid; basically making the whatis unnecessary when you want all factoids for a given key.

  • supybot.plugins.Factoids.factoidPrefix

    This config variable defaults to "could be " and is channel specific.

    Determines the string that factoids will be introduced by.

Created by jamessan
Last modified 19:15 July 25, 2005

Adding a "tell" command

Posted by ChrisH at 14:27 September 14, 2005
Blootbot provides a "tell" command that you can use to have the bot /msg a factoid to a certain user. That keeps the channel clean since the factoid is not flooding the channel.

I found a way to emulate that command with the Factoid plugin. Just run these two commands:

alias add tell "Misc tell $1 [Factoid whatis $2]"
defaultplugin tell Alias

The first one defines a "tell" command. The brackets ([...]) tell the parser to actually 'run' the command in brackets. The second command tells supybot that the alias "tell" has a higher priority than the "tell" command in the Misc plugin. Otherwise built-in commands have a higher priority than aliases.

In the channel you can then write "!tell jamessan faq". The bot will then tell jamessan privately about that factoid. In case there is no factoid like that you will get a "Error: No factoid matches that key." in the channel.

Perhaps it would still be nicer if there were a "tell" command built into the Factoids plugin.

(thanks to the kind people in #supybot for their help)
News
Oops!
Jun 29, 2007 @ 16:24
We need a Supybot logo!
Jan 18, 2005 @ 03:59
Recent Plugin Releases
LastFM 0.1
Aug 15, 2008 @ 09:55
IdleRPG 1.1.2
Jun 13, 2008 @ 04:34
QGoogle 0.2.0
Apr 30, 2008 @ 12:13
QGoogle 0.1-r1
Apr 27, 2008 @ 08:25
Ompload 1.0
Apr 11, 2008 @ 22:08
 
 

Powered by Plone

This site conforms to the following standards: