Simplificar output, assim fica so uma linha.
This commit is contained in:
parent
2680f4be03
commit
1663c8a9fc
|
@ -48,8 +48,10 @@ class Maria(callbacks.Plugin):
|
|||
self.__parent = super(Maria, self)
|
||||
self.__parent.__init__(irc)
|
||||
|
||||
def __format_message(self, data):
|
||||
return "{} - #{} - {} [{}]".format(
|
||||
def __format_message(self, data, position):
|
||||
return "[{}/{}] {} - #{} - {} [{}]".format(
|
||||
data['next'] - 1 if data['next'] > 0 else 1,
|
||||
data['total'],
|
||||
data['message']['text'],
|
||||
data['message']['user'],
|
||||
data['message']['datetime'],
|
||||
|
@ -67,13 +69,7 @@ class Maria(callbacks.Plugin):
|
|||
Returns the last message, or last + position.
|
||||
"""
|
||||
data = self.__do_request('latest', {'position': position})
|
||||
|
||||
if data['next'] > 0:
|
||||
irc.reply("{} found 'maria latest {}' for the next one".format(
|
||||
data['total'],
|
||||
data['next']
|
||||
), prefixNick=False)
|
||||
irc.reply(self.__format_message(data), prefixNick=False)
|
||||
irc.reply(self.__format_message(data, position), prefixNick=False)
|
||||
latest = wrap(latest, [optional('int', default=0)])
|
||||
|
||||
def find(self, irc, msg, args, text, position):
|
||||
|
@ -91,13 +87,7 @@ class Maria(callbacks.Plugin):
|
|||
irc.reply(data['error'], prefixNick=False)
|
||||
return
|
||||
|
||||
if data['next'] > 0:
|
||||
irc.reply("{} found. 'maria find {} {}' for the next one".format(
|
||||
data['total'],
|
||||
text,
|
||||
data['next']
|
||||
), prefixNick=False)
|
||||
irc.reply(self.__format_message(data), prefixNick=False)
|
||||
irc.reply(self.__format_message(data, position), prefixNick=False)
|
||||
find = wrap(find, ['anything', optional('int', default=0)])
|
||||
|
||||
def random(self, irc, msg, args):
|
||||
|
|
Loading…
Reference in New Issue