From c58192f72c56e073f3a8a95c11e05a1637a2a682 Mon Sep 17 00:00:00 2001 From: neersighted Date: Tue, 28 Feb 2012 10:03:43 +0800 Subject: [PATCH] overhauled help --- plugins/8ball.py | 14 +++++++------- plugins/admin.py | 24 ++++++++++++------------ plugins/bf.py | 2 +- plugins/bitcoin.py | 2 +- plugins/botmodes.py | 2 +- plugins/choose.py | 2 +- plugins/coin.py | 2 +- plugins/cypher.py | 4 ++-- plugins/dice.py | 2 +- plugins/dictionary.py | 6 +++--- plugins/down.py | 2 +- plugins/drama.py | 2 +- plugins/fact.py | 2 +- plugins/factoids.py | 8 +++++--- plugins/flip.py | 2 +- plugins/flirt.py | 4 ++-- plugins/fmylife.py | 2 +- plugins/fortune.py | 2 +- plugins/gcalc.py | 2 +- plugins/geoip.py | 2 +- plugins/google.py | 4 ++-- plugins/gtime.py | 2 +- plugins/hash.py | 10 +++++----- plugins/help.py | 4 ++-- plugins/imdb.py | 2 +- plugins/insult.py | 2 +- plugins/kill.py | 2 +- plugins/lastfm.py | 2 +- plugins/mcping.py | 2 +- plugins/mctools.py | 14 +++++++------- plugins/mem.py | 2 +- plugins/metacritic.py | 3 +-- plugins/mtg.py | 2 +- plugins/munge.py | 16 ++++++++-------- plugins/namegen.py | 2 +- plugins/password.py | 10 ++++++++-- plugins/potato.py | 2 +- plugins/pyexec.py | 2 +- plugins/quote.py | 18 +++++++++--------- plugins/repaste.py | 2 +- plugins/seen.py | 2 +- plugins/shorten.py | 4 ++-- plugins/slap.py | 4 ++-- plugins/slogan.py | 2 +- plugins/snopes.py | 2 +- plugins/spellcheck.py | 2 +- plugins/stock.py | 2 +- plugins/tell.py | 4 ++-- plugins/todo.py | 2 +- plugins/tvdb.py | 4 ++-- plugins/twitter.py | 6 +++--- plugins/validate.py | 2 +- plugins/weather.py | 4 ++-- plugins/whois.py | 1 + plugins/wikipedia.py | 3 +-- plugins/wolframalpha.py | 2 +- plugins/wordoftheday.py | 2 +- plugins/youtube.py | 2 +- 58 files changed, 124 insertions(+), 117 deletions(-) diff --git a/plugins/8ball.py b/plugins/8ball.py index fef2abe..a7f68e3 100644 --- a/plugins/8ball.py +++ b/plugins/8ball.py @@ -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 - The all knowing magic eight ball, in electronic form. Ask a question and the answer shall be provided." + ".8ball -- 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]): diff --git a/plugins/admin.py b/plugins/admin.py index a56382d..eb1b69e 100644 --- a/plugins/admin.py +++ b/plugins/admin.py @@ -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 -- joins a channel" + ".join -- Joins ." 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 -- cycles a channel" + ".cycle -- Cycles ." 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 -- leaves a channel" + ".part -- Parts from ." 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 -- change the bots nickname to " + ".nick -- Changes the bots nickname to ." 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 - Send a RAW IRC command!" + ".raw -- 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] [reason] -- kick a user!" + ".kick [channel] [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] -- makes the bot say in [channel]. if [channel] is blank the bot will say the in the channel the command was used in." + ".say [channel] -- Makes the bot say in [channel]. If [channel] is blank the bot will say the 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] -- makes the bot act in [channel]. if [channel] is blank the bot will act the in the channel the command was used in." + ".act [channel] -- Makes the bot act out in [channel]. Ff [channel] is blank the bot will act the 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] -- change the topic of a channel" + ".topic [channel] -- 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 -- Mutes the bot" + ".mute -- Mutes the bot in . 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 -- Unmutes the bot" + ".unmute -- Unmutes the bot in . 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") diff --git a/plugins/bf.py b/plugins/bf.py index 9e7d66c..a3bd724 100644 --- a/plugins/bf.py +++ b/plugins/bf.py @@ -13,7 +13,7 @@ MAX_STEPS = 1000000 @hook.command def bf(inp): - ".bf -- executes brainfuck program """ + ".bf -- Executes as Brainfuck code." program = re.sub('[^][<>+-.,]', '', inp) diff --git a/plugins/bitcoin.py b/plugins/bitcoin.py index cdcb339..1308ae8 100644 --- a/plugins/bitcoin.py +++ b/plugins/bitcoin.py @@ -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" diff --git a/plugins/botmodes.py b/plugins/botmodes.py index fab3443..c37bd29 100644 --- a/plugins/botmodes.py +++ b/plugins/botmodes.py @@ -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 diff --git a/plugins/choose.py b/plugins/choose.py index 89d200b..dd8ce10 100644 --- a/plugins/choose.py +++ b/plugins/choose.py @@ -6,7 +6,7 @@ from util import hook @hook.command def choose(inp): - ".choose , , ... -- makes a decision" + ".choose , [choice2], [choice3], [choice4], ... -- Randomly picks one of the given choices." c = re.findall(r'([^,]+)', inp) if len(c) == 1: diff --git a/plugins/coin.py b/plugins/coin.py index 058255b..410b080 100644 --- a/plugins/coin.py +++ b/plugins/coin.py @@ -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(): diff --git a/plugins/cypher.py b/plugins/cypher.py index 91178e4..930bd81 100644 --- a/plugins/cypher.py +++ b/plugins/cypher.py @@ -12,7 +12,7 @@ len_chars = len(chars) @hook.command def cypher(inp): - ".cypher -- cyphers a string with the password" + ".cypher -- Cyphers with ." passwd = inp.split(" ")[0] len_passwd = len(passwd) @@ -39,7 +39,7 @@ def cypher(inp): @hook.command def decypher(inp): - ".decypher -- decyphers a string with the password" + ".decypher -- Decyphers with ." passwd = inp.split(" ")[0] len_passwd = len(passwd) diff --git a/plugins/dice.py b/plugins/dice.py index f94d335..c70f7f6 100644 --- a/plugins/dice.py +++ b/plugins/dice.py @@ -36,7 +36,7 @@ def nrolls(count, n): #@hook.regex(valid_diceroll, re.I) @hook.command def dice(inp): - ".dice -- simulates dicerolls, e.g. .dice 2d20-d5+4 roll 2 " \ + ".dice -- Simulates dicerolls. Example of : '.dice 2d20-d5+4 roll 2'." \ "D20s, subtract 1D5, add 4" try: # if inp is a re.match object... diff --git a/plugins/dictionary.py b/plugins/dictionary.py index 0d54592..6431565 100644 --- a/plugins/dictionary.py +++ b/plugins/dictionary.py @@ -6,7 +6,7 @@ from util import hook, http @hook.command('u') @hook.command def urban(inp): - '''.u/.urban -- looks up on urbandictionary.com''' + ".urban -- Looks up 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 -- fetches definition of " + ".define -- Fetches definition of ." url = 'http://ninjawords.com/' @@ -86,7 +86,7 @@ def define(inp): @hook.command('e') @hook.command def etymology(inp): - ".e/.etymology -- Retrieves the etymology of chosen word" + ".etymology -- Retrieves the etymology of ." url = 'http://www.etymonline.com/index.php' diff --git a/plugins/down.py b/plugins/down.py index 120205f..a8a3fe2 100644 --- a/plugins/down.py +++ b/plugins/down.py @@ -5,7 +5,7 @@ from util import hook, http @hook.command def down(inp): - '''.down -- checks to see if the site is down''' + ".down -- Checks if the site at is up or down." if 'http://' not in inp: inp = 'http://' + inp diff --git a/plugins/drama.py b/plugins/drama.py index 2025d35..a7e02e6 100644 --- a/plugins/drama.py +++ b/plugins/drama.py @@ -7,7 +7,7 @@ ed_url = "http://encyclopediadramatica.ch/" @hook.command('ed') @hook.command def drama(inp): - ".drama -- gets first paragraph of Encyclopedia Dramatica article on " + ".drama -- Gets the first paragraph of Encyclopedia Dramatica article on ." j = http.get_json(api_url, search=inp) if not j[1]: diff --git a/plugins/fact.py b/plugins/fact.py index 350ea3a..c50f582 100644 --- a/plugins/fact.py +++ b/plugins/fact.py @@ -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: diff --git a/plugins/factoids.py b/plugins/factoids.py index 71c9a84..85939ba 100644 --- a/plugins/factoids.py +++ b/plugins/factoids.py @@ -44,8 +44,9 @@ def multiwordReplace(text, wordDic): @hook.command("r") def remember(inp, nick='', db=None, say=None, input=None, notice=None): - ".r [+] -- maps word to data in the memory" + ".remember [+] -- Remembers with . Add + to 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 -- forgets the mapping that word had" + ".forget -- Forgets a remembered ." 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): - "? -- shows what data is associated with word" + "? -- Shows what data is associated with ." db_init(db) data = get_memory(db, inp.group(1).strip()) diff --git a/plugins/flip.py b/plugins/flip.py index f0151c5..d7e2ed1 100644 --- a/plugins/flip.py +++ b/plugins/flip.py @@ -5,7 +5,7 @@ import random @hook.command def flip(inp, flip_count=0, say = None): - ".flip -- flips the given text" + ".flip -- Flips over." guy = unicode(random.choice(flips), 'utf8') inp = inp.lower() inp = inp[::-1] diff --git a/plugins/flirt.py b/plugins/flirt.py index 068d0cc..d011e40 100644 --- a/plugins/flirt.py +++ b/plugins/flirt.py @@ -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 -- Make the bot flirt with ." 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) diff --git a/plugins/fmylife.py b/plugins/fmylife.py index 39e69dd..5b444e7 100644 --- a/plugins/fmylife.py +++ b/plugins/fmylife.py @@ -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 diff --git a/plugins/fortune.py b/plugins/fortune.py index 6dcf19e..52c1ef9 100644 --- a/plugins/fortune.py +++ b/plugins/fortune.py @@ -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 != "": diff --git a/plugins/gcalc.py b/plugins/gcalc.py index 3273fa7..a568f53 100644 --- a/plugins/gcalc.py +++ b/plugins/gcalc.py @@ -6,7 +6,7 @@ from BeautifulSoup import BeautifulSoup @hook.command("calc") @hook.command("math") def calc(inp): - '''.calc -- returns Google Calculator result''' + ".calc -- Calculate with Google Calc." white_re = re.compile(r'\s+') diff --git a/plugins/geoip.py b/plugins/geoip.py index 9030372..43bda78 100644 --- a/plugins/geoip.py +++ b/plugins/geoip.py @@ -22,7 +22,7 @@ def timezone(ip): @hook.command @hook.command("location") def geoip(inp, say = None, bot = None): - ".geoip - Performs a location check on the ip given." + ".geoip - Performs a location check on ." api_key = bot.config.get("api_keys", {}).get("geoip", None) if api_key is None: return "error: no api key set" diff --git a/plugins/google.py b/plugins/google.py index 9d0a57b..7163256 100644 --- a/plugins/google.py +++ b/plugins/google.py @@ -11,7 +11,7 @@ def api_get(kind, query): @hook.command def gis(inp): - '''.gis -- returns first google image result (safesearch off)''' + ".gis -- 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 -- returns first google search result''' + ".google -- Returns first google search result for ." parsed = api_get('web', inp) if not 200 <= parsed['responseStatus'] < 300: diff --git a/plugins/gtime.py b/plugins/gtime.py index 6e2cdee..16b5984 100644 --- a/plugins/gtime.py +++ b/plugins/gtime.py @@ -6,7 +6,7 @@ from BeautifulSoup import BeautifulSoup @hook.command("time") def clock(inp, say=None): - '''.time -- gets the time in ''' + ".time -- Gets the time in " white_re = re.compile(r'\s+') tags_re = re.compile(r'<[^<]*?>') diff --git a/plugins/hash.py b/plugins/hash.py index 33fec07..48d291f 100644 --- a/plugins/hash.py +++ b/plugins/hash.py @@ -3,26 +3,26 @@ from util import hook @hook.command def md5(inp): - ".hash -- returns a md5 hash of " + ".hash -- Returns a md5 hash of ." return hashlib.md5(inp).hexdigest() @hook.command def sha1(inp): - ".hash -- returns a sha1 hash of " + ".hash -- Returns a sha1 hash of ." return hashlib.sha1(inp).hexdigest() @hook.command def sha256(inp): - ".hash -- returns a sha256 hash of " + ".hash -- Returns a sha256 hash of ." return hashlib.sha256(inp).hexdigest() @hook.command def sha512(inp): - ".hash -- returns a sha512 hash of " + ".hash -- Returns a sha512 hash of ." return hashlib.sha512(inp).hexdigest() @hook.command def hash(inp): - ".hash -- returns hashes of " + ".hash -- Returns hashes of ." return ', '.join(x + ": " + getattr(hashlib, x)(inp).hexdigest() for x in 'md5 sha1 sha256'.split()) diff --git a/plugins/help.py b/plugins/help.py index 425d9dc..001c528 100644 --- a/plugins/help.py +++ b/plugins/help.py @@ -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 ' where is the " + "name of the command you want help for.") else: diff --git a/plugins/imdb.py b/plugins/imdb.py index 83e96e2..6f9e4a9 100644 --- a/plugins/imdb.py +++ b/plugins/imdb.py @@ -5,7 +5,7 @@ from util import hook, http @hook.command def imdb(inp): - '''.imdb -- gets information about from IMDb''' + ".imdb -- Gets information about from IMDb." content = http.get_json("http://www.imdbapi.com/", t=inp) diff --git a/plugins/insult.py b/plugins/insult.py index 6a02e47..62edf67 100644 --- a/plugins/insult.py +++ b/plugins/insult.py @@ -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 -- Makes the bot insult ." msg = "(" + nick + ") " + random.choice(insults) if re.match("^[A-Za-z0-9_|.-\]\[]*$", inp.lower()) and inp != "": diff --git a/plugins/kill.py b/plugins/kill.py index a243e70..7c08b30 100644 --- a/plugins/kill.py +++ b/plugins/kill.py @@ -23,7 +23,7 @@ body = ['head', @hook.command def kill(inp, me = None, nick = None, input=None, notice=None): - ".kill - kill a user" + ".kill -- Makes the bot kill ." inp = inp.strip() if not re.match("^[A-Za-z0-9_|.-\]\[]*$", inp.lower()): diff --git a/plugins/lastfm.py b/plugins/lastfm.py index 15cd7c5..a5ba0af 100644 --- a/plugins/lastfm.py +++ b/plugins/lastfm.py @@ -8,7 +8,7 @@ def lastfm(inp, nick='', say=None, db=None, bot=None): user = inp else: user = nick - ".lastfm -- displays the now playing (or recent) tracks of a LastFM user" + ".lastfm -- Displays the now playing (or recent) tracks of LastFM 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" diff --git a/plugins/mcping.py b/plugins/mcping.py index 257ded7..51d4943 100644 --- a/plugins/mcping.py +++ b/plugins/mcping.py @@ -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: diff --git a/plugins/mctools.py b/plugins/mctools.py index 947e031..4444086 100644 --- a/plugins/mctools.py +++ b/plugins/mctools.py @@ -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 -- Attempts to log in to minecraft using the provided username and password, this is NOT logged." + ".mclogin -- Attempts to log in to Minecrat with and (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 -- Checks if a user has a premium Minecraft account" + ".mcpaid -- Checks if 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!" diff --git a/plugins/mem.py b/plugins/mem.py index fbe7456..c480291 100644 --- a/plugins/mem.py +++ b/plugins/mem.py @@ -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() diff --git a/plugins/metacritic.py b/plugins/metacritic.py index 1f78ef1..aa3d2d6 100644 --- a/plugins/metacritic.py +++ b/plugins/metacritic.py @@ -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] -- 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 diff --git a/plugins/mtg.py b/plugins/mtg.py index 4e63758..3db8306 100644 --- a/plugins/mtg.py +++ b/plugins/mtg.py @@ -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) diff --git a/plugins/munge.py b/plugins/munge.py index 7ae080e..531a236 100644 --- a/plugins/munge.py +++ b/plugins/munge.py @@ -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', + 'Q': 'Q', 'R': 'Ŗ', 'S': 'Š', 'T': 'Ţ', 'U': 'Ů', -# 'V': 'Ṿ', + 'V': 'Ṿ', 'W': 'Ŵ', 'X': 'Χ', 'Y': 'Ỳ', diff --git a/plugins/namegen.py b/plugins/namegen.py index 382a175..ad4a490 100644 --- a/plugins/namegen.py +++ b/plugins/namegen.py @@ -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() diff --git a/plugins/password.py b/plugins/password.py index 15b9712..be190ab 100644 --- a/plugins/password.py +++ b/plugins/password.py @@ -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)) diff --git a/plugins/potato.py b/plugins/potato.py index 3b1ebd0..2e48dd9 100644 --- a/plugins/potato.py +++ b/plugins/potato.py @@ -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()): diff --git a/plugins/pyexec.py b/plugins/pyexec.py index f37505c..c6e9bc1 100644 --- a/plugins/pyexec.py +++ b/plugins/pyexec.py @@ -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") diff --git a/plugins/quote.py b/plugins/quote.py index 1b1a8f3..92271d2 100644 --- a/plugins/quote.py +++ b/plugins/quote.py @@ -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) diff --git a/plugins/repaste.py b/plugins/repaste.py index 79e0363..0f17e95 100644 --- a/plugins/repaste.py +++ b/plugins/repaste.py @@ -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) diff --git a/plugins/seen.py b/plugins/seen.py index 2099b91..4be75be 100644 --- a/plugins/seen.py +++ b/plugins/seen.py @@ -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 diff --git a/plugins/shorten.py b/plugins/shorten.py index 29f1259..00d5d9c 100644 --- a/plugins/shorten.py +++ b/plugins/shorten.py @@ -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: diff --git a/plugins/slap.py b/plugins/slap.py index 3556e9d..3270855 100644 --- a/plugins/slap.py +++ b/plugins/slap.py @@ -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()): diff --git a/plugins/slogan.py b/plugins/slogan.py index 17f822a..bc31db6 100644 --- a/plugins/slogan.py +++ b/plugins/slogan.py @@ -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) diff --git a/plugins/snopes.py b/plugins/snopes.py index 75adfd3..51a8ecb 100644 --- a/plugins/snopes.py +++ b/plugins/snopes.py @@ -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") diff --git a/plugins/spellcheck.py b/plugins/spellcheck.py index 80b0661..48b526e 100644 --- a/plugins/spellcheck.py +++ b/plugins/spellcheck.py @@ -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): diff --git a/plugins/stock.py b/plugins/stock.py index 5b28c60..0afdc13 100644 --- a/plugins/stock.py +++ b/plugins/stock.py @@ -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' diff --git a/plugins/tell.py b/plugins/tell.py index 09ff969..2c56869 100644 --- a/plugins/tell.py +++ b/plugins/tell.py @@ -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: diff --git a/plugins/todo.py b/plugins/todo.py index 2533bf9..6a2d170 100644 --- a/plugins/todo.py +++ b/plugins/todo.py @@ -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) diff --git a/plugins/tvdb.py b/plugins/tvdb.py index b1496ed..d1f1e47 100644 --- a/plugins/tvdb.py +++ b/plugins/tvdb.py @@ -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: diff --git a/plugins/twitter.py b/plugins/twitter.py index 221416e..1844618 100644 --- a/plugins/twitter.py +++ b/plugins/twitter.py @@ -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: diff --git a/plugins/validate.py b/plugins/validate.py index 7cdb13c..889e154 100644 --- a/plugins/validate.py +++ b/plugins/validate.py @@ -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 diff --git a/plugins/weather.py b/plugins/weather.py index 925a337..84f9e55 100644 --- a/plugins/weather.py +++ b/plugins/weather.py @@ -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") diff --git a/plugins/whois.py b/plugins/whois.py index de37d44..858a26c 100644 --- a/plugins/whois.py +++ b/plugins/whois.py @@ -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: diff --git a/plugins/wikipedia.py b/plugins/wikipedia.py index 2adb08a..36e1102 100644 --- a/plugins/wikipedia.py +++ b/plugins/wikipedia.py @@ -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) diff --git a/plugins/wolframalpha.py b/plugins/wolframalpha.py index 720230d..d70e300 100644 --- a/plugins/wolframalpha.py +++ b/plugins/wolframalpha.py @@ -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: diff --git a/plugins/wordoftheday.py b/plugins/wordoftheday.py index 7ab671b..5f877eb 100644 --- a/plugins/wordoftheday.py +++ b/plugins/wordoftheday.py @@ -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) diff --git a/plugins/youtube.py b/plugins/youtube.py index b1bb86c..1c1cb76 100644 --- a/plugins/youtube.py +++ b/plugins/youtube.py @@ -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)