from IRCMessage import IRCMessage from IRCResponse import IRCResponse, ResponseType from Function import Function from GlobalVars import * from enumType import enum TargetTypes = enum('CHANNEL', 'USER') class UserStruct: Hostmask = '' Name = '' User = '' def __init__(self, dct): self.__dict__ = dct class FakeIRCMessage: User = UserStruct({'User': '', 'Name': '', 'Hostmask': ''}) TargetType = TargetTypes.CHANNEL Type = '' ReplyTo = '' MessageList = [] MessageString = "<Jimmy> ducttape minecraft!" RawMessage = '' CTCP = False CTCPString = '' Parameters = '' ParameterList = ['wat']
from IRCMessage import IRCMessage from IRCResponse import IRCResponse, ResponseType from Function import Function from GlobalVars import * from enumType import enum TargetTypes = enum('CHANNEL', 'USER') class UserStruct: Hostmask = '' Name = '' User = '' def __init__(self, dct): self.__dict__ = dct class FakeIRCMessage: User = UserStruct({'User':'','Name':'','Hostmask':''}) TargetType = TargetTypes.CHANNEL Type = '' ReplyTo = '' MessageList = [] MessageString = "<Jimmy> ducttape minecraft!" RawMessage = '' CTCP = False CTCPString = '' Parameters = '' ParameterList = ['wat'] Command = 'responses'
from enumType import enum ResponseType = enum('Say', 'Do', 'Notice', 'Raw') class IRCResponse(object): def __init__(self, messageType, response, target): self.Type = messageType try: self.Response = unicode(response, 'utf-8') except TypeError: # Already utf-8? self.Response = response self.Target = target
from enumType import enum ResponseType = enum('Say', 'Do', 'Notice', 'Raw') class IRCResponse: def __init__(self, messageType, response, target): self.Type = messageType self.Response = response self.Target = target
from enumType import enum ResponseType = enum("Say", "Do", "Notice", "Raw") class IRCResponse: def __init__(self, messageType, response, target): self.Type = messageType try: self.Response = unicode(response, "utf-8") except TypeError: # Already utf-8? self.Response = response self.Target = target