| 1 |
### |
| 2 |
# Copyright (c) 2005, Jeremiah Fincher |
| 3 |
# Copyright (c) 2010-2021, Valentin Lorentz |
| 4 |
# All rights reserved. |
| 5 |
# |
| 6 |
# Redistribution and use in source and binary forms, with or without |
| 7 |
# modification, are permitted provided that the following conditions are met: |
| 8 |
# |
| 9 |
# * Redistributions of source code must retain the above copyright notice, |
| 10 |
# this list of conditions, and the following disclaimer. |
| 11 |
# * Redistributions in binary form must reproduce the above copyright notice, |
| 12 |
# this list of conditions, and the following disclaimer in the |
| 13 |
# documentation and/or other materials provided with the distribution. |
| 14 |
# * Neither the name of the author of this software nor the name of |
| 15 |
# contributors to this software may be used to endorse or promote products |
| 16 |
# derived from this software without specific prior written consent. |
| 17 |
# |
| 18 |
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 19 |
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 20 |
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 21 |
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 22 |
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 23 |
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 24 |
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 25 |
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 26 |
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 27 |
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 28 |
# POSSIBILITY OF SUCH DAMAGE. |
| 29 |
### |
| 30 |
|
| 31 |
import supybot.conf as conf |
| 32 |
import supybot.registry as registry |
| 33 |
from supybot.i18n import PluginInternationalization, internationalizeDocstring |
| 34 |
_ = PluginInternationalization('Karma') |
| 35 |
|
| 36 |
def configure(advanced): |
| 37 |
# This will be called by supybot to configure this module. advanced is |
| 38 |
# a bool that specifies whether the user identified themself as an advanced |
| 39 |
# user or not. You should effect your configuration by manipulating the |
| 40 |
# registry as appropriate. |
| 41 |
from supybot.questions import expect, anything, something, yn |
| 42 |
conf.registerPlugin('Karma', True) |
| 43 |
|
| 44 |
Karma = conf.registerPlugin('Karma') |
| 45 |
|
| 46 |
conf.registerChannelValue(Karma, 'simpleOutput', |
| 47 |
registry.Boolean(False, _("""Determines whether the bot will output shorter |
| 48 |
versions of the karma output when requesting a single thing's karma."""))) |
| 49 |
conf.registerChannelValue(Karma, 'incrementChars', |
| 50 |
registry.SpaceSeparatedListOfStrings(['++'], _("""A space separated list of |
| 51 |
characters to increase karma."""))) |
| 52 |
conf.registerChannelValue(Karma, 'decrementChars', |
| 53 |
registry.SpaceSeparatedListOfStrings(['--'], _("""A space separated list of |
| 54 |
characters to decrease karma."""))) |
| 55 |
conf.registerChannelValue(Karma, 'response', |
| 56 |
registry.Boolean(False, _("""Determines whether the bot will reply with a |
| 57 |
success message when something's karma is increased or decreased."""))) |
| 58 |
conf.registerChannelValue(Karma, 'rankingDisplay', |
| 59 |
registry.Integer(3, _("""Determines how many highest/lowest karma things |
| 60 |
are shown when karma is called with no arguments."""))) |
| 61 |
conf.registerChannelValue(Karma, 'mostDisplay', |
| 62 |
registry.Integer(25, _("""Determines how many karma things are shown when |
| 63 |
the most command is called."""))) |
| 64 |
conf.registerChannelValue(Karma, 'allowSelfRating', |
| 65 |
registry.Boolean(False, _("""Determines whether users can adjust the karma |
| 66 |
of their nick."""))) |
| 67 |
conf.registerChannelValue(Karma, 'allowUnaddressedKarma', |
| 68 |
registry.Boolean(True, _("""Determines whether the bot will |
| 69 |
increase/decrease karma without being addressed."""))) |
| 70 |
conf.registerChannelValue(Karma, 'onlyNicks', |
| 71 |
registry.Boolean(False, _("""Determines whether the bot will |
| 72 |
only increase/decrease karma for nicks in the current channel."""))) |
| 73 |
|
| 74 |
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: |