From 9b6c53b3724f876d5d497c717e8903c17a35dbf4 Mon Sep 17 00:00:00 2001 From: weasel Date: Thu, 6 Jun 2019 13:52:12 +0100 Subject: [PATCH] =?UTF-8?q?Adicionada=20informa=C3=A7=C3=A3o=20para=20aced?= =?UTF-8?q?er=20aos=20pr=C3=B3ximos=20resultados=20caso=20exista=20mais=20?= =?UTF-8?q?que=20um?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Priberam/plugin.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Priberam/plugin.py b/Priberam/plugin.py index 3d30547..693c77d 100644 --- a/Priberam/plugin.py +++ b/Priberam/plugin.py @@ -68,6 +68,20 @@ class Priberam(callbacks.Plugin): return definitions = soup.find('div', {'id': 'resultados'}).find_all('p') + if (len(definitions) > 1): + if (position < len(definitions)): + nextPos = position + 1 + splitStr = str(msg).split() + commandUsed = splitStr[3] + count = 4 + while (count < len(splitStr)): + if (splitStr[count].strip('\n') == word): + break + else: + commandUsed = commandUsed + ' ' + splitStr[count] + count += 1 + outputResultados = ("{0} definições encontradas; {1} {2} {3} para a próxima").format(len(definitions), commandUsed[1:], word, nextPos) + irc.reply(outputResultados, prefixNick=False) if position > len(definitions): return -- 2.40.1