feat(bot): rend le refresh plus discret

This commit is contained in:
François Poulain 2020-05-01 11:08:14 +02:00
parent b2f8a75616
commit fd0f995aca

View File

@ -259,19 +259,7 @@ class IcingaBot(Icinga2ServiceManager, irc.bot.SingleServerIRCBot):
self.suffix_nick("[{}]".format(len(self.notifications))) self.suffix_nick("[{}]".format(len(self.notifications)))
else: else:
self.suffix_nick("") self.suffix_nick("")
for srv in lost: return
if srv is not None:
self.send("{} is OK".format(srv["name"]))
for srv in news:
try:
self.send(
"{}: => {}".format(
srv["name"],
srv["attrs"]["last_check_result"]["output"],
)
)
except Exception:
self.send("{}: => No check result.".format(srv["name"]))
def on_nicknameinuse(self, c, e): def on_nicknameinuse(self, c, e):
c.nick(+"_") c.nick(+"_")