Exemplo n.º 1
0
 def __init__(self):
     self.l = logger.logs("messageFilter")
     fileIO.checkFolder("config{0}messageFilter{0}".format(os.sep),
                        "messageFilter", self.l)
     fileIO.checkFile(
         "config-example{0}messageFilter{0}config.json".format(os.sep),
         "config{0}messageFilter{0}config.json".format(os.sep),
         "config.json", self.l)
     self.filter = fileIO.loadConf(
         "config{0}messageFilter{0}config.json")["Message Filter"]
     pass
Exemplo n.º 2
0
 def __init__(self):
     self.l = logger.logs("ChatLog")
     self.l.logger.info("Starting")
     config.events.onMessage += self.logMessage
     self.l.logger.info("Started")
     fileIO.checkFolder("config{0}chatLog{0}".format(os.sep), "logRules",
                        self.l)
     fileIO.checkFile(
         "config-example{0}chatLog{0}logRules.json".format(os.sep),
         "config{0}chatLog{0}logRules.json".format(os.sep), "logRules.json",
         self.l)
     self.chatLogRules = fileIO.loadConf("config{0}chatLog{0}logRules.json")
Exemplo n.º 3
0
    def __init__(self):
        self.l = logger.logs("Console")
        fileIO.checkFolder("config{0}console{0}".format(os.sep), "console",
                           self.l)
        fileIO.checkFile(
            "config-example{0}console{0}console.json".format(os.sep),
            "config{0}console{0}console.json".format(os.sep), "console.json",
            self.l)
        file = fileIO.loadConf("config{0}console{0}console.json")

        self.consoleOutputs = file["Consoles"]

        super().__init__()
Exemplo n.º 4
0
 def __init__(self):
     fileIO.checkFolder("config{0}auth{0}".format(os.sep), "auth", l)
     fileIO.checkFile("config-example{0}auth{0}discord.json".format(os.sep),
                      "config{0}auth{0}discord.json".format(os.sep),
                      "discord.json", l)
     config.c.discordToken = fileIO.loadConf(
         "config{0}auth{0}discord.json")["Token"]
     config.c.discordEnabled = fileIO.loadConf(
         "config{0}auth{0}discord.json")["Enabled"]
     config.events.onMessageSend += self.discordSendMsg
     config.events.deleteMessage += self.delete_message
     config.events.onMessageSend += self.discordSendWebhook
     config.events.onMessageSend += self.discordSendPrivMsg
Exemplo n.º 5
0
    def __init__(self):
        self.l = logger.logs("Chatbot")
        self.l.logger.info("Starting")
        config.events.onMessage += self.sortMessage
        self.l.logger.info("Started")
        fileIO.checkFolder("config{0}chatbot{0}".format(os.sep), "chatbot",
                           self.l)
        fileIO.checkFile(
            "config-example{0}chatbot{0}chatbot.json".format(os.sep),
            "config{0}chatbot{0}chatbot.json".format(os.sep), "chatbot.json",
            self.l)
        self.chatbot = fileIO.loadConf("config{0}chatbot{0}chatbot.json")

        self.legacyConverts()
Exemplo n.º 6
0
    def __init__(self):
        self.messagepattern = re.compile(r"^:(.{1,50})!")
        #variables.config = __main__.variables.config
        self.l = logger.logs("IRC")
        fileIO.checkFolder("config{0}auth{0}".format(os.sep), "auth", self.l)
        fileIO.checkFile("config-example{0}auth{0}irc.json".format(os.sep),
                         "config{0}auth{0}irc.json".format(os.sep), "irc.json",
                         self.l)
        config.c.irc = fileIO.loadConf("config{0}auth{0}irc.json")

        self.l.logger.info("Starting")
        self.serviceStarted = {}
        config.events.onMessageSend += self.sendMSG
        self.writer = {}
        self.reader = {}
        self.emoteObjects = []  #this should be just plain emote objects
        self.msgHandlerTasks = {}
        self.hostNicknames = {}  #{host: nickname}
Exemplo n.º 7
0
    def __init__(self):
        self.pageToken = ""
        self.youtube = ""
        self.serviceStarted = False
        self.secretsFilePath = "config{0}auth{0}client_secrets.json".format(os.sep)
        self.oauthFilePath = "config{0}auth{0}oauth.json".format(os.sep)
        self.l = logger.logs("Youtube")
        fileIO.checkFolder("config{0}auth{0}".format(os.sep),"auth",self.l)
        fileIO.checkFile("config-example{0}auth{0}youtube.json".format(os.sep),"config{0}auth{0}youtube.json".format(os.sep),"youtube.json",self.l)
        self.enabled = fileIO.loadConf("config{0}auth{0}youtube.json")["Enabled"]
        self.pageToken = fileIO.loadConf("config{0}auth{0}youtube.json")["pageToken"]
        self.oldMessageList = [] #keeps track of old messages to filter out
        self.messageFrequency = 0

        if (self.enabled):
            secretsExist = self.checkFile(self.secretsFilePath,"client_secrets.json",self.l)
            self.msgCheckList = fileIO.loadConf("config{0}auth{0}youtube.json")["selfMsgFilter"]
            if (secretsExist):
                self.l.logger.info("Starting")
                self.initAuth()
                config.events.onMessageSend += self.sendLiveChat
            else:
                self.l.logger.info("Please make sure the oauth and client secret files exist")
Exemplo n.º 8
0
    async def sendMessage(self, message, objDeliveryDetails,
                          formattingSettings):  #sends the message
        formatType = "MutedOther"
        FormattingOptions = {"%message%": "message"}

        objSendMsg = Object.ObjectLayout.sendMsgDeliveryDetails(
            Message=message,
            DeliveryDetails=objDeliveryDetails,
            FormattingOptions=FormattingOptions,
            formattingSettings=formattingSettings,
            formatType=formatType,
            messageUnchanged=message
        )  #prepares the delivery object and sends the message send event
        config.events.onMessageSend(sndMessage=objSendMsg)


l = logger.logs("Console")
fileIO.checkFolder("config{0}console{0}".format(os.sep), "console", l)
fileIO.checkFile("config-example{0}console{0}console.json".format(os.sep),
                 "config{0}console{0}console.json".format(os.sep),
                 "console.json", l)
file = fileIO.loadConf("config{0}console{0}console.json")

if (not 'Enabled' in file):
    file.update({"Enabled": False})
    fileIO.fileSave("config{0}console{0}console.json".format(os.sep), file)

if file["Enabled"] == True:
    logger.loggerHandlers.add_Logging_Handler(console())
    print("Attaching console")