display channel count in the privmsg report

This commit is contained in:
Brian S. Stephan 2021-05-05 08:42:23 -05:00
parent b21421a395
commit 0b3386e183
1 changed files with 4 additions and 2 deletions

View File

@ -93,19 +93,21 @@ class History(Plugin):
logger.debug("<%s> %s is asking for an update", who, most_specific_message(event))
if event.in_privmsg:
total_history = []
channel_count = 0
for channel in self.channel_leave_points.keys():
logger.debug("checking history slice for %s", channel)
total_history += self._missed_slice(channel, who)
logger.debug("total history so far: %s", total_history)
channel_count += 1
logger.debug("final missed history: %s", total_history)
self._send_history(who, total_history)
self.bot.reply(event, f"{len(total_history)} lines")
self.bot.reply(event, f"{len(total_history)} line(s) over {channel_count} channel(s)")
return 'NO MORE'
else:
where = event.target
history = self._missed_slice(where, who)
self._send_history(who, history)
self.bot.reply(event, f"{len(history)} lines (PRIVMSGed)")
self.bot.reply(event, f"{len(history)} line(s) (PRIVMSGed)")
return 'NO MORE'
def _send_history(self, who, history):