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