remove broken .quotedelete

This commit is contained in:
Ryan Hitchman 2011-01-16 06:42:20 -07:00
parent 2171ebd72f
commit 4ea7cb5a46
1 changed files with 0 additions and 45 deletions

View File

@ -95,48 +95,3 @@ def quote(inp, nick='', chan='', db=None):
selected_quote = quotes[num - 1]
return format_quote(selected_quote, num, n_quotes)
@hook.command('qdel', adminonly=True)
@hook.command
def quotedelete:
".qdel/.quotedelete [#chan] [nick] <#n>/.quote add <nick> <msg> -- deletes " \
"<#n>th quote by <nick> or from <#chan> (adminonly)"
retrieve = re.match(r"(\S+)(?:\s+#?(-?\d+))?$", inp)
retrieve_chan = re.match(r"(#\S+)\s+(\S+)(?:\s+#?(-?\d+))?$", inp)
if retrieve:
select, num = retrieve.groups()
by_chan = False
if select.startswith('#'):
by_chan = True
quotes = get_quotes_by_chan(db, select)
else:
quotes = get_quotes_by_nick(db, chan, select)
elif retrieve_chan:
chan, nick, num = retrieve_chan.groups()
quotes = get_quotes_by_nick(db, chan, nick)
else:
return quote.__doc__
n_quotes = len(quotes)
if not n_quotes:
return "no quotes found"
num = int(num)
if num > n_quotes or (num < 0 and num < -n_quotes):
return "I only have %d quote%s for %s" % (n_quotes,
('s', '')[n_quotes == 1], select)
elif num < 0:
selected_quote = quotes[num]
num = n_quotes + num + 1
else:
selected_quote = quotes[num - 1]
return format_quote(selected_quote, num, n_quotes)