Add usage examples for all settings
This commit is contained in:
parent
8cc0b84e53
commit
cf29c37112
30 changed files with 72 additions and 57 deletions
|
@ -2,7 +2,7 @@ from src import ModuleManager, utils
|
||||||
|
|
||||||
@utils.export("serverset", {"setting": "accept-invites",
|
@utils.export("serverset", {"setting": "accept-invites",
|
||||||
"help": "Set whether I accept invites on this server",
|
"help": "Set whether I accept invites on this server",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("received.invite")
|
@utils.hook("received.invite")
|
||||||
def on_invite(self, event):
|
def on_invite(self, event):
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
from src import ModuleManager, utils
|
from src import ModuleManager, utils
|
||||||
|
|
||||||
@utils.export("channelset", {"setting": "automode",
|
@utils.export("channelset", {"setting": "automode",
|
||||||
"help": "Disable/Enable automode", "validate": utils.bool_or_none})
|
"help": "Disable/Enable automode", "validate": utils.bool_or_none,
|
||||||
|
"example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
_name = "AutoMode"
|
_name = "AutoMode"
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ def _apostrophe(nickname):
|
||||||
return "%s's" % nickname
|
return "%s's" % nickname
|
||||||
|
|
||||||
@utils.export("set", {"setting": "birthday", "help": "Set your birthday",
|
@utils.export("set", {"setting": "birthday", "help": "Set your birthday",
|
||||||
"validate": _check})
|
"validate": _check, "example": "1995-09-15"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("received.command.birthday")
|
@utils.hook("received.command.birthday")
|
||||||
def birthday(self, event):
|
def birthday(self, event):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from src import ModuleManager, utils
|
from src import ModuleManager, utils
|
||||||
|
|
||||||
@utils.export("serverset", {"setting": "bot-channel",
|
@utils.export("serverset", {"setting": "bot-channel",
|
||||||
"help": "Set main channel"})
|
"help": "Set main channel", "example": "#bitbot"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("received.001")
|
@utils.hook("received.001")
|
||||||
def do_join(self, event):
|
def do_join(self, event):
|
||||||
|
|
|
@ -5,8 +5,8 @@ ROOT_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
|
||||||
LOGS_DIRECTORY = os.path.join(ROOT_DIRECTORY, "logs")
|
LOGS_DIRECTORY = os.path.join(ROOT_DIRECTORY, "logs")
|
||||||
|
|
||||||
@utils.export("channelset", {"setting": "log",
|
@utils.export("channelset", {"setting": "log",
|
||||||
"help": "Enable/disable channel logging",
|
"help": "Enable/disable channel logging", "validate": utils.bool_or_none,
|
||||||
"validate": utils.bool_or_none})
|
"example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
def _log_file(self, server_name, channel_name):
|
def _log_file(self, server_name, channel_name):
|
||||||
return open(os.path.join(LOGS_DIRECTORY,
|
return open(os.path.join(LOGS_DIRECTORY,
|
||||||
|
|
|
@ -7,15 +7,17 @@ class InvalidTimeoutException(Exception):
|
||||||
|
|
||||||
@utils.export("channelset", {"setting": "highlight-spam-threshold",
|
@utils.export("channelset", {"setting": "highlight-spam-threshold",
|
||||||
"help": "Set the number of nicknames in a message that qualifies as spam",
|
"help": "Set the number of nicknames in a message that qualifies as spam",
|
||||||
"validate": utils.int_or_none})
|
"validate": utils.int_or_none, "example": "10"})
|
||||||
@utils.export("channelset", {"setting": "highlight-spam-protection",
|
@utils.export("channelset", {"setting": "highlight-spam-protection",
|
||||||
"help": "Enable/Disable highlight spam protection",
|
"help": "Enable/Disable highlight spam protection",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
@utils.export("channelset", {"setting": "highlight-spam-ban",
|
@utils.export("channelset", {"setting": "highlight-spam-ban",
|
||||||
"help": "Enable/Disable banning highlight spammers "
|
"help": "Enable/Disable banning highlight spammers "
|
||||||
"instead of just kicking", "validate": utils.bool_or_none})
|
"instead of just kicking", "validate": utils.bool_or_none,
|
||||||
|
"example": "on"})
|
||||||
@utils.export("channelset", {"setting": "ban-format",
|
@utils.export("channelset", {"setting": "ban-format",
|
||||||
"help": "Set ban format ($n = nick, $u = username, $h = hostname)"})
|
"help": "Set ban format ($n = nick, $u = username, $h = hostname)",
|
||||||
|
"example": "*!$u@$h"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
_name = "ChanOp"
|
_name = "ChanOp"
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,11 @@ LOWHIGH = {
|
||||||
"high": "o"
|
"high": "o"
|
||||||
}
|
}
|
||||||
@utils.export("channelset", {"setting": "mode-low",
|
@utils.export("channelset", {"setting": "mode-low",
|
||||||
"help": "Set which channel mode is considered to be 'low' access"})
|
"help": "Set which channel mode is considered to be 'low' access",
|
||||||
|
"example": "v"})
|
||||||
@utils.export("channelset", {"setting": "mode-high",
|
@utils.export("channelset", {"setting": "mode-high",
|
||||||
"help": "Set which channel mode is considered to be 'high' access"})
|
"help": "Set which channel mode is considered to be 'high' access",
|
||||||
|
"example": "o"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("preprocess.command")
|
@utils.hook("preprocess.command")
|
||||||
def preprocess_command(self, event):
|
def preprocess_command(self, event):
|
||||||
|
|
|
@ -8,13 +8,14 @@ RE_URL = re.compile(r"https?://\S+", re.I)
|
||||||
|
|
||||||
@utils.export("channelset", {"setting": "check-urls",
|
@utils.export("channelset", {"setting": "check-urls",
|
||||||
"help": "Enable/Disable automatically checking for malicious URLs",
|
"help": "Enable/Disable automatically checking for malicious URLs",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
@utils.export("serverset", {"setting": "check-urls",
|
@utils.export("serverset", {"setting": "check-urls",
|
||||||
"help": "Enable/Disable automatically checking for malicious URLs",
|
"help": "Enable/Disable automatically checking for malicious URLs",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
@utils.export("channelset", {"setting": "check-urls-kick",
|
@utils.export("channelset", {"setting": "check-urls-kick",
|
||||||
"help": "Enable/Disable automatically kicking users that "
|
"help": "Enable/Disable automatically kicking users that "
|
||||||
"send malicious URLs", "validate": utils.bool_or_none})
|
"send malicious URLs", "validate": utils.bool_or_none,
|
||||||
|
"example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("received.message.channel")
|
@utils.hook("received.message.channel")
|
||||||
def message(self, event):
|
def message(self, event):
|
||||||
|
|
|
@ -14,24 +14,24 @@ def _command_method_validate(s):
|
||||||
return s.upper()
|
return s.upper()
|
||||||
|
|
||||||
@utils.export("channelset", {"setting": "command-prefix",
|
@utils.export("channelset", {"setting": "command-prefix",
|
||||||
"help": "Set the command prefix used in this channel"})
|
"help": "Set the command prefix used in this channel", "example": "!"})
|
||||||
@utils.export("serverset", {"setting": "command-prefix",
|
@utils.export("serverset", {"setting": "command-prefix",
|
||||||
"help": "Set the command prefix used on this server"})
|
"help": "Set the command prefix used on this server", "example": "!"})
|
||||||
@utils.export("serverset", {"setting": "command-method",
|
@utils.export("serverset", {"setting": "command-method",
|
||||||
"help": "Set the method used to respond to commands",
|
"help": "Set the method used to respond to commands",
|
||||||
"validate": _command_method_validate})
|
"validate": _command_method_validate, "example": "NOTICE"})
|
||||||
@utils.export("channelset", {"setting": "command-method",
|
@utils.export("channelset", {"setting": "command-method",
|
||||||
"help": "Set the method used to respond to commands",
|
"help": "Set the method used to respond to commands",
|
||||||
"validate": _command_method_validate})
|
"validate": _command_method_validate, "example": "NOTICE"})
|
||||||
@utils.export("channelset", {"setting": "hide-prefix",
|
@utils.export("channelset", {"setting": "hide-prefix",
|
||||||
"help": "Disable/enable hiding prefix in command reponses",
|
"help": "Disable/enable hiding prefix in command reponses",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
@utils.export("channelset", {"setting": "commands",
|
@utils.export("channelset", {"setting": "commands",
|
||||||
"help": "Disable/enable responding to commands in-channel",
|
"help": "Disable/enable responding to commands in-channel",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
@utils.export("channelset", {"setting": "prefixed-commands",
|
@utils.export("channelset", {"setting": "prefixed-commands",
|
||||||
"help": "Disable/enable responding to prefixed commands in-channel",
|
"help": "Disable/enable responding to prefixed commands in-channel",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
def on_load(self):
|
def on_load(self):
|
||||||
self.exports.add("is-ignored", self._is_ignored)
|
self.exports.add("is-ignored", self._is_ignored)
|
||||||
|
|
|
@ -4,7 +4,7 @@ from src import IRCBot, ModuleManager, utils
|
||||||
|
|
||||||
@utils.export("serverset", {"setting": "ctcp-responses",
|
@utils.export("serverset", {"setting": "ctcp-responses",
|
||||||
"help": "Set whether I respond to CTCPs on this server",
|
"help": "Set whether I respond to CTCPs on this server",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("received.ctcp.version.private")
|
@utils.hook("received.ctcp.version.private")
|
||||||
def ctcp_version(self, event):
|
def ctcp_version(self, event):
|
||||||
|
|
|
@ -7,13 +7,14 @@ NO_DUCK = "There was no duck!"
|
||||||
DEFAULT_MIN_MESSAGES = 100
|
DEFAULT_MIN_MESSAGES = 100
|
||||||
|
|
||||||
@utils.export("channelset", {"setting": "ducks-enabled",
|
@utils.export("channelset", {"setting": "ducks-enabled",
|
||||||
"help": "Whether or not to spawn ducks", "validate": utils.bool_or_none})
|
"help": "Whether or not to spawn ducks", "validate": utils.bool_or_none,
|
||||||
|
"example": "on"})
|
||||||
@utils.export("channelset", {"setting": "ducks-min-messages",
|
@utils.export("channelset", {"setting": "ducks-min-messages",
|
||||||
"help": "Minimum messages between ducks spawning",
|
"help": "Minimum messages between ducks spawning",
|
||||||
"validate": utils.int_or_none})
|
"validate": utils.int_or_none, "example": "50"})
|
||||||
@utils.export("channelset", {"setting": "ducks-kick",
|
@utils.export("channelset", {"setting": "ducks-kick",
|
||||||
"help": "Whether or not to kick someone talking to non-existent ducks",
|
"help": "Whether or not to kick someone talking to non-existent ducks",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("new.channel")
|
@utils.hook("new.channel")
|
||||||
def new_channel(self, event):
|
def new_channel(self, event):
|
||||||
|
|
|
@ -93,18 +93,19 @@ CHECK_RUN_FAILURES = ["failure", "cancelled", "timed_out", "action_required"]
|
||||||
|
|
||||||
@utils.export("channelset", {"setting": "github-hide-prefix",
|
@utils.export("channelset", {"setting": "github-hide-prefix",
|
||||||
"help": "Hide/show command-like prefix on Github hook outputs",
|
"help": "Hide/show command-like prefix on Github hook outputs",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
@utils.export("channelset", {"setting": "github-hide-organisation",
|
@utils.export("channelset", {"setting": "github-hide-organisation",
|
||||||
"help": "Hide/show organisation in repository names",
|
"help": "Hide/show organisation in repository names",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
@utils.export("channelset", {"setting": "github-default-repo",
|
@utils.export("channelset", {"setting": "github-default-repo",
|
||||||
"help": "Set the default github repo for the current channel"})
|
"help": "Set the default github repo for the current channel",
|
||||||
|
"example": "jesopo/bitbot"})
|
||||||
@utils.export("channelset", {"setting": "github-prevent-highlight",
|
@utils.export("channelset", {"setting": "github-prevent-highlight",
|
||||||
"help": "Enable/disable preventing highlights",
|
"help": "Enable/disable preventing highlights",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
@utils.export("channelset", {"setting": "auto-github",
|
@utils.export("channelset", {"setting": "auto-github",
|
||||||
"help": "Enable/disable automatically getting github issue/PR info",
|
"help": "Enable/disable automatically getting github issue/PR info",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
def _parse_ref(self, channel, ref):
|
def _parse_ref(self, channel, ref):
|
||||||
repo, _, number = ref.rpartition("#")
|
repo, _, number = ref.rpartition("#")
|
||||||
|
|
|
@ -9,7 +9,7 @@ URL_GOOGLESUGGEST = "http://google.com/complete/search"
|
||||||
|
|
||||||
@utils.export("channelset", {"setting": "google-safesearch",
|
@utils.export("channelset", {"setting": "google-safesearch",
|
||||||
"help": "Turn safe search off/on",
|
"help": "Turn safe search off/on",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("received.command.g", alias_of="google")
|
@utils.hook("received.command.g", alias_of="google")
|
||||||
@utils.hook("received.command.google")
|
@utils.hook("received.command.google")
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
from src import ModuleManager, utils
|
from src import ModuleManager, utils
|
||||||
|
|
||||||
@utils.export("channelset", {"setting": "greeting",
|
@utils.export("channelset", {"setting": "greeting",
|
||||||
"help": "Set a greeting to send to users when they join"})
|
"help": "Set a greeting to send to users when they join",
|
||||||
|
"example": "welcome to the channel!"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("received.join")
|
@utils.hook("received.join")
|
||||||
def join(self, event):
|
def join(self, event):
|
||||||
|
|
|
@ -16,7 +16,7 @@ NSFW_TEXT = "(NSFW)"
|
||||||
|
|
||||||
@utils.export("channelset", {"setting": "auto-imgur",
|
@utils.export("channelset", {"setting": "auto-imgur",
|
||||||
"help": "Disable/Enable automatically getting info from Imgur URLs",
|
"help": "Disable/Enable automatically getting info from Imgur URLs",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
def _prefix(self, data):
|
def _prefix(self, data):
|
||||||
text = "%s: " % data["id"]
|
text = "%s: " % data["id"]
|
||||||
|
|
|
@ -7,10 +7,10 @@ KARMA_DELAY_SECONDS = 3
|
||||||
|
|
||||||
@utils.export("channelset", {"setting": "karma-verbose",
|
@utils.export("channelset", {"setting": "karma-verbose",
|
||||||
"help": "Enable/disable automatically responding to karma changes",
|
"help": "Enable/disable automatically responding to karma changes",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
@utils.export("serverset", {"setting": "karma-nickname-only",
|
@utils.export("serverset", {"setting": "karma-nickname-only",
|
||||||
"help": "Enable/disable karma being for nicknames only",
|
"help": "Enable/disable karma being for nicknames only",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
def _karma_str(self, karma):
|
def _karma_str(self, karma):
|
||||||
karma_str = str(karma)
|
karma_str = str(karma)
|
||||||
|
|
|
@ -5,7 +5,8 @@ from src import ModuleManager, utils
|
||||||
|
|
||||||
URL_SCROBBLER = "http://ws.audioscrobbler.com/2.0/"
|
URL_SCROBBLER = "http://ws.audioscrobbler.com/2.0/"
|
||||||
|
|
||||||
@utils.export("set", {"setting": "lastfm", "help": "Set last.fm username"})
|
@utils.export("set", {"setting": "lastfm", "help": "Set last.fm username",
|
||||||
|
"example": "jesopo"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
_name = "last.fm"
|
_name = "last.fm"
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,8 @@ import base64
|
||||||
from src import EventManager, ModuleManager, utils
|
from src import EventManager, ModuleManager, utils
|
||||||
|
|
||||||
@utils.export("serverset", {"setting": "nickserv-password",
|
@utils.export("serverset", {"setting": "nickserv-password",
|
||||||
"help": "Set the nickserv password for this server"})
|
"help": "Set the nickserv password for this server",
|
||||||
|
"example": "hunter2"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("received.001", priority=EventManager.PRIORITY_URGENT)
|
@utils.hook("received.001", priority=EventManager.PRIORITY_URGENT)
|
||||||
def on_connect(self, event):
|
def on_connect(self, event):
|
||||||
|
|
|
@ -6,7 +6,8 @@ REQUIRES_IDENTIFY = ("You need to be identified to use that command "
|
||||||
"(/msg %s register | /msg %s identify)")
|
"(/msg %s register | /msg %s identify)")
|
||||||
|
|
||||||
@utils.export("serverset", {"setting": "identity-mechanism",
|
@utils.export("serverset", {"setting": "identity-mechanism",
|
||||||
"help": "Set the identity mechanism for this server"})
|
"help": "Set the identity mechanism for this server",
|
||||||
|
"example": "ircv3-account"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("new.user")
|
@utils.hook("new.user")
|
||||||
def new_user(self, event):
|
def new_user(self, event):
|
||||||
|
|
|
@ -2,7 +2,8 @@ import datetime
|
||||||
from src import EventManager, ModuleManager, utils
|
from src import EventManager, ModuleManager, utils
|
||||||
|
|
||||||
@utils.export("botset", {"setting": "print-motd",
|
@utils.export("botset", {"setting": "print-motd",
|
||||||
"help": "Set whether I print /motd", "validate": utils.bool_or_none})
|
"help": "Set whether I print /motd", "validate": utils.bool_or_none,
|
||||||
|
"example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
def _print(self, event):
|
def _print(self, event):
|
||||||
self.bot.log.info("%s%s | %s", [
|
self.bot.log.info("%s%s | %s", [
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
from src import ModuleManager, utils
|
from src import ModuleManager, utils
|
||||||
|
|
||||||
@utils.export("set", {"setting": "pronouns", "help": "Set your pronouns"})
|
@utils.export("set", {"setting": "pronouns", "help": "Set your pronouns",
|
||||||
|
"example": "she/her"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("received.command.pronouns")
|
@utils.hook("received.command.pronouns")
|
||||||
def pronouns(self, event):
|
def pronouns(self, event):
|
||||||
|
|
|
@ -109,10 +109,10 @@ class Handler(http.server.BaseHTTPRequestHandler):
|
||||||
|
|
||||||
@utils.export("botset", {"setting": "rest-api",
|
@utils.export("botset", {"setting": "rest-api",
|
||||||
"help": "Enable/disable REST API",
|
"help": "Enable/disable REST API",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
@utils.export("botset", {"setting": "rest-api-minify",
|
@utils.export("botset", {"setting": "rest-api-minify",
|
||||||
"help": "Enable/disable REST API minifying",
|
"help": "Enable/disable REST API minifying",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
def on_load(self):
|
def on_load(self):
|
||||||
global _bot
|
global _bot
|
||||||
|
|
|
@ -17,7 +17,7 @@ def _validate(self, s):
|
||||||
|
|
||||||
@utils.export("serverset", {"setting": "sasl",
|
@utils.export("serverset", {"setting": "sasl",
|
||||||
"help": "Set the sasl username/password for this server",
|
"help": "Set the sasl username/password for this server",
|
||||||
"validate": _validate})
|
"validate": _validate, "example": "PLAIN BitBot:hunder2"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
def _best_userpass_mechanism(self, mechanisms):
|
def _best_userpass_mechanism(self, mechanisms):
|
||||||
for potential_mechanism in USERPASS_MECHANISMS:
|
for potential_mechanism in USERPASS_MECHANISMS:
|
||||||
|
|
|
@ -6,10 +6,10 @@ REGEX_SED = re.compile("^s/")
|
||||||
|
|
||||||
@utils.export("channelset", {"setting": "sed",
|
@utils.export("channelset", {"setting": "sed",
|
||||||
"help": "Disable/Enable sed in a channel",
|
"help": "Disable/Enable sed in a channel",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
@utils.export("channelset", {"setting": "sed-sender-only",
|
@utils.export("channelset", {"setting": "sed-sender-only",
|
||||||
"help": "Disable/Enable sed only looking at the messages sent by the user",
|
"help": "Disable/Enable sed only looking at the messages sent by the user",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
def _closest_setting(self, event, setting, default):
|
def _closest_setting(self, event, setting, default):
|
||||||
return event["target"].get_setting(setting,
|
return event["target"].get_setting(setting,
|
||||||
|
|
|
@ -2,10 +2,10 @@ from src import ModuleManager, utils
|
||||||
|
|
||||||
@utils.export("serverset", {"setting": "strip-color",
|
@utils.export("serverset", {"setting": "strip-color",
|
||||||
"help": "Set whether I strip colors from my messages on this server",
|
"help": "Set whether I strip colors from my messages on this server",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
@utils.export("channelset", {"setting": "strip-color",
|
@utils.export("channelset", {"setting": "strip-color",
|
||||||
"help": "Set whether I strip colors from my messages on in this channel",
|
"help": "Set whether I strip colors from my messages on in this channel",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("preprocess.send.privmsg")
|
@utils.hook("preprocess.send.privmsg")
|
||||||
@utils.hook("preprocess.send.notice")
|
@utils.hook("preprocess.send.notice")
|
||||||
|
|
|
@ -3,14 +3,14 @@ from src import EventManager, ModuleManager, utils
|
||||||
|
|
||||||
@utils.export("channelset", {"setting": "auto-title",
|
@utils.export("channelset", {"setting": "auto-title",
|
||||||
"help": "Disable/Enable automatically getting info titles from URLs",
|
"help": "Disable/Enable automatically getting info titles from URLs",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
@utils.export("channelset", {"setting": "title-shorten",
|
@utils.export("channelset", {"setting": "title-shorten",
|
||||||
"help": "Enable/disable shortening URLs when getting their title",
|
"help": "Enable/disable shortening URLs when getting their title",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
@utils.export("channelset", {"setting": "auto-title-first",
|
@utils.export("channelset", {"setting": "auto-title-first",
|
||||||
"help": ("Enable/disable showing who first posted a URL that was "
|
"help": ("Enable/disable showing who first posted a URL that was "
|
||||||
"auto-titled"),
|
"auto-titled"),
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "exaple": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
def _url_hash(self, url):
|
def _url_hash(self, url):
|
||||||
return "sha256:%s" % hashlib.sha256(url.lower().encode("utf8")
|
return "sha256:%s" % hashlib.sha256(url.lower().encode("utf8")
|
||||||
|
|
|
@ -5,7 +5,8 @@ from src import ModuleManager, utils
|
||||||
URL_TRAKT = "https://api-v2launch.trakt.tv/users/%s/watching"
|
URL_TRAKT = "https://api-v2launch.trakt.tv/users/%s/watching"
|
||||||
URL_TRAKTSLUG = "https://trakt.tv/%s/%s"
|
URL_TRAKTSLUG = "https://trakt.tv/%s/%s"
|
||||||
|
|
||||||
@utils.export("set", {"setting": "trakt", "help": "Set username on trakt.tv"})
|
@utils.export("set", {"setting": "trakt", "help": "Set username on trakt.tv",
|
||||||
|
"example": "jesopo"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("received.command.nw", alias_of="nowwatching")
|
@utils.hook("received.command.nw", alias_of="nowwatching")
|
||||||
@utils.hook("received.command.nowwatching")
|
@utils.hook("received.command.nowwatching")
|
||||||
|
|
|
@ -12,7 +12,7 @@ REGEX_TWITTERURL = re.compile(
|
||||||
|
|
||||||
@utils.export("channelset", {"setting": "auto-tweet",
|
@utils.export("channelset", {"setting": "auto-tweet",
|
||||||
"help": "Enable/disable automatically getting tweet info",
|
"help": "Enable/disable automatically getting tweet info",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
_name = "Twitter"
|
_name = "Twitter"
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ WORD_STOP = WORD_DELIM+"”)}>;:.,!?"
|
||||||
|
|
||||||
@utils.export("set", {"setting": "word-tracking",
|
@utils.export("set", {"setting": "word-tracking",
|
||||||
"help": "Disable/enable tracking your wordcounts",
|
"help": "Disable/enable tracking your wordcounts",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
def _channel_message(self, user, event):
|
def _channel_message(self, user, event):
|
||||||
if not user.get_setting("word-tracking", True):
|
if not user.get_setting("word-tracking", True):
|
||||||
|
|
|
@ -18,10 +18,10 @@ ARROW_DOWN = "↓"
|
||||||
|
|
||||||
@utils.export("channelset", {"setting": "auto-youtube",
|
@utils.export("channelset", {"setting": "auto-youtube",
|
||||||
"help": "Disable/Enable automatically getting info from youtube URLs",
|
"help": "Disable/Enable automatically getting info from youtube URLs",
|
||||||
"validate": utils.bool_or_none})
|
"validate": utils.bool_or_none, "example": "on"})
|
||||||
@utils.export("channelset", {"setting": "youtube-safesearch",
|
@utils.export("channelset", {"setting": "youtube-safesearch",
|
||||||
"help": "Turn safe search off/on",
|
"help": "Turn safe search off/on", "validate": utils.bool_or_none,
|
||||||
"validate": utils.bool_or_none})
|
"example": "on"})
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
def on_load(self):
|
def on_load(self):
|
||||||
self.exports.add("search-youtube", self._search_youtube)
|
self.exports.add("search-youtube", self._search_youtube)
|
||||||
|
|
Loading…
Reference in a new issue