diff --git a/plugins/quote.py b/plugins/quote.py index e42b0ad..bdb93ab 100644 --- a/plugins/quote.py +++ b/plugins/quote.py @@ -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 -- deletes " \ - "<#n>th quote by 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) -