Updated helpstrings
This commit is contained in:
parent
75a001ad5d
commit
54cf797b1e
60 changed files with 104 additions and 104 deletions
|
@ -36,6 +36,6 @@ answers = [g + "As I see it, yes",
|
|||
|
||||
@hook.command('8ball')
|
||||
def eightball(inp, me=None):
|
||||
".8ball <question> -- The all knowing magic eight ball, " \
|
||||
"8ball <question> -- The all knowing magic eight ball, " \
|
||||
"in electronic form. Ask and it shall be answered!"
|
||||
me("shakes the magic 8 ball... %s" % (random.choice(answers)))
|
||||
|
|
|
@ -10,7 +10,7 @@ import subprocess
|
|||
|
||||
@hook.command(adminonly=True)
|
||||
def addadmin(inp, notice=None, bot=None, config=None):
|
||||
".addadmin <nick|host> -- Make <nick|host> an admin. " \
|
||||
"addadmin <nick|host> -- Make <nick|host> an admin. " \
|
||||
"(you can add multiple admins at once)"
|
||||
targets = inp.split()
|
||||
for target in targets:
|
||||
|
@ -26,7 +26,7 @@ def addadmin(inp, notice=None, bot=None, config=None):
|
|||
|
||||
@hook.command(adminonly=True)
|
||||
def deladmin(inp, notice=None, bot=None, config=None):
|
||||
".deladmin <nick|host> -- Make <nick|host> a non-admin." \
|
||||
"deladmin <nick|host> -- Make <nick|host> a non-admin." \
|
||||
"(you can delete multiple admins at once)"
|
||||
targets = inp.split()
|
||||
for target in targets:
|
||||
|
@ -42,14 +42,14 @@ def deladmin(inp, notice=None, bot=None, config=None):
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def channels(inp, conn=None):
|
||||
".channels -- Lists the channels that the bot is in."
|
||||
"channels -- Lists the channels that the bot is in."
|
||||
return "I am in these channels: %s" % ", ".join(conn.channels)
|
||||
|
||||
|
||||
@hook.command("quit", autohelp=False, adminonly=True)
|
||||
@hook.command(autohelp=False, adminonly=True)
|
||||
def stop(inp, nick=None, conn=None):
|
||||
".stop [reason] -- Kills the bot with [reason] as its quit message."
|
||||
"stop [reason] -- Kills the bot with [reason] as its quit message."
|
||||
if inp:
|
||||
conn.cmd("QUIT", ["Killed by %s (%s)" % (nick, inp)])
|
||||
else:
|
||||
|
@ -60,7 +60,7 @@ def stop(inp, nick=None, conn=None):
|
|||
|
||||
@hook.command(autohelp=False, adminonly=True)
|
||||
def restart(inp, nick=None, conn=None):
|
||||
".restart [reason] -- Restarts the bot with [reason] as its quit message."
|
||||
"restart [reason] -- Restarts the bot with [reason] as its quit message."
|
||||
if inp:
|
||||
conn.cmd("QUIT", ["Restarted by %s (%s)" % (nick, inp)])
|
||||
else:
|
||||
|
@ -71,20 +71,20 @@ def restart(inp, nick=None, conn=None):
|
|||
|
||||
@hook.command(autohelp=False, adminonly=True)
|
||||
def clearlogs(inp, input=None):
|
||||
".clearlogs -- Clears the bots log(s)."
|
||||
"clearlogs -- Clears the bots log(s)."
|
||||
subprocess.call(["./cloudbot", "clear"])
|
||||
|
||||
|
||||
@hook.command(adminonly=True)
|
||||
def join(inp, conn=None, notice=None):
|
||||
".join <channel> -- Joins <channel>."
|
||||
"join <channel> -- Joins <channel>."
|
||||
notice("Attempting to join %s..." % inp)
|
||||
conn.join(inp)
|
||||
|
||||
|
||||
@hook.command(autohelp=False, adminonly=True)
|
||||
def part(inp, conn=None, chan=None, notice=None):
|
||||
".part <channel> -- Leaves <channel>." \
|
||||
"part <channel> -- Leaves <channel>." \
|
||||
"If [channel] is blank the bot will leave the " \
|
||||
"channel the command was used in."
|
||||
if inp:
|
||||
|
@ -97,7 +97,7 @@ def part(inp, conn=None, chan=None, notice=None):
|
|||
|
||||
@hook.command(autohelp=False, adminonly=True)
|
||||
def cycle(inp, conn=None, chan=None, notice=None):
|
||||
".cycle <channel> -- Cycles <channel>." \
|
||||
"cycle <channel> -- Cycles <channel>." \
|
||||
"If [channel] is blank the bot will cycle the " \
|
||||
"channel the command was used in."
|
||||
if inp:
|
||||
|
@ -111,7 +111,7 @@ def cycle(inp, conn=None, chan=None, notice=None):
|
|||
|
||||
@hook.command(adminonly=True)
|
||||
def nick(inp, input=None, notice=None, conn=None):
|
||||
".nick <nick> -- Changes the bots nickname to <nick>."
|
||||
"nick <nick> -- Changes the bots nickname to <nick>."
|
||||
if not re.match("^[A-Za-z0-9_|.-\]\[]*$", inp.lower()):
|
||||
notice("Invalid username!")
|
||||
return
|
||||
|
@ -121,14 +121,14 @@ def nick(inp, input=None, notice=None, conn=None):
|
|||
|
||||
@hook.command(adminonly=True)
|
||||
def raw(inp, conn=None, notice=None):
|
||||
".raw <command> -- Sends a RAW IRC command."
|
||||
"raw <command> -- Sends a RAW IRC command."
|
||||
notice("Raw command sent.")
|
||||
conn.send(inp)
|
||||
|
||||
|
||||
@hook.command(adminonly=True)
|
||||
def say(inp, conn=None, chan=None, notice=None):
|
||||
".say [channel] <message> -- Makes the bot say <message> in [channel]. " \
|
||||
"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."
|
||||
inp = inp.split(" ")
|
||||
|
@ -150,7 +150,7 @@ def say(inp, conn=None, chan=None, notice=None):
|
|||
@hook.command("act", adminonly=True)
|
||||
@hook.command(adminonly=True)
|
||||
def me(inp, conn=None, chan=None, notice=None):
|
||||
".me [channel] <action> -- Makes the bot act out <action> in [channel]. " \
|
||||
"me [channel] <action> -- Makes the bot act out <action> in [channel]. " \
|
||||
"If [channel] is blank the bot will act the <action> in the channel the " \
|
||||
"command was used in."
|
||||
inp = inp.split(" ")
|
||||
|
|
|
@ -14,7 +14,7 @@ MAX_STEPS = 1000000
|
|||
@hook.command('brainfuck')
|
||||
@hook.command
|
||||
def bf(inp):
|
||||
".bf <prog> -- Executes <prog> as Brainfuck code."
|
||||
"bf <prog> -- Executes <prog> as Brainfuck code."
|
||||
|
||||
program = re.sub('[^][<>+-.,]', '', inp)
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -6,7 +6,7 @@ from util import hook
|
|||
|
||||
@hook.command
|
||||
def choose(inp):
|
||||
".choose <choice1>, [choice2], [choice3], [choice4], ... -- " \
|
||||
"choose <choice1>, [choice2], [choice3], [choice4], ... -- " \
|
||||
"Randomly picks one of the given choices."
|
||||
|
||||
c = re.findall(r'([^,]+)', inp)
|
||||
|
|
|
@ -16,7 +16,7 @@ def flip_simple(count):
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def coin(inp):
|
||||
".coin [amount] -- Flips [amount] of coins."
|
||||
"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():
|
||||
|
|
|
@ -11,7 +11,7 @@ len_chars = len(chars)
|
|||
|
||||
@hook.command
|
||||
def cypher(inp):
|
||||
".cypher <pass> <string> -- Cyphers <string> with <password>."
|
||||
"cypher <pass> <string> -- Cyphers <string> with <password>."
|
||||
|
||||
passwd = inp.split(" ")[0]
|
||||
len_passwd = len(passwd)
|
||||
|
@ -38,7 +38,7 @@ def cypher(inp):
|
|||
|
||||
@hook.command
|
||||
def decypher(inp):
|
||||
".decypher <pass> <string> -- Decyphers <string> with <password>."
|
||||
"decypher <pass> <string> -- Decyphers <string> with <password>."
|
||||
|
||||
passwd = inp.split(" ")[0]
|
||||
len_passwd = len(passwd)
|
||||
|
|
|
@ -36,8 +36,8 @@ def nrolls(count, n):
|
|||
#@hook.regex(valid_diceroll, re.I)
|
||||
@hook.command
|
||||
def dice(inp):
|
||||
".dice <diceroll> -- Simulates dicerolls. Example of <diceroll>:" \
|
||||
" '.dice 2d20-d5+4 roll 2'. D20s, subtract 1D5, add 4"
|
||||
"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...
|
||||
(inp, desc) = inp.groups()
|
||||
|
|
|
@ -7,7 +7,7 @@ from util import http
|
|||
@hook.command('dictionary')
|
||||
@hook.command
|
||||
def define(inp):
|
||||
".define <word> -- Fetches definition of <word>."
|
||||
"define <word> -- Fetches definition of <word>."
|
||||
|
||||
url = 'http://ninjawords.com/'
|
||||
|
||||
|
@ -67,7 +67,7 @@ def define(inp):
|
|||
@hook.command('e')
|
||||
@hook.command
|
||||
def etymology(inp):
|
||||
".etymology <word> -- Retrieves the etymology of <word>."
|
||||
"etymology <word> -- Retrieves the etymology of <word>."
|
||||
|
||||
url = 'http://www.etymonline.com/index.php'
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ from util import hook, http
|
|||
|
||||
@hook.command
|
||||
def down(inp):
|
||||
".down <url> -- Checks if the site at <url> is up or down."
|
||||
"down <url> -- Checks if the site at <url> is up or down."
|
||||
|
||||
if 'http://' not in inp:
|
||||
inp = 'http://' + inp
|
||||
|
|
|
@ -6,7 +6,7 @@ ed_url = "http://encyclopediadramatica.se/"
|
|||
|
||||
@hook.command
|
||||
def drama(inp):
|
||||
".drama <phrase> -- Gets the first paragraph of" \
|
||||
"drama <phrase> -- Gets the first paragraph of" \
|
||||
" the Encyclopedia Dramatica article on <phrase>."
|
||||
|
||||
j = http.get_json(api_url, search=inp)
|
||||
|
|
|
@ -7,7 +7,7 @@ from BeautifulSoup import BeautifulSoup
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def fact(inp, say=False, nick=False):
|
||||
".fact -- Gets a random fact from OMGFACTS."
|
||||
"fact -- Gets a random fact from OMGFACTS."
|
||||
|
||||
fact = None
|
||||
while fact is None:
|
||||
|
|
|
@ -46,7 +46,7 @@ def multiwordReplace(text, wordDic):
|
|||
@hook.command("r", adminonly=True)
|
||||
@hook.command(adminonly=True)
|
||||
def remember(inp, nick='', db=None, say=None, input=None, notice=None):
|
||||
".remember <word> [+]<data> -- Remembers <data> with <word>. Add +"
|
||||
"remember <word> [+]<data> -- Remembers <data> with <word>. Add +"
|
||||
" to <data> to append."
|
||||
db_init(db)
|
||||
|
||||
|
@ -89,7 +89,7 @@ def remember(inp, nick='', db=None, say=None, input=None, notice=None):
|
|||
@hook.command("f", adminonly=True)
|
||||
@hook.command(adminonly=True)
|
||||
def forget(inp, db=None, input=None, notice=None):
|
||||
".forget <word> -- Forgets a remembered <word>."
|
||||
"forget <word> -- Forgets a remembered <word>."
|
||||
|
||||
db_init(db)
|
||||
data = get_memory(db, inp)
|
||||
|
@ -106,7 +106,7 @@ def forget(inp, db=None, input=None, notice=None):
|
|||
|
||||
@hook.command()
|
||||
def info(inp, notice=None, db=None):
|
||||
".info <factoid> -- Shows the source of a factoid."
|
||||
"info <factoid> -- Shows the source of a factoid."
|
||||
|
||||
db_init(db)
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ with open("plugins/data/flirts.txt") as f:
|
|||
|
||||
@hook.command
|
||||
def insult(inp, nick=None, me=None, conn=None):
|
||||
".insult <user> -- Makes the bot insult <user>."
|
||||
"insult <user> -- Makes the bot insult <user>."
|
||||
target = inp.strip()
|
||||
|
||||
if not re.match(nick_re, target):
|
||||
|
@ -34,7 +34,7 @@ def insult(inp, nick=None, me=None, conn=None):
|
|||
|
||||
@hook.command
|
||||
def flirt(inp, nick=None, me=None, conn=None):
|
||||
".flirt <user> -- Make the bot flirt with <user>."
|
||||
"flirt <user> -- Make the bot flirt with <user>."
|
||||
target = inp.strip()
|
||||
|
||||
if not re.match(nick_re, target):
|
||||
|
|
|
@ -4,7 +4,7 @@ import random
|
|||
|
||||
@hook.command
|
||||
def flip(inp, flip_count=0, say=None):
|
||||
".flip <text> -- Flips <text> over."
|
||||
"flip <text> -- Flips <text> over."
|
||||
guy = unicode(random.choice(flips), 'utf8')
|
||||
inp = inp.lower()
|
||||
inp = inp[::-1]
|
||||
|
|
|
@ -26,7 +26,7 @@ refresh_cache()
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def fml(inp, reply=None):
|
||||
".fml -- Gets a random quote from fmyfife.com."
|
||||
"fml -- Gets a random quote from fmyfife.com."
|
||||
|
||||
# grab the last item in the fml cache and remove it
|
||||
id, text = fml_cache.popitem()
|
||||
|
|
|
@ -13,5 +13,5 @@ with open("plugins/data/fortunes.txt") as f:
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def fortune(inp):
|
||||
".fortune -- Fortune cookies on demand."
|
||||
"fortune -- Fortune cookies on demand."
|
||||
return random.choice(fortunes)
|
||||
|
|
|
@ -7,7 +7,7 @@ from BeautifulSoup import BeautifulSoup
|
|||
@hook.command("math")
|
||||
@hook.command
|
||||
def calc(inp):
|
||||
".calc <term> -- Calculate <term> with Google Calc."
|
||||
"calc <term> -- Calculate <term> with Google Calc."
|
||||
|
||||
white_re = re.compile(r'\s+')
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import urllib2
|
|||
|
||||
@hook.command
|
||||
def gitio(inp):
|
||||
".gitio <url> [code] -- Shorten Github URLs with git.io. [code] is" \
|
||||
"gitio <url> [code] -- Shorten Github URLs with git.io. [code] is" \
|
||||
" a optional custom short code."
|
||||
split = inp.split(" ")
|
||||
url = split[0]
|
||||
|
|
|
@ -15,7 +15,7 @@ def api_get(kind, query):
|
|||
@hook.command('gis')
|
||||
@hook.command
|
||||
def googleimage(inp):
|
||||
".gis <query> -- Returns first Google Image result for <query>."
|
||||
"gis <query> -- Returns first Google Image result for <query>."
|
||||
|
||||
parsed = api_get('images', inp)
|
||||
if not 200 <= parsed['responseStatus'] < 300:
|
||||
|
@ -31,7 +31,7 @@ def googleimage(inp):
|
|||
@hook.command('g')
|
||||
@hook.command
|
||||
def google(inp):
|
||||
".google <query> -- Returns first google search result for <query>."
|
||||
"google <query> -- Returns first google search result for <query>."
|
||||
|
||||
parsed = api_get('web', inp)
|
||||
if not 200 <= parsed['responseStatus'] < 300:
|
||||
|
|
|
@ -4,30 +4,30 @@ 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'])
|
||||
|
|
|
@ -4,7 +4,7 @@ from util import hook
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def help(inp, say=None, notice=None, input=None, conn=None, bot=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', [])
|
||||
|
|
|
@ -21,7 +21,7 @@ def ignoresieve(bot, input, func, type, args):
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def ignored(inp, notice=None, bot=None):
|
||||
".ignored -- Lists ignored channels/nicks/hosts."
|
||||
"ignored -- Lists ignored channels/nicks/hosts."
|
||||
ignorelist = bot.config["plugins"]["ignore"]["ignored"]
|
||||
if ignorelist:
|
||||
notice("Ignored channels/nicks/hosts are: %s" % ", ".join(ignorelist))
|
||||
|
@ -32,7 +32,7 @@ def ignored(inp, notice=None, bot=None):
|
|||
|
||||
@hook.command(adminonly=True)
|
||||
def ignore(inp, notice=None, bot=None, config=None):
|
||||
".ignore <channel|nick|host> -- Makes the bot ignore <channel|nick|host>."
|
||||
"ignore <channel|nick|host> -- Makes the bot ignore <channel|nick|host>."
|
||||
target = inp.lower()
|
||||
ignorelist = bot.config["plugins"]["ignore"]["ignored"]
|
||||
if target in ignorelist:
|
||||
|
@ -47,7 +47,7 @@ def ignore(inp, notice=None, bot=None, config=None):
|
|||
|
||||
@hook.command(adminonly=True)
|
||||
def unignore(inp, notice=None, bot=None, config=None):
|
||||
".unignore <channel|nick|host> -- Makes the bot listen to"\
|
||||
"unignore <channel|nick|host> -- Makes the bot listen to"\
|
||||
" <channel|nick|host>."
|
||||
target = inp.lower()
|
||||
ignorelist = bot.config["plugins"]["ignore"]["ignored"]
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ from util import hook
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def admins(inp, notice=None, bot=None):
|
||||
".admins -- Lists bot's admins."
|
||||
"admins -- Lists bot's admins."
|
||||
if bot.config["admins"]:
|
||||
notice("Admins are: %s." % ", ".join(bot.config["admins"]))
|
||||
else:
|
||||
|
@ -12,5 +12,5 @@ def admins(inp, notice=None, bot=None):
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def prefix(inp, notice=False, conn=False):
|
||||
".prefix -- Shows the bot's command prefix"
|
||||
"prefix -- Shows the bot's command prefix"
|
||||
notice("The prefix is: \"%s\"" % conn.conf["command_prefix"])
|
|
@ -4,7 +4,7 @@ from datetime import datetime
|
|||
@hook.command('l', autohelp=False)
|
||||
@hook.command(autohelp=False)
|
||||
def lastfm(inp, nick='', say=None, db=None, bot=None):
|
||||
".lastfm [user] [dontsave] -- Displays the now playing (or last played)" \
|
||||
"lastfm [user] [dontsave] -- Displays the now playing (or last played)" \
|
||||
" track of LastFM user [user]."
|
||||
api_key = bot.config.get("api_keys", {}).get("lastfm")
|
||||
if not api_key:
|
||||
|
|
|
@ -51,7 +51,7 @@ with open("plugins/data/itemids.txt") as f:
|
|||
@hook.command("id")
|
||||
@hook.command
|
||||
def itemid(input, reply=None):
|
||||
".itemid/.id <item/id> -- gets the id from an item or vice versa"
|
||||
"itemid <item/id> -- gets the id from an item or vice versa"
|
||||
input = input.lower().strip()
|
||||
|
||||
if input == "":
|
||||
|
@ -84,7 +84,7 @@ def itemid(input, reply=None):
|
|||
@hook.command("craft")
|
||||
@hook.command
|
||||
def recipe(input, reply=None):
|
||||
".recipe/.craft <item> -- gets the crafting recipe for an item"
|
||||
"recipe <item> -- gets the crafting recipe for an item"
|
||||
input = input.lower().strip()
|
||||
|
||||
results = []
|
||||
|
|
|
@ -25,7 +25,7 @@ def mcping_connect(host, port):
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def mcstatus(inp, bot=None):
|
||||
".mcstatus -- Checks the status of Minecraft's login servers."
|
||||
"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:
|
||||
|
@ -42,7 +42,7 @@ def mcstatus(inp, bot=None):
|
|||
|
||||
@hook.command
|
||||
def mclogin(inp, say=None):
|
||||
".mclogin <username> <password> -- Attempts to log in to Minecraft with" \
|
||||
"mclogin <username> <password> -- Attempts to log in to Minecraft with" \
|
||||
" <username> and <password> (This is NOT logged)."
|
||||
inp = inp.split(" ")
|
||||
username = inp[0]
|
||||
|
@ -61,7 +61,7 @@ def mclogin(inp, say=None):
|
|||
|
||||
@hook.command
|
||||
def mcpaid(inp):
|
||||
".mcpaid <username> -- Checks if <username> has a" \
|
||||
"mcpaid <username> -- Checks if <username> has a" \
|
||||
" premium Minecraft account."
|
||||
login = http.get("http://www.minecraft.net/haspaid.jsp", user=inp)
|
||||
|
||||
|
@ -73,7 +73,7 @@ def mcpaid(inp):
|
|||
|
||||
@hook.command
|
||||
def mcping(inp):
|
||||
".mcping <server>[:port] - Ping a Minecraft server to check status."
|
||||
"mcping <server>[:port] - Ping a Minecraft server to check status."
|
||||
inp = inp.strip().split(" ")[0]
|
||||
|
||||
if ":" in inp:
|
||||
|
|
|
@ -9,7 +9,7 @@ from util import hook, http
|
|||
@hook.command('mc')
|
||||
@hook.command
|
||||
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
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ from util import hook
|
|||
|
||||
@hook.command
|
||||
def munge(inp, munge_count=0):
|
||||
".munge <text> -- Munges up <text>."
|
||||
"munge <text> -- Munges up <text>."
|
||||
reps = 0
|
||||
for n in xrange(len(inp)):
|
||||
rep = character_replacements.get(inp[n])
|
||||
|
|
|
@ -6,8 +6,8 @@ from util.text import get_text_list
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def namegen(inp, 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()
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ from util import hook
|
|||
|
||||
@hook.command(adminonly=True)
|
||||
def topic(inp, conn=None, chan=None, notice=None):
|
||||
".topic [channel] <topic> -- Change the topic of a channel."
|
||||
"topic [channel] <topic> -- Change the topic of a channel."
|
||||
inp = inp.split(" ")
|
||||
if inp[0][0] == "#":
|
||||
out = "PRIVMSG %s :%s" % (inp[0], message)
|
||||
|
@ -15,7 +15,7 @@ def topic(inp, conn=None, chan=None, notice=None):
|
|||
|
||||
@hook.command(adminonly=True)
|
||||
def kick(inp, chan=None, conn=None, notice=None):
|
||||
".kick [channel] <user> [reason] -- Makes the bot kick <user> in [channel] "\
|
||||
"kick [channel] <user> [reason] -- Makes the bot kick <user> in [channel] "\
|
||||
"If [channel] is blank the bot will kick the <user> in "\
|
||||
"the channel the command was used in."
|
||||
inp = inp.split(" ")
|
||||
|
@ -45,7 +45,7 @@ def kick(inp, chan=None, conn=None, notice=None):
|
|||
|
||||
@hook.command(adminonly=True)
|
||||
def ban(inp, conn=None, chan=None, notice=None):
|
||||
".ban [channel] <user> -- Makes the bot ban <user> in [channel]. "\
|
||||
"ban [channel] <user> -- Makes the bot ban <user> in [channel]. "\
|
||||
"If [channel] is blank the bot will ban <user> in "\
|
||||
"the channel the command was used in."
|
||||
inp = inp.split(" ")
|
||||
|
@ -62,7 +62,7 @@ def ban(inp, conn=None, chan=None, notice=None):
|
|||
|
||||
@hook.command(adminonly=True)
|
||||
def unban(inp, conn=None, chan=None, notice=None):
|
||||
".unban [channel] <user> -- Makes the bot unban <user> in [channel]. "\
|
||||
"unban [channel] <user> -- Makes the bot unban <user> in [channel]. "\
|
||||
"If [channel] is blank the bot will unban <user> in "\
|
||||
"the channel the command was used in."
|
||||
inp = inp.split(" ")
|
||||
|
@ -79,7 +79,7 @@ def unban(inp, conn=None, chan=None, notice=None):
|
|||
|
||||
@hook.command(adminonly=True)
|
||||
def kickban(inp, chan=None, conn=None, notice=None):
|
||||
".kickban [channel] <user> [reason] -- Makes the bot kickban <user> in [channel] "\
|
||||
"kickban [channel] <user> [reason] -- Makes the bot kickban <user> in [channel] "\
|
||||
"If [channel] is blank the bot will kickban the <user> in "\
|
||||
"the channel the command was used in."
|
||||
inp = inp.split(" ")
|
||||
|
|
|
@ -53,6 +53,6 @@ def gen_password(types):
|
|||
|
||||
@hook.command
|
||||
def password(inp, notice=None):
|
||||
".password <length> [types] -- Generates a password of <length> (default 10). [types] can include 'alpha', 'no caps', 'numeric', 'symbols' or any combination of the types, eg. 'numbers symbols'"
|
||||
"password <length> [types] -- Generates a password of <length> (default 10). [types] can include 'alpha', 'no caps', 'numeric', 'symbols' or any combination of the types, eg. 'numbers symbols'"
|
||||
password = gen_password(inp)
|
||||
notice(password)
|
||||
|
|
|
@ -9,7 +9,7 @@ ping_regex = re.compile(r"(\d+.\d+)/(\d+.\d+)/(\d+.\d+)/(\d+.\d+)")
|
|||
|
||||
@hook.command
|
||||
def ping(inp, reply=None):
|
||||
".ping <host> [count] -- Pings <host> [count] times."
|
||||
"ping <host> [count] -- Pings <host> [count] times."
|
||||
|
||||
if os.name == "nt":
|
||||
return "Sorry, this command is not supported on Windows systems."
|
||||
|
|
|
@ -7,7 +7,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 <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()):
|
||||
|
|
|
@ -8,7 +8,7 @@ re_lineends = re.compile(r'[\r\n]*')
|
|||
|
||||
@hook.command
|
||||
def python(inp):
|
||||
".python <prog> -- Executes <prog> as Python code."
|
||||
"python <prog> -- Executes <prog> as Python code."
|
||||
|
||||
inp = inp.replace("~n", "\n")
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ def get_quote_by_chan(db, chan, num=False):
|
|||
@hook.command('q')
|
||||
@hook.command
|
||||
def quote(inp, nick='', chan='', db=None, notice=None):
|
||||
".quote [#chan] [nick] [#n]/.quote add <nick> <msg> -- Gets " \
|
||||
"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)
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ def seen_sieve(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 one of this bot's channels."
|
||||
"seen <nick> -- Tell when a nickname was last in active in one of this bot's channels."
|
||||
|
||||
if input.conn.nick.lower() == inp.lower():
|
||||
return "You need to get your eyes checked."
|
||||
|
|
|
@ -7,7 +7,7 @@ from util.web import bitly, ShortenError
|
|||
|
||||
@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:
|
||||
|
|
|
@ -10,7 +10,7 @@ def sloganize(word):
|
|||
|
||||
@hook.command("slogan")
|
||||
def sloganizr(inp, nick=None, say=None, input=None):
|
||||
".slogan <word> -- Makes a slogan for <word>."
|
||||
"slogan <word> -- Makes a slogan for <word>."
|
||||
slogan = sloganize(inp)
|
||||
|
||||
slogan = misc.strip_html(slogan)
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -7,7 +7,7 @@ locale = "en_US"
|
|||
|
||||
@hook.command("spellcheck")
|
||||
def spell(inp):
|
||||
".spell <word> -- Check spelling of <word>."
|
||||
"spell <word> -- Check spelling of <word>."
|
||||
word = inp
|
||||
|
||||
if ' ' in word:
|
||||
|
|
|
@ -5,7 +5,7 @@ from util import hook, http
|
|||
|
||||
@hook.command
|
||||
def stock(inp):
|
||||
".stock <symbol> -- Gets information about stock symbol <symbol>."
|
||||
"stock <symbol> -- Gets information about stock symbol <symbol>."
|
||||
|
||||
url = 'http://www.google.com/ig/api?stock=%s'
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ def convert_kilobytes(kilobytes):
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def system(inp):
|
||||
".system -- Retrieves information about the host system."
|
||||
"system -- Retrieves information about the host system."
|
||||
hostname = platform.node()
|
||||
os = platform.platform()
|
||||
python_imp = platform.python_implementation()
|
||||
|
@ -31,7 +31,7 @@ def system(inp):
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def memory(inp):
|
||||
".memory -- Displays the bot's current memory usage."
|
||||
"memory -- Displays the bot's current memory usage."
|
||||
if os.name == "posix":
|
||||
# get process info
|
||||
status_file = open('/proc/self/status').read()
|
||||
|
@ -63,7 +63,7 @@ def memory(inp):
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def uptime(inp, bot=None):
|
||||
".uptime -- Shows the bot's uptime."
|
||||
"uptime -- Shows the bot's uptime."
|
||||
uptime_raw = round(time.time() - bot.start_time)
|
||||
uptime = timedelta(seconds=uptime_raw)
|
||||
return "Uptime: \x02%s\x02" % uptime
|
||||
|
@ -71,5 +71,5 @@ def uptime(inp, bot=None):
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def pid(inp):
|
||||
".pid -- Prints the bot's PID."
|
||||
"pid -- Prints the bot's PID."
|
||||
return "PID: \x02%s\x02" % os.getpid()
|
||||
|
|
|
@ -50,7 +50,7 @@ def tellinput(paraml, input=None, notice=None, db=None, bot=None, nick=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)
|
||||
|
||||
|
@ -72,7 +72,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:
|
||||
|
|
|
@ -9,7 +9,7 @@ api_url = 'http://api.wolframalpha.com/v2/query?format=plaintext'
|
|||
|
||||
@hook.command("time")
|
||||
def time_command(inp, bot=None):
|
||||
".time <area> -- Gets the time in <area>"
|
||||
"time <area> -- Gets the time in <area>"
|
||||
|
||||
query = "current time in %s" % inp
|
||||
|
||||
|
|
|
@ -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) args -- Manipulates your list of todos."
|
||||
"todo (add|del|list|search) args -- Manipulates your list of todos."
|
||||
|
||||
db_init(db)
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ def get_episode_info(episode, api_key):
|
|||
@hook.command
|
||||
@hook.command('tv')
|
||||
def tv_next(inp, bot=None):
|
||||
".tv <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:
|
||||
|
|
|
@ -47,7 +47,7 @@ def parseDateTime(s):
|
|||
|
||||
@hook.command
|
||||
def twitter(inp):
|
||||
".twitter <user>/<user> <n>/<id>/#<hashtag>/@<user> -- Gets last/<n>th "\
|
||||
"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>."
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ from util import hook, http
|
|||
@hook.command('u')
|
||||
@hook.command
|
||||
def urban(inp):
|
||||
".urban <phrase> [id] -- Looks up <phrase> on urbandictionary.com."
|
||||
"urban <phrase> [id] -- Looks up <phrase> on urbandictionary.com."
|
||||
|
||||
# set a default definition number
|
||||
id = 1
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from util import hook, http, urlnorm
|
||||
rom util import hook, http, urlnorm
|
||||
import re
|
||||
|
||||
titler = re.compile(r'(?si)<title>(.+?)</title>')
|
||||
|
@ -32,5 +32,5 @@ def get_title(url):
|
|||
|
||||
@hook.command
|
||||
def title(inp):
|
||||
".title <url> -- gets the title of a web page"
|
||||
"title <url> -- gets the title of a web page"
|
||||
return get_title(inp)
|
||||
|
|
|
@ -10,7 +10,7 @@ from util import hook, http
|
|||
@hook.command('w3c')
|
||||
@hook.command
|
||||
def validate(inp):
|
||||
".validate <url> -- Runs url through the w3c markup validator."
|
||||
"validate <url> -- Runs url through the w3c markup validator."
|
||||
|
||||
if not inp.startswith('http://'):
|
||||
inp = 'http://' + inp
|
||||
|
|
|
@ -3,7 +3,7 @@ from util import hook, http
|
|||
|
||||
@hook.regex(r'vimeo.com/([0-9]+)')
|
||||
def vimeo_url(match):
|
||||
".vimeo <url> -- returns information on the Vimeo video at <url>"
|
||||
"vimeo <url> -- returns information on the Vimeo video at <url>"
|
||||
info = http.get_json('http://vimeo.com/api/v2/video/%s.json'
|
||||
% match.group(1))
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ with open("plugins/data/kill_bodyparts.txt") as f:
|
|||
|
||||
@hook.command
|
||||
def slap(inp, me=None, nick=None, conn=None, notice=None):
|
||||
".slap <user> -- Makes the bot slap <user>."
|
||||
"slap <user> -- Makes the bot slap <user>."
|
||||
target = inp.lower()
|
||||
|
||||
if not re.match(nick_re, target):
|
||||
|
@ -51,7 +51,7 @@ def slap(inp, me=None, nick=None, conn=None, notice=None):
|
|||
|
||||
@hook.command
|
||||
def lart(inp, me=None, nick=None, conn=None, notice=None):
|
||||
".lart <user> -- LARTs <user>."
|
||||
"lart <user> -- LARTs <user>."
|
||||
target = inp.lower()
|
||||
|
||||
if not re.match(nick_re, target):
|
||||
|
@ -71,7 +71,7 @@ def lart(inp, me=None, nick=None, conn=None, notice=None):
|
|||
|
||||
@hook.command
|
||||
def kill(inp, me=None, nick=None, conn=None, notice=None):
|
||||
".kill <user> -- Makes the bot kill <user>."
|
||||
"kill <user> -- Makes the bot kill <user>."
|
||||
target = inp.lower()
|
||||
|
||||
if not re.match(nick_re, target):
|
||||
|
|
|
@ -9,7 +9,7 @@ def fahrenheit_to_celcius(f):
|
|||
@hook.command(autohelp=False)
|
||||
def forecast(inp, nick='', server='',
|
||||
reply=None, db=None, notice=None, say=None):
|
||||
".forecast <location> [dontsave] -- Gets a weather forecast" \
|
||||
"forecast <location> [dontsave] -- Gets a weather forecast" \
|
||||
" for <location> from Google."
|
||||
loc = inp
|
||||
|
||||
|
@ -52,7 +52,7 @@ def forecast(inp, nick='', server='',
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def weather(inp, nick='', server='', reply=None, db=None, notice=None):
|
||||
".weather <location> [dontsave] -- Gets weather data"\
|
||||
"weather <location> [dontsave] -- Gets weather data"\
|
||||
" for <location> from Google."
|
||||
loc = inp
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ from util import pywhois, hook
|
|||
|
||||
@hook.command
|
||||
def whois(inp, say=None):
|
||||
".whois <domain> -- Look up ownership infomation for <domain>"
|
||||
"whois <domain> -- Look up ownership infomation for <domain>"
|
||||
try:
|
||||
w = pywhois.whois(inp)
|
||||
except:
|
||||
|
|
|
@ -16,7 +16,7 @@ paren_re = re.compile('\s*\(.*\)$')
|
|||
@hook.command('w')
|
||||
@hook.command
|
||||
def wiki(inp):
|
||||
".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)
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ from util.text import truncate_words
|
|||
@hook.command('wa')
|
||||
@hook.command
|
||||
def wolframalpha(inp, bot=None):
|
||||
".wa <query> -- Computes <query> using Wolfram Alpha."
|
||||
"wa <query> -- Computes <query> using Wolfram Alpha."
|
||||
|
||||
api_key = bot.config.get("api_keys", {}).get("wolframalpha", None)
|
||||
bitly_user = bot.config.get("api_keys", {}).get("bitly_user", None)
|
||||
|
|
|
@ -5,7 +5,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)
|
||||
|
|
|
@ -70,7 +70,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)
|
||||
|
||||
|
|
Reference in a new issue