Closed sbraz closed 8 years ago
Looking at the place where the key error is occurring, I see this method:
def _on_join(self, c, e):
ch = e.target
nick = e.source.nick
if nick == c.get_nickname():
self.channels[ch] = Channel()
self.channels[ch].add_user(nick)
So it looks like the code is using nick == self.get_nickname()
to determine if this is self joining the channel (in which case it adds the channel to the dict of channel nicks) or someone else. However, because you've set your nick to '', the join message for yourself looks like someone else joining... and you've never joined.
What should happen here? Should the bot handle '' as a special nick? Should it somehow set the nickname based on the events from the server? Should it store users in a channel without regard for which nick is self? I don't think it can do that and accurately keep track of which channels the bot is in.
I think we could rely on real_nickname
instead?
Hmm nevermind, it seems this what get_nickname()
does…
Feel free to re-open if you have any other ideas.
Hi, Since I use ZNC as a bouncer, I set nick to
""
which causes a crash when I start a SingleServerIRCBot:Here is a test script that triggers the crash: