Ejemplo n.º 1
0

Factoids = conf.registerPlugin('Factoids')
conf.registerChannelValue(
    Factoids, 'learnSeparator',
    registry.String(
        'as',
        _("""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.""")))
conf.registerChannelValue(
    Factoids, 'showFactoidIfOnlyOneMatch',
    registry.Boolean(
        True,
        _("""Determines whether the bot will reply with the
    single matching factoid if only one factoid matches when using the search
    command.""")))
conf.registerChannelValue(
    Factoids, 'replyWhenInvalidCommand',
    registry.Boolean(
        True,
        _("""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.""")))
conf.registerChannelValue(
    Factoids, 'replyApproximateSearchKeys',
    registry.Boolean(
        True,
        _("""If you try to look up a nonexistent factoid,
    this setting make the bot try to find some possible matching keys through
Ejemplo n.º 2
0
        registry.SpaceSeparatedListOfStrings.setValue(self, v)


BadWords = conf.registerPlugin('BadWords')
conf.registerGlobalValue(
    BadWords, 'words',
    LastModifiedSetOfStrings([],
                             _("""Determines what words are
    considered to be 'bad' so the bot won't say them.""")))
conf.registerChannelValue(
    BadWords, 'requireWordBoundaries',
    registry.Boolean(
        False,
        _("""Determines whether the bot will require bad
    words to be independent words, or whether it will censor them within other
    words.  For instance, if 'darn' is a bad word, then if this is true, 'darn'
    will be censored, but 'darnit' will not.  You probably want this to be
    false. After changing this setting, the BadWords regexp needs to be
    regenerated by adding/removing a word to the list, or reloading the
    plugin.""")))


class String256(registry.String):
    def __call__(self):
        s = registry.String.__call__(self)
        return s * (1024 // len(s))

    def __str__(self):
        return self.value

Ejemplo n.º 3
0
    # a bool that specifies whether the user identified himself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('MessageParser', True)


MessageParser = conf.registerPlugin('MessageParser')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(MessageParser, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerChannelValue(
    MessageParser, 'enable',
    registry.Boolean(
        True,
        _("""Determines whether the
    message parser is enabled.  If enabled, will trigger on regexps
    added to the regexp db.""")))
conf.registerChannelValue(
    MessageParser, 'keepRankInfo',
    registry.Boolean(
        True,
        _("""Determines whether we keep updating the usage
    count for each regexp, for popularity ranking.""")))
conf.registerChannelValue(
    MessageParser, 'rankListLength',
    registry.Integer(
        20,
        _("""Determines the number of regexps returned
    by the triggerrank command.""")))
conf.registerChannelValue(
Ejemplo n.º 4
0
import supybot.conf as conf
import supybot.registry as registry


def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified himself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Notify', True)


Notify = conf.registerPlugin('Notify')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Notify, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerGlobalValue(
    Notify, 'server_address',
    registry.String(
        '0.0.0.0', """Address for the IRC notification server to listen on"""))
conf.registerGlobalValue(
    Notify, 'server_port',
    registry.PositiveInteger(
        5050, """Port for the IRC notification server to listen on"""))
conf.registerGlobalValue(
    Notify, 'use_notice',
    registry.Boolean(False, """Use notices instead of privmsgs"""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Ejemplo n.º 5
0
            conf.supybot.plugins.Sourceforge.defaultProject.set(project)

    output("""Sourceforge is quite the word to type, and it may get annoying
              typing it all the time because Supybot makes you use the plugin
              name to disambiguate calls to ambiguous commands (i.e., the bug
              command is in this plugin and the Bugzilla plugin; if both are
              loaded, you\'ll have you type "sourceforge bug ..." to get this
              bug command).  You may save some time by making an alias for
              "sourceforge".  We like to make it "sf".""")


Sourceforge = conf.registerPlugin('Sourceforge')
conf.registerChannelValue(
    Sourceforge, 'trackerSnarfer',
    registry.Boolean(
        False, """Determines whether the bot will reply to SF.net
    Tracker URLs in the channel with a nice summary of the tracker item."""))
conf.registerChannelValue(
    Sourceforge, 'defaultProject',
    registry.String(
        '', """Sets the default project to use in the case that no
    explicit project is given."""))
conf.registerGlobalValue(
    Sourceforge, 'bold',
    registry.Boolean(True, """Determines whether the results are bolded."""))
conf.registerGlobalValue(
    Sourceforge, 'enableSpecificTrackerCommands',
    registry.Boolean(
        True, """Determines
    whether the bug, rfe, and patch commands (convenience wrappers around
    the tracker command) will be enabled."""))
Ejemplo n.º 6
0
import supybot.conf as conf
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('User')


def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified themself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('User', True)


User = conf.registerPlugin('User')
conf.registerChannelValue(
    User, 'listInPrivate',
    registry.Boolean(
        True,
        _("""Determines whether the output of 'user list'
    will be sent in private. This prevents mass-highlights of people who use
    their nick as their bot username.""")))
conf.registerGlobalValue(
    User, 'customWhoamiError',
    registry.String(
        "",
        _("""Determines what message the bot sends
    when a user isn't identified or recognized.""")))
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Ejemplo n.º 7
0
Ctcp = conf.registerPlugin('Ctcp')
conf.registerGlobalValue(
    Ctcp, 'versionWait',
    registry.PositiveInteger(
        10, """Determines how many seconds the bot will
    wait after getting a version command (not a CTCP VERSION, but an actual
    call of the command in this plugin named "version") before replying with
    the results it has collected."""))

###
# supybot.abuse configuration variables.
###
conf.registerGlobalValue(
    conf.supybot.abuse.flood, 'ctcp',
    registry.Boolean(
        True, """Determines whether the bot will defend itself
    against CTCP flooding."""))
conf.registerGlobalValue(
    conf.supybot.abuse.flood.ctcp, 'maximum',
    registry.PositiveInteger(
        5, """Determines how many CTCP messages (not
    including actions) the bot will reply to from a given user in a minute.
    If a user sends more than this many CTCP messages in a 60 second period,
    the bot will ignore CTCP messages from this user for
    supybot.abuse.flood.ctcp.punishment seconds."""))
conf.registerGlobalValue(
    conf.supybot.abuse.flood.ctcp, 'punishment',
    registry.PositiveInteger(
        300, """Determines how many seconds the bot will
    ignore CTCP messages from users who flood it with CTCP messages."""))
Ejemplo n.º 8
0
import supybot.utils as utils
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('Channel')

def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified themself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Channel', True)

Channel = conf.registerPlugin('Channel')
conf.registerChannelValue(Channel, 'alwaysRejoin',
    registry.Boolean(True, _("""Determines whether the bot will always try to
    rejoin a channel whenever it's kicked from the channel.""")))
conf.registerChannelValue(Channel, 'nicksInPrivate',
    registry.Boolean(True, _("""Determines whether the output of 'nicks' will
    be sent in private. This prevents mass-highlights of a channel's users,
    accidental or on purpose.""")))
conf.registerChannelValue(Channel, 'rejoinDelay',
    registry.NonNegativeInteger(0, _("""Determines how many seconds the bot will wait
    before rejoining a channel if kicked and
    supybot.plugins.Channel.alwaysRejoin is on.""")))
conf.registerChannelValue(Channel, 'partMsg',
    registry.String('$version', _("""Determines what part message should be
        used by default. If the part command is called without a part message,
        this will be used. If this value is empty, then no part message will
        be used (they are optional in the IRC protocol). The standard
        substitutions ($version, $nick, etc.) are all handled appropriately.""")))
Ejemplo n.º 9
0

def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified themself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn

    conf.registerPlugin("TVMaze", True)


TVMaze = conf.registerPlugin("TVMaze")
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(TVMaze, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGlobalValue(TVMaze, accountsdb.CONFIG_OPTION_NAME,
                         accountsdb.CONFIG_OPTION)

conf.registerChannelValue(
    TVMaze,
    "showEpisodeTitle",
    registry.Boolean(
        True,
        _("""Determines whether the episode title will be displayed in the schedule output."""
          ),
    ),
)

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Ejemplo n.º 10
0

def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified himself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('MeetBot', True)


MeetBot = conf.registerPlugin('MeetBot')
use_supybot_config = conf.registerGlobalValue(
    MeetBot, 'enableSupybotBasedConfig',
    registry.Boolean(
        False, """Enable configuration via the Supybot config
                            mechanism."""))


class WriterMap(registry.SpaceSeparatedListOfStrings):
    """List of output formats to write.  This is a space-separated
    list of 'WriterName:.ext' pairs.  WriterName must be from the
    writers.py module, '.ext' must be an extension starting with a dot.
    """
    def set(self, s):
        s = s.split()
        writer_map = {}
        for writer in s:
            writer, ext = writer.split(':')
            if not hasattr(writers, writer):
                raise ValueError("Writer name not found: '%s'" % writer)
Ejemplo n.º 11
0
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Misc', True)


Misc = conf.registerPlugin('Misc')
conf.registerChannelValue(
    Misc, 'mores',
    registry.PositiveInteger(
        1,
        _("""Determines how many messages the bot
    will issue when using the 'more' command.""")))
conf.registerGlobalValue(
    Misc, 'listPrivatePlugins',
    registry.Boolean(
        False,
        _("""Determines whether the bot will list private
    plugins with the list command if given the --private switch.  If this is
    disabled, non-owner users should be unable to see what private plugins
    are loaded.""")))
conf.registerGlobalValue(
    Misc, 'customHelpString',
    registry.String(
        '',
        _("""Sets a custom help string, displayed when the 'help'
    command is called without arguments.""")))
conf.registerGlobalValue(
    Misc, 'listUnloadedPlugins',
    registry.Boolean(
        False,
        _("""Determines whether the bot will list unloaded
    plugins with the list command if given the --unloaded switch.  If this is
    disabled, non-owner users should be unable to see what unloaded plugins
Ejemplo n.º 12
0
    validStrings = ('cse', 'legacy')

GoogleCSE = conf.registerPlugin('GoogleCSE')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(GoogleCSE, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGlobalValue(GoogleCSE, 'apikey',
    registry.String('', _("""API key provided by google for API access"""),
        private=True))
conf.registerGlobalValue(GoogleCSE, 'engines',
    registry.CommaSeparatedListOfStrings('', _("""List of available Custom
        Search Engines.""")))
conf.registerChannelValue(GoogleCSE, 'defaultEngine',
    registry.String('', _("""Default Custom Search Engine for channel."""),
        private=True))
conf.registerChannelValue(GoogleCSE, 'maxPageResults',
    registry.Integer(10, _("""Maximum number of page results to fetch.""")))
conf.registerChannelValue(GoogleCSE, 'maxPages',
    registry.Integer(1, _("""Maximum number of page results to fetch.""")))
conf.registerChannelValue(GoogleCSE, 'maxDisplayResults',
    registry.Integer(5, _("""Maximum number of page results to display.""")))
conf.registerChannelValue(GoogleCSE, 'includeSnippet',
    registry.Boolean(False, _("""Display search result snippet in the output.""")))
conf.registerChannelValue(GoogleCSE, 'safeLevel',
    SafeLevels('medium', _("""Search results safe level. Default: medium.""")))
conf.registerChannelValue(GoogleCSE, 'engineAPI',
    EngineAPI('cse', _("""Select google engine mode. \"legacy\" sets the
    old google API \"cse\" sets the latest CSE API. Default: cse.""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Ejemplo n.º 13
0
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

###

import supybot.conf as conf
import supybot.registry as registry


def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified himself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('LoveHate', True)


LoveHate = conf.registerPlugin('LoveHate')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(LoveHate, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))

conf.registerChannelValue(
    LoveHate, 'unping',
    registry.Boolean(False,
                     """Depingitizes users that are currently in the chan"""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Ejemplo n.º 14
0
    registry.StringSurroundedBySpaces(
        ' || ',
        _("""Determines what separator is
    used between individually added topics in the channel topic.""")))
conf.registerChannelValue(
    Topic, 'format',
    TopicFormat(
        '$topic ($nick)',
        _("""Determines what format is used to add
    topics in the topic.  All the standard substitutes apply, in addition to
    "$topic" for the topic itself.""")))
conf.registerChannelValue(
    Topic, 'recognizeTopiclen',
    registry.Boolean(
        True,
        _("""Determines whether the bot will recognize the
    TOPICLEN value sent to it by the server and thus refuse to send TOPICs
    longer than the TOPICLEN.  These topics are likely to be truncated by the
    server anyway, so this defaults to True.""")))
conf.registerChannelValue(
    Topic, 'default',
    registry.String(
        '',
        _("""Determines what the default topic for the channel
    is.  This is used by the default command to set this topic.""")))
conf.registerChannelValue(
    Topic, 'alwaysSetOnJoin',
    registry.Boolean(
        False,
        _("""Determines whether the bot will set the topic
    every time it joins, or only if the topic is empty.""")))
conf.registerGroup(Topic, 'undo')
Ejemplo n.º 15
0
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Weather', True)


Weather = conf.registerPlugin('Weather')
conf.registerGlobalValue(
    Weather, 'apiKey',
    registry.String('', (
        """Sets the API key for the plugin. You can obtain an API key at http://www.wunderground.com/weather/api/."""
    ),
                    private=True))
conf.registerChannelValue(
    Weather, 'useImperial',
    registry.Boolean(True, (
        """Determines whether imperial units (Fahrenheit, etc.) will be used."""
    )))
conf.registerGlobalValue(
    Weather, 'forecast',
    registry.Boolean(
        True,
        ("""Determines whether forecasts will be displayed by default.""")))
conf.registerGlobalValue(
    Weather, 'alerts',
    registry.Boolean(
        False,
        ("""Determines whether forecasts will be displayed by default.""")))
conf.registerGlobalValue(
    Weather, 'almanac',
    registry.Boolean(
        False,
Ejemplo n.º 16
0
    if yn(_("""Do you want to show the video publish date?"""), default=False):
        Youtube.showDate.setValue(True)

    if yn(_("""Do you want the bot to prefix its reply with the nickname
               that posted the video URL?
            """),
          default=False):
        Youtube.prefixNick.setValue(True)


Youtube = conf.registerPlugin('Youtube')

conf.registerChannelValue(
    Youtube, 'youtubeSnarfer',
    registry.Boolean(True, _("""Enable the Youtube snarfer.""")))

conf.registerChannelValue(
    Youtube, 'showViews',
    registry.Boolean(True, _("""Show the number of views.""")))

conf.registerChannelValue(Youtube, 'showDuration',
                          registry.Boolean(True, _("""Show the duration.""")))

conf.registerChannelValue(
    Youtube, 'showLikes', registry.Boolean(True,
                                           _("""Show likes/dislikes.""")))

conf.registerChannelValue(
    Youtube, 'showChannel',
    registry.Boolean(False, _("""Show the video channel.""")))
Ejemplo n.º 17
0
import supybot.registry as registry


def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified himself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('ChannelLogger', True)


ChannelLogger = conf.registerPlugin('ChannelLogger')
conf.registerChannelValue(
    ChannelLogger, 'enable',
    registry.Boolean(True, """Determines whether logging is enabled."""))
conf.registerGlobalValue(
    ChannelLogger, 'flushImmediately',
    registry.Boolean(
        False, """Determines whether channel logfiles will be
    flushed anytime they're written to, rather than being buffered by the
    operating system."""))
conf.registerChannelValue(
    ChannelLogger, 'stripFormatting',
    registry.Boolean(
        True, """Determines whether formatting characters (such
    as bolding, color, etc.) are removed when writing the logs to disk."""))
conf.registerChannelValue(
    ChannelLogger, 'timestamp',
    registry.Boolean(
        True, """Determines whether the logs for this channel are
Ejemplo n.º 18
0
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('MegaHAL', True)


MegaHAL = conf.registerPlugin('MegaHAL')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(MegaHAL, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))

conf.registerGroup(MegaHAL, 'learn')
conf.registerGlobalValue(
    MegaHAL.learn, 'commands',
    registry.Boolean(
        False,
        _("""Determines whether the bot answers to messages
    beginning by a non-alphanumeric char.""")))
conf.registerGroup(MegaHAL, 'answer')
conf.registerChannelValue(
    MegaHAL.answer, 'commands',
    registry.Boolean(
        False,
        _("""Determines whether messages beginning by a
    non-alphanumeric char are learned.""")))
conf.registerChannelValue(
    MegaHAL.answer, 'probability',
    registry.Integer(
        10,
        _("""Determines the percent of messages the bot will
    answer (zero is recommended if you have a tiny database).""")))
conf.registerChannelValue(
Ejemplo n.º 19
0
def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified himself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Sigyn', True)


Sigyn = conf.registerPlugin('Sigyn')

conf.registerGlobalValue(
    Sigyn, 'enable',
    registry.Boolean(
        False,
        """set to True to enable kill and klines, otherwise bot will only report to logChannel"""
    ))

conf.registerGlobalValue(
    Sigyn, 'mainChannel',
    registry.String(
        "#freenode",
        """main channel, where bot stay opped and op staffer on +z"""))

conf.registerGlobalValue(
    Sigyn, 'snoopChannel',
    registry.String("", """channel where services stuff are announced"""))

conf.registerGlobalValue(
    Sigyn, 'mxbl',
    registry.CommaSeparatedListOfStrings([''], """patterns to match"""))
Ejemplo n.º 20
0
def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified themself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Note', True)


Note = conf.registerPlugin('Note')
conf.registerGroup(Note, 'notify')
conf.registerGlobalValue(
    Note.notify, 'onJoin',
    registry.Boolean(
        False, """Determines whether the bot will notify people of
    their new messages when they join the channel.  Normally it will notify
    them when they send a message to the channel, since oftentimes joins are
    the result of netsplits and not the actual presence of the user."""))
conf.registerGlobalValue(
    Note.notify.onJoin, 'repeatedly',
    registry.Boolean(
        False, """Determines whether the bot will repeatedly
    notify people of their new messages when they join the channel.  That means
    when they join the channel, the bot will tell them they have unread
    messages, even if it's told them before."""))
conf.registerGlobalValue(
    Note.notify, 'autoSend',
    registry.NonNegativeInteger(
        0, """Determines the upper limit for
    automatically sending messages instead of notifications.  I.e., if this
    value is 2 and there are 2 new messages to notify a user about, instead of
Ejemplo n.º 21
0
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified himself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('GoodFrench', True)


GoodFrench = conf.registerPlugin('GoodFrench')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(GoodFrench, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerChannelValue(
    GoodFrench, 'kick',
    registry.Boolean(
        False, """Détermine si un utilisateur faisant une faute
    de Français sera kické (au lieu de recevoir un avertissement)."""))
conf.registerChannelValue(
    GoodFrench, 'level',
    registry.Integer(
        0, """Le niveau de filtrage. Le niveau N filtre
    ce que le niveau N-1 filtrait, avec des choses en plus.
    0 : pas de filtrage ;
    1 : filtre le langage SMS
    2 : filtre les erreurs de pluriel ;
    3 : filtre les fautes de conjugaison courantes ;
    4 : filtre les fautes d'orthographe courantes ;
    5 : filtre les abbréviations ("t'as" au lieu de "tu as") ;
    6 : filtre les 'lol'
    7 : filtre les erreurs de typographie (note : a tendance à avoir la
    gachette facile)"""))
Ejemplo n.º 22
0
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Factoids', True)


class FactoidFormat(registry.TemplatedString):
    """Value must include $value, otherwise the factoid's value would be left
    out."""
    requiredTemplates = ['value']


Factoids = conf.registerPlugin('Factoids')
conf.registerGroup(Factoids, 'web')
conf.registerGlobalValue(
    Factoids.web, 'enable',
    registry.Boolean(
        False,
        _("""Determines whether the Factoids plugins will
    be browsable on the HTTP server.""")))
conf.registerChannelValue(
    Factoids.web, 'channel',
    registry.Boolean(
        False,
        _("""Determines whether factoids can be displayed
    via the web server.""")))

conf.registerChannelValue(
    Factoids, 'requireVoice',
    registry.Boolean(
        False,
        _("""Only allows a user with voice or above on a
    channel to use the command.""")))
conf.registerChannelValue(
Ejemplo n.º 23
0

class ColorNumber(registry.String):
    """Value must be a valid color number (01, 02, 03, 04, ..., 16)"""
    def set(self, s):
        if s not in ('01', '02', '03', '04', '05', '06', '07', '08', '09',
                     '10', '11', '12', '13', '14', '15', '16'):
            self.error()
            return
        self.setValue(s)
ColorNumber = internationalizeDocstring(ColorNumber)


LinkRelay = conf.registerPlugin('LinkRelay')
conf.registerChannelValue(LinkRelay, 'color',
    registry.Boolean(False, _("""Determines whether the bot will color Relayed
    PRIVMSGs so as to make the messages easier to read.""")))
conf.registerChannelValue(LinkRelay, 'topicSync',
    registry.Boolean(True, _("""Determines whether the bot will synchronize
    topics between networks in the channels it Relays.""")))
conf.registerChannelValue(LinkRelay, 'hostmasks',
    registry.Boolean(False, _("""Determines whether the bot will Relay the
    hostmask of the person joining or parting the channel when he or she joins
    or parts.""")))
conf.registerChannelValue(LinkRelay, 'nicks',
    registry.Boolean(True, _("""Determines whether the bot will relay the
    nick of the person sending a message.""")))
conf.registerChannelValue(LinkRelay, 'includeNetwork',
    registry.Boolean(True, _("""Determines whether the bot will include the
    network in Relayed PRIVMSGs; if you're only Relaying between two networks,
    it's somewhat redundant, and you may wish to save the space.""")))
Ejemplo n.º 24
0
    def setValue(self, v):
        self.lastModified = time.time()
        registry.SpaceSeparatedListOfStrings.setValue(self, v)


BadWords = conf.registerPlugin('BadWords')
conf.registerGlobalValue(
    BadWords, 'words',
    LastModifiedSetOfStrings([], """Determines what words are
    considered to be 'bad' so the bot won't say them."""))
conf.registerGlobalValue(
    BadWords, 'requireWordBoundaries',
    registry.Boolean(
        False, """Determines whether the bot will require bad
    words to be independent words, or whether it will censor them within other
    words.  For instance, if 'darn' is a bad word, then if this is true, 'darn'
    will be censored, but 'darnit' will not.  You probably want this to be
    false."""))


class String256(registry.String):
    def __call__(self):
        s = registry.String.__call__(self)
        return s * (1024 / len(s))

    def __str__(self):
        return self.value


conf.registerGlobalValue(
    BadWords, 'nastyChars',
Ejemplo n.º 25
0
def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified themself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('RelayNext', True)


RelayNext = conf.registerPlugin('RelayNext')

conf.registerChannelValue(
    RelayNext, 'color',
    registry.Boolean(
        True,
        _("""Determines whether the bot will color relayed
    PRIVMSGs so as to make the messages easier to read.""")))
conf.registerChannelValue(
    RelayNext, 'hostmasks',
    registry.Boolean(
        True,
        _("""Determines whether the bot will relay the
    hostmask of the person joining or parting the channel when he or she joins
    or parts.""")))
conf.registerChannelValue(
    RelayNext, 'noHighlight',
    registry.Boolean(
        False,
        _("""Determines whether the bot should prefix nicks
    with a hyphen (-) to prevent excess highlights (in PRIVMSGs and actions)."""
          )))
Ejemplo n.º 26
0
          )))

# alternative template:
#                     ^ {{Title}} ({{Year}} - {{Director}}) :: [i:{{imdbRating}} r:{{tomatoMeter}} m:{{Metascore}}] {{Plot}}

conf.registerGlobalValue(
    SpiffyTitles, 'coubTemplate',
    registry.String(
        "^ {%if not_safe_for_work %}NSFW{% endif %} [{{channel.title}}] {{title}} :: {{views_count}} views :: {{likes_count}} likes :: {{recoubs_count}} recoubs",
        _("""Uses Coub API to get additional information about coub.com links"""
          )))

# enable/disable toggles
conf.registerChannelValue(
    SpiffyTitles, 'coubHandlerEnabled',
    registry.Boolean(
        True, _("""Whether to add additional information about coub links""")))

conf.registerChannelValue(
    SpiffyTitles, 'defaultHandlerEnabled',
    registry.Boolean(
        True,
        _("""Whether to add additional information about regular links""")))

conf.registerChannelValue(
    SpiffyTitles, 'youtubeHandlerEnabled',
    registry.Boolean(
        True,
        _("""Whether to add additional information about YouTube videos""")))

conf.registerChannelValue(
    SpiffyTitles, 'imgurHandlerEnabled',
Ejemplo n.º 27
0
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    Web = conf.registerPlugin('Web', True)
    if yn("""This plugin also offers a snarfer that will try to fetch the
             title of URLs that it sees in the channel.  Would like you this
             snarfer to be enabled?""",
          default=False):
        Web.titleSnarfer.setValue(True)


Web = conf.registerPlugin('Web')
conf.registerChannelValue(
    Web, 'titleSnarfer',
    registry.Boolean(
        False,
        _("""Determines whether the bot will output the
    HTML title of URLs it sees in the channel.""")))
conf.registerChannelValue(
    Web, 'snarferReportIOExceptions',
    registry.Boolean(
        False,
        _("""Determines whether the bot will notfiy the user
    about network exceptions like hostnotfound, timeout ....""")))
conf.registerChannelValue(
    Web, 'snarferShowDomain',
    registry.Boolean(
        True,
        _("""Determines whether domain names should be
    displayed by the title snarfer.""")))
conf.registerChannelValue(
    Web, 'snarfMultipleUrls',
Ejemplo n.º 28
0
    # a bool that specifies whether the user identified himself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('LastFM', True)


LastFM = conf.registerPlugin('LastFM')
conf.registerGlobalValue(
    LastFM, 'apiKey',
    registry.String(
        '',
        """Sets the API key for this plugin: http://www.last.fm/api/account/create""",
        private=True))
conf.registerChannelValue(
    LastFM, "fetchYouTubeLink",
    registry.Boolean(
        False, """Determines whether the bot will try to
        fetch a YouTube link for the track given in 'np'. This is an
        experimental feature, and requires the DDG plugin in this repository
        to be loaded."""))
conf.registerChannelValue(
    LastFM, "showExtendedInfo",
    registry.Boolean(
        False, """Determines whether the bot will show extended info
        for tracks in 'np' (currently the track tags and user play count). Note:
        this requires a second API call to be made for each 'np' call, which may
        be expensive in high traffic situations."""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Ejemplo n.º 29
0
# timeout, number of hints, values
conf.registerChannelValue(
    TriviaTime.commands, 'extraHint',
    registry.NormalizedString(""".""",
                              """The command to show alternative hints"""))

conf.registerChannelValue(
    TriviaTime.commands, 'showHintCommandKAOS',
    registry.NormalizedString(
        """,""", """The command for showing the remaining KAOS"""))

conf.registerChannelValue(
    TriviaTime.general, 'vowelsHint',
    registry.Boolean(
        True,
        """Show all vowels on the third hint. If false, random letters will be shown instead"""
    ))

conf.registerChannelValue(
    TriviaTime.general, 'showStats',
    registry.Boolean(True, """Show player stats after correct answer?"""))

conf.registerChannelValue(
    TriviaTime.skip, 'skipThreshold',
    registry.Float(
        .5, """Percentage of active players who need to vote to skip"""))

conf.registerChannelValue(
    TriviaTime.skip, 'skipActiveTime',
    registry.Integer((
        10 * 60
Ejemplo n.º 30
0
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified themself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Ombi', True)


Ombi = conf.registerPlugin('Ombi')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Ombi, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))

conf.registerNetworkValue(
    Ombi, 'UseSSL',
    registry.Boolean(True, """ Is it configured to use SSL""", private=True))

conf.registerNetworkValue(
    Ombi, 'Host',
    registry.string('',
                    """ Enter the IP address for Ombi listener""",
                    private=True))

conf.registerNetworkValue(
    Ombi, 'Port',
    registry.string('', """ Enter the port for Ombi listener""", private=True))

conf.registerNetworkValue(
    Ombi, 'UrlBase',
    registry.string(
        'ombi/',