Remove unnecessary uuid protection for IRCUser, add uuid for IRCChannel
This commit is contained in:
parent
6105c8e6e3
commit
fd80393e38
2 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue