Implement counting keyword events and a unified buffers system for when the master channel is unavailable

This commit is contained in:
2018-03-04 17:25:57 +00:00
parent eae4315562
commit da6c45f093
16 changed files with 60 additions and 19 deletions

View File

@@ -160,6 +160,10 @@ class IRCBot(IRCClient):
self.channels.append(channel)
self.who(channel).addCallback(self.got_who)
count.event(self.name, "selfjoin")
if self.name == config["Master"][0] and channel == config["Master"][1]:
for i in range(len(masterbuf)):
self.msg(channel, masterbuf.pop(0))
saveConf("masterbuf")
def left(self, channel):
if channel in self.channels:

View File

@@ -1,4 +1,5 @@
from json import load, dump, loads
from utils.loaders.command_loader import loadCommands
from utils.logging.log import *
@@ -12,11 +13,9 @@ filemap = {
"help": ["help.json", "command help"],
"wholist": ["wholist.json", "WHO lists"],
"counters": ["counters.json", "counters file"],
"masterbuf": ["masterbuf.json", "master buffer"],
}
numbers = "0123456789"
listener = None
connections = {}
IRCPool = {}
ReactorPool = {}