def publicCommands(sock, line): caught = False botConfig = botCore.readConfig() if (line[3] == ":&knox"): caught = True botExtra.knox(sock, line) elif (line[3] == ":&witch"): caught = True if (line[2] == botConfig.get('Bot', 'bot_nickname')): botCore.sendLine(sock, getUsername(line), "This command is only functional if sent in a CHANNEL.") else: botExtra.witch(sock, line) return caught
'''Created on 05/08/2012''' '''Last Modified on 06/08/2012''' '''Version 0.1.3''' '''@author: Rebecca Miyamoto''' import botCore, botStandard, string, time #Read the config file botConfig = botCore.readConfig() #Create the sock and connect sock = botCore.connect(botConfig) while True: #Create, receive to and read from the buffer readBuffer = botCore.readBuffer(sock) for line in readBuffer: #Do some formatting line = botCore.formatLine(line) #Output the line to the console if not empty if not (line == []): botCore.consoleOutputLine(sock, line) if (len(line) >= 1): #Handler for NickServ identification and ajoining channels for x in range(0, len(line)): if (line[x] == "/MOTD"):