diff --git a/IRCChannel.py b/IRCChannel.py index f48f9d96..14de133f 100644 --- a/IRCChannel.py +++ b/IRCChannel.py @@ -1,7 +1,9 @@ +import uuid import IRCLog class Channel(object): def __init__(self, name, server, bot): + self.id = uuid.uuid1().hex self.name = name.lower() self.server = server self.bot = bot diff --git a/IRCUser.py b/IRCUser.py index ea2ac538..0d44fbe9 100644 --- a/IRCUser.py +++ b/IRCUser.py @@ -3,6 +3,7 @@ import IRCLog class User(object): def __init__(self, nickname, server, bot): + self.id = uuid.uuid1().hex self.set_nickname(nickname) self.username = None self.hostname = None @@ -10,8 +11,6 @@ class User(object): self.bot = bot self.channels = set([]) self.id = None - while self.id == None or self.id in server.users: - self.id = uuid.uuid1().hex self.log = IRCLog.Log(bot) def set_nickname(self, nickname): self.nickname = nickname