overhauled help

This commit is contained in:
neersighted 2012-02-28 10:03:43 +08:00 committed by lukeroge
parent 0fdf370733
commit c58192f72c
58 changed files with 124 additions and 117 deletions

View file

@ -12,8 +12,8 @@ answers = [g + "As I see it, yes",
g + "Most likely",
g + "Outlook good",
g + "Signs point to yes",
g + "One would be wise to think so",#
g + "Naturally",#
g + "One would be wise to think so",
g + "Naturally",
g + "Without a doubt",
g + "Yes",
g + "Yes, definitely",
@ -23,11 +23,11 @@ answers = [g + "As I see it, yes",
y + "Better not tell you now",
y + "Cannot predict now",
y + "Concentrate and ask again",
y + "You know the answer better than I",#
y + "Maybe...",#
r + "You're kidding, right?",#
y + "You know the answer better than I",
y + "Maybe...",
r + "You're kidding, right?",
r + "Don't count on it",
r + "In your dreams", #
r + "In your dreams",
r + "My reply is no",
r + "My sources say no",
r + "Outlook not so good",
@ -35,7 +35,7 @@ answers = [g + "As I see it, yes",
@hook.command('8ball')
def eightball(inp, me=None):
".8ball <question> - The all knowing magic eight ball, in electronic form. Ask a question and the answer shall be provided."
".8ball <question> -- The all knowing magic eight ball, in electronic form. Ask and it shall be answered!"
global nextresponsenumber
inp = inp.strip()
if re.match("[a-zA-Z0-9]", inp[-1]):

View file

@ -16,7 +16,7 @@ def isadmin(input):
@hook.command
def quit(inp, input=None, db=None, notice=None):
".quit [reason] -- kills the bot"
".quit [reason] -- Kills the bot, with [reason] reason as its quit message.."
if not isadmin(input):
notice("Only bot admins can use this command!")
return
@ -30,7 +30,7 @@ def quit(inp, input=None, db=None, notice=None):
@hook.command
def join(inp, input=None, db=None, notice=None):
".join <channel> -- joins a channel"
".join <channel> -- Joins <channel>."
if not isadmin(input):
notice("Only bot admins can use this command!")
return
@ -40,7 +40,7 @@ def join(inp, input=None, db=None, notice=None):
@hook.command
def cycle(inp, input=None, db=None, notice=None):
".cycle <channel> -- cycles a channel"
".cycle <channel> -- Cycles <channel>."
if not isadmin(input):
notice("Only bot admins can use this command!")
return
@ -50,7 +50,7 @@ def cycle(inp, input=None, db=None, notice=None):
@hook.command
def part(inp, input=None, notice=None):
".part <channel> -- leaves a channel"
".part <channel> -- Parts from <channel>."
if not isadmin(input):
notice("Only bot admins can use this command!")
return
@ -59,7 +59,7 @@ def part(inp, input=None, notice=None):
@hook.command
def nick(inp, input=None, notice=None):
".nick <nick> -- change the bots nickname to <nick>"
".nick <nick> -- Changes the bots nickname to <nick>."
if not isadmin(input):
notice("Only bot admins can use this command!")
return
@ -68,7 +68,7 @@ def nick(inp, input=None, notice=None):
@hook.command
def raw(inp, input=None, notice=None):
".raw <command> - Send a RAW IRC command!"
".raw <command> -- Sends a RAW IRC command."
if not isadmin(input):
notice("Only bot admins can use this command!")
return
@ -77,7 +77,7 @@ def raw(inp, input=None, notice=None):
@hook.command
def kick(inp, input=None, notice=None):
".kick [channel] <user> [reason] -- kick a user!"
".kick [channel] <user> [reason] -- kicks a user."
if not isadmin(input):
notice("Only bot admins can use this command!")
return
@ -108,7 +108,7 @@ def kick(inp, input=None, notice=None):
@hook.command
def say(inp, input=None, notice=None):
".say [channel] <message> -- makes the bot say <message> in [channel]. if [channel] is blank the bot will say the <message> in the channel the command was used in."
".say [channel] <message> -- Makes the bot say <message> in [channel]. If [channel] is blank the bot will say the <message> in the channel the command was used in."
if not isadmin(input):
notice("Only bot admins can use this command!")
return
@ -130,7 +130,7 @@ def say(inp, input=None, notice=None):
@hook.command("me")
@hook.command
def act(inp, input=None, notice=None):
".act [channel] <action> -- makes the bot act <action> in [channel]. if [channel] is blank the bot will act the <action> in the channel the command was used in."
".act [channel] <action> -- Makes the bot act out <action> in [channel]. Ff [channel] is blank the bot will act the <action> in the channel the command was used in."
if not isadmin(input):
notice("Only bot admins can use this command!")
return
@ -151,7 +151,7 @@ def act(inp, input=None, notice=None):
@hook.command
def topic(inp, input=None, notice=None):
".topic [channel] <topic> -- change the topic of a channel"
".topic [channel] <topic> -- Change the topic of a channel."
if not isadmin(input):
notice("Only bot admins can use this command!")
return
@ -177,7 +177,7 @@ def mutesieve(bot, input, func, kind, args):
def mute(inp, input=None, db=None, bot=None, users=None):
if inp and inp in input.conn.users.channels.keys():
input.chan = inp
".mute <channel> -- Mutes the bot"
".mute <channel> -- Mutes the bot in <channel>. If no channel is specified, it is muted in the current channel."
if usertracking.query(db, bot.config, input.nick, input.chan, "mute") or "o" in users[input.chan].usermodes[input.nick]:
users[input.chan].mute = "%s %d" % (input.nick, time.time())
input.notice("Muted")
@ -188,7 +188,7 @@ def mute(inp, input=None, db=None, bot=None, users=None):
def unmute(inp, input=None, db=None, bot=None, users=None):
if inp and inp in users.channels.keys():
input.chan = inp
".unmute <channel> -- Unmutes the bot"
".unmute <channel> -- Unmutes the bot in <channel>. If no channel is specified, it is unmuted in the current channel."
if usertracking.query(db, bot.config, input.nick, input.chan, "mute") or "o" in users[input.chan].usermodes[input.nick]:
if hasattr(users[input.chan], "mute"):
input.notice("Unmuted")

View file

@ -13,7 +13,7 @@ MAX_STEPS = 1000000
@hook.command
def bf(inp):
".bf <prog> -- executes brainfuck program <prog>"""
".bf <prog> -- Executes <prog> as Brainfuck code."
program = re.sub('[^][<>+-.,]', '', inp)

View file

@ -3,7 +3,7 @@ from util import http, hook
@hook.command(autohelp=False)
def bitcoin(inp, say=None):
".bitcoin -- gets current exchange rate for bitcoins from mtgox"
".bitcoin -- Gets current exchange rate for bitcoins from mtgox."
data = http.get_json("https://mtgox.com/code/data/ticker.php")
ticker = data['ticker']
say("Current: \x0307$%(buy).2f\x0f - High: \x0307$%(high).2f\x0f"

View file

@ -83,7 +83,7 @@ def valueadd(bot, input, func, kind, args):
@hook.command
def mode(inp, input=None, db=None):
".mode -- Set modes on various things"
".mode -- Set modes on various things."
if input.nick not in input.bot.config["admins"]:
input.notice("Only bot admins can use this command!")
return

View file

@ -6,7 +6,7 @@ from util import hook
@hook.command
def choose(inp):
".choose <choice1>, <choice2>, ... <choicen> -- makes a decision"
".choose <choice1>, [choice2], [choice3], [choice4], ... -- Randomly picks one of the given choices."
c = re.findall(r'([^,]+)', inp)
if len(c) == 1:

View file

@ -17,7 +17,7 @@ def flip_simple(count):
@hook.command(autohelp=False)
def coin(inp):
".coin [amount] -- flips some coins and shares the result."
".coin [amount] -- Flips [amount] of coins."
# checking for valid input. if valid input [count=inp], if invalid [return error], if no input [count=1]
if inp.isdigit():

View file

@ -12,7 +12,7 @@ len_chars = len(chars)
@hook.command
def cypher(inp):
".cypher <pass> <string> -- cyphers a string with the password"
".cypher <pass> <string> -- Cyphers <string> with <password>."
passwd = inp.split(" ")[0]
len_passwd = len(passwd)
@ -39,7 +39,7 @@ def cypher(inp):
@hook.command
def decypher(inp):
".decypher <pass> <string> -- decyphers a string with the password"
".decypher <pass> <string> -- Decyphers <string> with <password>."
passwd = inp.split(" ")[0]
len_passwd = len(passwd)

View file

@ -36,7 +36,7 @@ def nrolls(count, n):
#@hook.regex(valid_diceroll, re.I)
@hook.command
def dice(inp):
".dice <diceroll> -- simulates dicerolls, e.g. .dice 2d20-d5+4 roll 2 " \
".dice <diceroll> -- Simulates dicerolls. Example of <diceroll>: '.dice 2d20-d5+4 roll 2'." \
"D20s, subtract 1D5, add 4"
try: # if inp is a re.match object...

View file

@ -6,7 +6,7 @@ from util import hook, http
@hook.command('u')
@hook.command
def urban(inp):
'''.u/.urban <phrase> -- looks up <phrase> on urbandictionary.com'''
".urban <phrase> -- Looks up <phrase> on urbandictionary.com."
url = 'http://www.urbandictionary.com/iphone/search/define'
page = http.get_json(url, term=inp)
@ -26,7 +26,7 @@ def urban(inp):
@hook.command('dictionary')
@hook.command
def define(inp):
".define/.dictionary <word> -- fetches definition of <word>"
".define <word> -- Fetches definition of <word>."
url = 'http://ninjawords.com/'
@ -86,7 +86,7 @@ def define(inp):
@hook.command('e')
@hook.command
def etymology(inp):
".e/.etymology <word> -- Retrieves the etymology of chosen word"
".etymology <word> -- Retrieves the etymology of <word>."
url = 'http://www.etymonline.com/index.php'

View file

@ -5,7 +5,7 @@ from util import hook, http
@hook.command
def down(inp):
'''.down <url> -- checks to see if the site is down'''
".down <url> -- Checks if the site at <url> is up or down."
if 'http://' not in inp:
inp = 'http://' + inp

View file

@ -7,7 +7,7 @@ ed_url = "http://encyclopediadramatica.ch/"
@hook.command('ed')
@hook.command
def drama(inp):
".drama <phrase> -- gets first paragraph of Encyclopedia Dramatica article on <phrase>"
".drama <phrase> -- Gets the first paragraph of Encyclopedia Dramatica article on <phrase>."
j = http.get_json(api_url, search=inp)
if not j[1]:

View file

@ -4,7 +4,7 @@ from BeautifulSoup import BeautifulSoup
@hook.command(autohelp=False)
def fact(inp, say=False, nick=False):
".fact -- gets a fact from OMGFACTS"
".fact -- Gets a random fact from OMGFACTS."
fact = None
while fact is None:

View file

@ -44,8 +44,9 @@ def multiwordReplace(text, wordDic):
@hook.command("r")
def remember(inp, nick='', db=None, say=None, input=None, notice=None):
".r <word> [+]<data> -- maps word to data in the memory"
".remember <word> [+]<data> -- Remembers <data> with <word>. Add + to <data> to append."
if input.nick not in input.bot.config["admins"]:
notice("Only bot admins can use this command!")
return
db_init(db)
@ -88,8 +89,9 @@ def remember(inp, nick='', db=None, say=None, input=None, notice=None):
@hook.command("f")
def forget(inp, db=None, input=None, notice=None):
".f <word> -- forgets the mapping that word had"
".forget <word> -- Forgets a remembered <word>."
if input.nick not in input.bot.config["admins"]:
notice("Only bot admins can use this command!")
return
db_init(db)
@ -108,7 +110,7 @@ def forget(inp, db=None, input=None, notice=None):
@hook.command("info")
@hook.regex(r'^\? ?(.+)')
def question(inp, say=None, db=None):
"?<word> -- shows what data is associated with word"
"?<word> -- Shows what data is associated with <word>."
db_init(db)
data = get_memory(db, inp.group(1).strip())

View file

@ -5,7 +5,7 @@ import random
@hook.command
def flip(inp, flip_count=0, say = None):
".flip <text> -- flips the given text"
".flip <text> -- Flips <text> over."
guy = unicode(random.choice(flips), 'utf8')
inp = inp.lower()
inp = inp[::-1]

View file

@ -45,14 +45,14 @@ flirts = ["I bet your name's Mickey, 'cause you're so fine.",
@hook.command(autohelp=False)
def flirt(inp, nick=None, me=None, input=None):
".flirt -- make mau5bot flirt!"
".flirt <user> -- Make the bot flirt with <user>."
msg = "flirts with " + nick + "... \"" + random.choice(flirts) + "\""
if re.match("^[A-Za-z0-9_|.-\]\[]*$", inp.lower()) and inp != "":
msg = "flirts with " + inp + "... \"" + random.choice(flirts) + "\""
if inp == input.conn.nick.lower() or inp == "itself":
msg = "flirts with itself"
msg = "flirts with itself!"
me(msg)

View file

@ -12,7 +12,7 @@ base_url = 'http://www.fmylife.com/'
@hook.command(autohelp=False)
def fml(inp):
".fml [id] -- gets a random quote from fmyfife.com"
".fml [id] -- Gets a random quote from fmyfife.com. Optionally gets [id]."
inp = inp.replace("#","") # this lets people use .fml #123456

View file

@ -56,7 +56,7 @@ fortunes = ["Help! I'm stuck in the fortune cookie factory!",
@hook.command(autohelp=False)
def fortune(inp, nick=None, say=None, input=None):
".fortune -- get your fortune"
".fortune -- Fortune cookies on demand."
msg = "(" + nick + ") " + random.choice(fortunes)
if re.match("^[A-Za-z0-9_|.-\]\[]*$", inp.lower()) and inp != "":

View file

@ -6,7 +6,7 @@ from BeautifulSoup import BeautifulSoup
@hook.command("calc")
@hook.command("math")
def calc(inp):
'''.calc <term> -- returns Google Calculator result'''
".calc <term> -- Calculate <term> with Google Calc."
white_re = re.compile(r'\s+')

View file

@ -22,7 +22,7 @@ def timezone(ip):
@hook.command
@hook.command("location")
def geoip(inp, say = None, bot = None):
".geoip <ip> - Performs a location check on the ip given."
".geoip <ip> - Performs a location check on <ip>."
api_key = bot.config.get("api_keys", {}).get("geoip", None)
if api_key is None:
return "error: no api key set"

View file

@ -11,7 +11,7 @@ def api_get(kind, query):
@hook.command
def gis(inp):
'''.gis <term> -- returns first google image result (safesearch off)'''
".gis <term> -- Returns first Google Image result (Safesearch off)."
parsed = api_get('images', inp)
if not 200 <= parsed['responseStatus'] < 300:
@ -26,7 +26,7 @@ def gis(inp):
@hook.command('g')
@hook.command
def google(inp):
'''.g/.google <query> -- returns first google search result'''
".google <query> -- Returns first google search result for <query>."
parsed = api_get('web', inp)
if not 200 <= parsed['responseStatus'] < 300:

View file

@ -6,7 +6,7 @@ from BeautifulSoup import BeautifulSoup
@hook.command("time")
def clock(inp, say=None):
'''.time <area> -- gets the time in <area>'''
".time <area> -- Gets the time in <area>"
white_re = re.compile(r'\s+')
tags_re = re.compile(r'<[^<]*?>')

View file

@ -3,26 +3,26 @@ from util import hook
@hook.command
def md5(inp):
".hash <text> -- returns a md5 hash of <text>"
".hash <text> -- Returns a md5 hash of <text>."
return hashlib.md5(inp).hexdigest()
@hook.command
def sha1(inp):
".hash <text> -- returns a sha1 hash of <text>"
".hash <text> -- Returns a sha1 hash of <text>."
return hashlib.sha1(inp).hexdigest()
@hook.command
def sha256(inp):
".hash <text> -- returns a sha256 hash of <text>"
".hash <text> -- Returns a sha256 hash of <text>."
return hashlib.sha256(inp).hexdigest()
@hook.command
def sha512(inp):
".hash <text> -- returns a sha512 hash of <text>"
".hash <text> -- Returns a sha512 hash of <text>."
return hashlib.sha512(inp).hexdigest()
@hook.command
def hash(inp):
".hash <text> -- returns hashes of <text>"
".hash <text> -- Returns hashes of <text>."
return ', '.join(x + ": " + getattr(hashlib, x)(inp).hexdigest()
for x in 'md5 sha1 sha256'.split())

View file

@ -4,7 +4,7 @@ from util import hook
@hook.command(autohelp=False)
def help(inp, input=None, bot=None, say=None, notice=None):
".help -- gives a list of commands/help for a command"
".help -- Gives a list of commands/help for a command."
funcs = {}
disabled = bot.config.get('disabled_plugins', [])
@ -38,7 +38,7 @@ def help(inp, input=None, bot=None, say=None, notice=None):
notice("Commands I recognise: " + out[0][1:])
if out[1]:
notice(out[1][1:])
notice("For help, do '.help example' where example is the " +
notice("For detailed help, do '.help <example>' where <example> is the " +
"name of the command you want help for.")
else:

View file

@ -5,7 +5,7 @@ from util import hook, http
@hook.command
def imdb(inp):
'''.imdb <movie> -- gets information about <movie> from IMDb'''
".imdb <movie> -- Gets information about <movie> from IMDb."
content = http.get_json("http://www.imdbapi.com/", t=inp)

View file

@ -37,7 +37,7 @@ insults = ["You are the son of a motherless ogre.",
@hook.command(autohelp=False)
def insult(inp, nick=None, say=None, input=None):
".insult [user] -- insult someone!"
".insult <user> -- Makes the bot insult <user>."
msg = "(" + nick + ") " + random.choice(insults)
if re.match("^[A-Za-z0-9_|.-\]\[]*$", inp.lower()) and inp != "":

View file

@ -23,7 +23,7 @@ body = ['head',
@hook.command
def kill(inp, me = None, nick = None, input=None, notice=None):
".kill <user> - kill a user"
".kill <user> -- Makes the bot kill <user>."
inp = inp.strip()
if not re.match("^[A-Za-z0-9_|.-\]\[]*$", inp.lower()):

View file

@ -8,7 +8,7 @@ def lastfm(inp, nick='', say=None, db=None, bot=None):
user = inp
else:
user = nick
".lastfm <user> -- displays the now playing (or recent) tracks of a LastFM user"
".lastfm <user> -- Displays the now playing (or recent) tracks of LastFM user <user>."
db.execute("create table if not exists lastfm(nick primary key, acc)")
sql = db.execute("select acc from lastfm where nick=lower(?)", (nick,)).fetchone();
api_url = "http://ws.audioscrobbler.com/2.0/?format=json"

View file

@ -21,7 +21,7 @@ def get_info(host, port):
@hook.command
def mcping(inp):
".mcping server[:port] - ping a minecraft server and show response."
".mcping server[:port] - Ping a Minecraft server to check status.."
inp = inp.strip().split(" ")[0]
if ":" in inp:

View file

@ -3,7 +3,7 @@ import string
@hook.command(autohelp=False)
def mcstatus(inp, bot=None):
".mcstatus -- Attempts to log in to minecraft"
".mcstatus -- Checks the status of Minecraft's login servers."
username = bot.config.get("api_keys", {}).get("mc_user", None)
password = bot.config.get("api_keys", {}).get("mc_pass", None)
if password is None:
@ -13,11 +13,11 @@ def mcstatus(inp, bot=None):
if username.lower() in login.lower():
return "Minecraft login servers appear to be online!"
else:
return "Minecraft login servers appear to be offline :("
return "Minecraft login servers appear to be offline!"
@hook.command
def mclogin(inp, say=None):
".mclogin <username> <password> -- Attempts to log in to minecraft using the provided username and password, this is NOT logged."
".mclogin <username> <password> -- Attempts to log in to Minecrat with <username> and <password> (This is NOT logged)."
inp = inp.split(" ")
username = inp[0]
password = inp[1]
@ -26,14 +26,14 @@ def mclogin(inp, say=None):
if username.lower() in login.lower():
return "I logged in with " + username
else:
return "I couldn't log in using " + username + ", either the password is wrong or minecraft login servers are down D:"
return "I couldn't log in using " + username + ", either the password is wrong or minecraft login servers are down!"
@hook.command
def mcpaid(inp):
".mcpaid <username> -- Checks if a user has a premium Minecraft account"
".mcpaid <username> -- Checks if <username> has a premium Minecraft account."
login = http.get("http://www.minecraft.net/haspaid.jsp?user=" + inp)
if "true" in login:
return "The account \'" + inp + "\' is a premium Minecraft account! :D"
return "The account \'" + inp + "\' is a premium Minecraft account!"
else:
return "The account \'" + inp + "\' is not a premium Minecraft account :("
return "The account \'" + inp + "\' is not a premium Minecraft account!"

View file

@ -6,7 +6,7 @@ from util import hook
@hook.command(autohelp=False)
def mem(inp):
".mem -- returns bot's current memory usage -- linux/windows only"
".mem -- Display the bot's current memory usage."
if os.name == 'posix':
status_file = open("/proc/%d/status" % os.getpid()).read()

View file

@ -8,8 +8,7 @@ from util import hook, http
@hook.command('mc')
def metacritic(inp):
'.mc [all|movie|tv|album|x360|ps3|pc|ds|wii] <title> -- gets rating for'\
' <title> from metacritic on the specified medium'
".mc [all|movie|tv|album|x360|ps3|pc|ds|wii] <title> -- Gets rating for <title> from metacritic on the specified medium."
# if the results suck, it's metacritic's fault

View file

@ -5,7 +5,7 @@ from util import hook, http
@hook.command
def mtg(inp):
".mtg <name> -- gets information about Magic the Gathering card <name>"
".mtg <name> -- Gets information about Magic the Gathering card <name>."
url = 'http://magiccards.info/query?v=card&s=cname'
h = http.get_html(url, q=inp)

View file

@ -6,7 +6,7 @@ from util import hook
@hook.command
def munge(inp, munge_count=0):
".munge <text> -- munges up the given text"
".munge <text> -- Munges up <text>."
reps = 0
for n in xrange(len(inp)):
rep = character_replacements.get(inp[n])
@ -20,7 +20,7 @@ def munge(inp, munge_count=0):
character_replacements = {
'a': 'ä',
# 'b': 'Б',
'b': 'Б',
'c': 'ċ',
'd': 'đ',
'e': 'ë',
@ -31,16 +31,16 @@ character_replacements = {
'j': 'ĵ',
'k': 'ķ',
'l': 'ĺ',
# 'm': 'ṁ',
'm': '',
'n': 'ñ',
'o': 'ö',
'p': 'ρ',
# 'q': 'ʠ',
'q': 'ʠ',
'r': 'ŗ',
's': 'š',
't': 'ţ',
'u': 'ü',
# 'v': '',
'v': '',
'w': 'ω',
'x': 'χ',
'y': 'ÿ',
@ -50,7 +50,7 @@ character_replacements = {
'C': 'Ç',
'D': 'Ď',
'E': 'Ē',
# 'F': 'Ḟ',
'F': '',
'G': 'Ġ',
'H': 'Ħ',
'I': 'Í',
@ -61,12 +61,12 @@ character_replacements = {
'N': 'Ν',
'O': 'Ö',
'P': 'Р',
# 'Q': '',
'Q': '',
'R': 'Ŗ',
'S': 'Š',
'T': 'Ţ',
'U': 'Ů',
# 'V': 'Ṿ',
'V': '',
'W': 'Ŵ',
'X': 'Χ',
'Y': '',

View file

@ -6,7 +6,7 @@ import unicodedata
@hook.command()
def namegen(inp, say = None, nick = None, input=None, notice=None):
".namegen [modules] -- generates some names using the chosen modules. \".namegen list\" will display a list of all modules"
".namegen [modules] -- Generates some names using the chosen modules. '.namegen list' will display a list of all modules."
gen = molecular.Molecule()

View file

@ -52,7 +52,13 @@ def gen_password(types):
@hook.command
def password(inp, notice=None):
".password <length> [types] -- generates a password. types can include 'alpha', 'no caps', 'numeric', 'symbols' or any combination of the types, eg. 'numbers symbols'"
".password <length> [types] -- Generates a password of <legenth>. [types] can include 'alpha', 'no caps', 'numeric', 'symbols' or any combination of the types, eg. 'numbers symbols'"
if inp == "penis":
return "Unable to process request, input too short"
return "error: unable to process request, input too short!"
if inp == "mypenis":
return "error: unable to process request, input too short!"
if inp == "dick":
return "error: unable to process request, input too short!"
if inp == "mydick":
return "error: unable to process request, input too short!"
notice(gen_password(inp))

View file

@ -6,7 +6,7 @@ potatoes = ['AC Belmont', 'AC Blue Pride', 'AC Brador', 'AC Chaleur', 'AC Domino
@hook.command
def potato(inp, me = None, input=None):
".potato <user> - makes the user a tasty little potato"
".potato <user> - Makes <user> a tasty little potato."
inp = inp.strip()
if not re.match("^[A-Za-z0-9_|.-\]\[]*$", inp.lower()):

View file

@ -8,7 +8,7 @@ re_lineends = re.compile(r'[\r\n]*')
@hook.command
def python(inp):
".python <prog> -- executes python code <prog>"
".python <prog> -- Executes <prog> as Python code."
inp = inp.replace("~n", "\n")

View file

@ -5,13 +5,13 @@ import time
from util import hook
def format_quote(q, num, n_quotes):
"""Returns a formatted string of a quote"""
"Returns a formatted string of a quote"
ctime, nick, msg = q
return "[%d/%d] <%s> %s" % (num, n_quotes,
nick, msg)
def create_table_if_not_exists(db):
"""Creates an empty quote table if one does not already exist"""
"Creates an empty quote table if one does not already exist"
db.execute('''CREATE TABLE IF NOT EXISTS quote (
chan,
nick,
@ -24,7 +24,7 @@ def create_table_if_not_exists(db):
db.commit()
def add_quote(db, chan, nick, add_nick, msg):
"""Adds a quote to a nick, returns message string"""
"Adds a quote to a nick, returns message string"
try:
db.execute('''INSERT OR FAIL INTO quote
(chan, nick, add_nick, msg, time)
@ -36,7 +36,7 @@ def add_quote(db, chan, nick, add_nick, msg):
return "Quote added."
def del_quote(db, chan, nick, add_nick, msg):
"""Deletes a quote from a nick"""
"Deletes a quote from a nick"
db.execute('''UPDATE quote
SET deleted = 1
WHERE chan=?
@ -45,7 +45,7 @@ def del_quote(db, chan, nick, add_nick, msg):
db.commit()
def get_quote_num(num, count, name):
"""Returns the quote number desired from the database"""
"Returns the quote number desired from the database"
if num: # Make sure num is a number if it isn't false
num = int(num)
if count == 0: # If there are no quotes in the database, raise an Exception.
@ -61,7 +61,7 @@ def get_quote_num(num, count, name):
return num
def get_quote_by_nick(db, chan, nick, num=False):
"""Returns a formatted quote from a nick, random or selected by number"""
"Returns a formatted quote from a nick, random or selected by number"
count = db.execute('''SELECT COUNT(*)
FROM quote
WHERE deleted != 1
@ -83,7 +83,7 @@ def get_quote_by_nick(db, chan, nick, num=False):
return format_quote(quote, num, count)
def get_quote_by_chan(db, chan, num=False):
"""Returns a formatted quote from a channel, random or selected by number"""
"Returns a formatted quote from a channel, random or selected by number"
count = db.execute('''SELECT COUNT(*)
FROM quote
WHERE deleted != 1
@ -105,8 +105,8 @@ def get_quote_by_chan(db, chan, num=False):
@hook.command('q')
@hook.command
def quote(inp, nick='', chan='', db=None, notice=None):
".q/.quote [#chan] [nick] [#n]/.quote add <nick> <msg> -- gets " \
"random or [#n]th quote by <nick> or from <#chan>/adds quote"
".quote [#chan] [nick] [#n]/.quote add <nick> <msg> -- Gets " \
"random or [#n]th quote by <nick> or from <#chan>/adds quote."
create_table_if_not_exists(db)
add = re.match(r"add[^\w@]+(\S+?)>?\s+(.*)", inp, re.I)

View file

@ -139,7 +139,7 @@ pasters = dict(
@hook.command
def repaste(inp, input=None, db=None, isManual=True):
".repaste mode|list|[provider] [syntax] <pastebinurl> -- scrape mibpaste, reupload on given pastebin"
".repaste mode|list|[provider] [syntax] <pastebinurl> -- Reuploads mibpaste to [provider]."
parts = inp.split()
db_init(db)

View file

@ -25,7 +25,7 @@ def seeninput(paraml, input=None, db=None, bot=None):
@hook.command
def seen(inp, nick='', chan='', db=None, input=None):
".seen <nick> -- Tell when a nickname was last in active in irc"
".seen <nick> -- Tell when a nickname was last in active in one of this bot's channels."
if input.conn.nick.lower() == inp.lower():
# user is looking for us, being a smartass

View file

@ -24,7 +24,7 @@ def bitly(url, user, apikey):
@hook.command
def shorten(inp, bot = None):
".shorten <url> - Makes an j.mp/bit.ly shortlink to the url provided"
".shorten <url> - Makes an j.mp/bit.ly shortlink to the url provided."
api_user = bot.config.get("api_keys", {}).get("bitly_user", None)
api_key = bot.config.get("api_keys", {}).get("bitly_api", None)
if api_key is None:
@ -33,7 +33,7 @@ def shorten(inp, bot = None):
@hook.command
def expand(inp, bot = None):
".expand <url> - gets the original URL from a shortened link"
".expand <url> - Gets the original URL from a shortened link."
try:
url = http.get_url(inp)
except HTTPError, e:

View file

@ -128,7 +128,7 @@ items = ["cast iron skillet",
@hook.command
def lart(inp, me = None, nick = None, input=None, notice=None):
".lart <user> - LARTs a user of your choice"
".lart <user> -- Makes the bot LART <user>."
inp = inp.strip()
if not re.match("^[A-Za-z0-9_|.-\]\[]*$", inp.lower()):
@ -144,7 +144,7 @@ def lart(inp, me = None, nick = None, input=None, notice=None):
@hook.command
def slap(inp, me = None, nick = None, input=None, notice=None):
".slap <user> - slap a user"
".slap <user> -- Makes the bot slap <user>."
inp = inp.strip()
if not re.match("^[A-Za-z0-9_|.-\]\[]*$", inp.lower()):

View file

@ -8,7 +8,7 @@ def sloganize(word):
@hook.command("slogan")
def sloganizr(inp, nick=None, say=None, input=None):
".slogan <word> -- make a solgan for <word>!"
".slogan <word> -- Makes a slogan for <word>."
slogan = sloganize(inp)
slogan = misc.strip_html(slogan)

View file

@ -8,7 +8,7 @@ search_url = "http://search.atomz.com/search/?sp_a=00062d45-sp00000000"
@hook.command
def snopes(inp):
".snopes <topic> -- searches snopes for an urban legend about <topic>"
".snopes <topic> -- Searches snopes for an urban legend about <topic>."
search_page = http.get_html(search_url, sp_q=inp, sp_c="1")
result_urls = search_page.xpath("//a[@target='_self']/@href")

View file

@ -6,7 +6,7 @@ import enchant
@hook.command("spellcheck")
def spell(inp):
'''.time <area> -- gets the time in <area>'''
".spell <word> -- Check spelling of <word>."
d = enchant.Dict("en_US")
if not (inp.split()[-1] == inp):

View file

@ -5,7 +5,7 @@ from util import hook, http
@hook.command
def stock(inp):
'''.stock <symbol> -- gets information about a stock symbol'''
".stock <symbol> -- Gets information about stock symbol <symbol>."
url = 'http://www.google.com/ig/api?stock=%s'

View file

@ -51,7 +51,7 @@ def tellinput(paraml, input=None, db=None, bot=None):
@hook.command(autohelp=False)
def showtells(inp, nick='', chan='', notice=None, db=None):
".showtells -- view all pending tell messages (sent in a notice)."
".showtells -- View all pending tell messages (sent in a notice)."
db_init(db)
@ -73,7 +73,7 @@ def showtells(inp, nick='', chan='', notice=None, db=None):
@hook.command
def tell(inp, nick='', chan='', db=None, input=None, notice=None):
".tell <nick> <message> -- relay <message> to <nick> when <nick> is around"
".tell <nick> <message> -- Relay <message> to <nick> when <nick> is around."
query = inp.split(' ', 1)
if len(query) != 2:

View file

@ -90,7 +90,7 @@ def db_search(db, nick, query):
@hook.command
def todo(inp, nick='', chan='', db=None, notice=None, bot=None):
"todo (add|del|list|search) [@user] args -- manipulates your todos"
".todo (add|del|list|search) [@user] args -- Manipulates your list of todos."
db_init(db)

View file

@ -85,7 +85,7 @@ def get_episode_info(episode, api_key):
@hook.command
@hook.command('tv')
def tv_next(inp, bot = None):
".tv_next <series> -- get the next episode of <series>"
".tv <series> -- Get the next episode of <series>."
api_key = bot.config.get("api_keys", {}).get("tvdb", None)
if api_key is None:
@ -135,7 +135,7 @@ def tv_next(inp, bot = None):
@hook.command
@hook.command('tv_prev')
def tv_last(inp, bot = None):
".tv_last <series> -- gets the most recently aired episode of <series>"
".tv_last <series> -- Gets the most recently aired episode of <series>."
api_key = bot.config.get("api_keys", {}).get("tvdb", None)
if api_key is None:

View file

@ -52,9 +52,9 @@ def parseDateTime(s):
@hook.command
def twitter(inp):
".twitter <user>/<user> <n>/<id>/#<hashtag>/@<user> -- gets last/<n>th "\
"tweet from <user>/gets tweet <id>/gets random tweet with #<hashtag>/"\
"gets replied tweet from @<user>"
".twitter <user>/<user> <n>/<id>/#<hashtag>/@<user> -- Gets last/<n>th "\
"tweet from <user>/gets tweet <id>/Gets random tweet with #<hashtag>/"\
"gets replied tweet from @<user>."
def add_reply(reply_name, reply_id):
if len(history) == history_max_size:

View file

@ -9,7 +9,7 @@ from util import hook, http
@hook.command
def validate(inp):
".validate <url> -- runs url through w3c markup validator"
".validate <url> -- Runs url through the w3c markup validator."
if not inp.startswith('http://'):
inp = 'http://' + inp

View file

@ -4,7 +4,7 @@ from util import hook, http
@hook.command(autohelp=False)
def forecast(inp, nick='', server='', reply=None, db=None, notice=None, say=None):
".forecast <location> [dontsave] -- gets a weather forecast from Google"
".forecast <location> [dontsave] -- Gets a weather forecast for <location> from Google."
loc = inp
dontsave = loc.endswith(" dontsave")
@ -44,7 +44,7 @@ def forecast(inp, nick='', server='', reply=None, db=None, notice=None, say=None
@hook.command(autohelp=False)
def weather(inp, nick='', server='', reply=None, db=None, notice=None):
".weather <location> [dontsave] -- gets weather data from Google"
".weather <location> [dontsave] -- Gets weather data for <location> from Google."
loc = inp
dontsave = loc.endswith(" dontsave")

View file

@ -2,6 +2,7 @@ from util import pywhois, hook
@hook.command
def whois(inp, say=None):
".whois <domain> -- Look up ownership infomation for <domain>"
try:
w = pywhois.whois(inp)
except:

View file

@ -15,8 +15,7 @@ paren_re = re.compile('\s*\(.*\)$')
@hook.command('w')
@hook.command
def wiki(inp):
'''.w/.wiki <phrase> -- gets first sentence of wikipedia ''' \
'''article on <phrase>'''
".wiki <phrase> -- Gets first sentence of Wikipedia article on <phrase>."
x = http.get_xml(search_url, search=inp)

View file

@ -6,7 +6,7 @@ from util import hook, http
@hook.command('wa')
@hook.command
def wolframalpha(inp, bot=None):
".wa/.wolframalpha <query> -- computes <query> using Wolfram Alpha"
".wa <query> -- Computes <query> using Wolfram Alpha."
api_key = bot.config.get("api_keys", {}).get("wolframalpha", None)
if api_key is None:

View file

@ -4,7 +4,7 @@ from BeautifulSoup import BeautifulSoup
@hook.command(autohelp=False)
def word(inp, say=False, nick=False):
".word -- gets the word of the day"
".word -- Gets the word of the day."
page = http.get('http://merriam-webster.com/word-of-the-day')
soup = BeautifulSoup(page)

View file

@ -68,7 +68,7 @@ def youtube_url(match):
@hook.command('y')
@hook.command
def youtube(inp):
'.youtube <query> -- returns the first YouTube search result for <query>'
".youtube <query> -- Returns the first YouTube search result for <query>."
j = http.get_json(search_api_url, q=inp)