diff --git a/pydle/client.py b/pydle/client.py index 16a0705..92ffecf 100644 --- a/pydle/client.py +++ b/pydle/client.py @@ -272,10 +272,7 @@ class BasicClient: del self.users[nickname] def _format_hostmask(self, nickname): - if nickname not in self.users: - raise KeyError('Unknown user "{usr}".'.format(usr=nickname)) - - user = self.users[nickname] + user = self.users.get(nickname, {"username": "*", "hostname": "*"}) return '{n}!{u}@{h}'.format(n=nickname, u=user['username'] or '*', h=user['hostname'] or '*') @@ -914,6 +911,11 @@ class BasicClient: # MOTD is done, let's tell our bot the connection is ready. self.on_connect() + def on_raw_422(self, message): + """ MOTD is missing. """ + self.motd = None + self.on_connect() + def on_raw_421(self, message): """ Server responded with 'unknown command'. """ self.logger.warn('Server responded with "Unknown command: {}"'.format(message.params[0])) diff --git a/pydle/features/ircv3_1.py b/pydle/features/ircv3_1.py index b73e712..43c0606 100644 --- a/pydle/features/ircv3_1.py +++ b/pydle/features/ircv3_1.py @@ -83,7 +83,7 @@ class IRCv3_1Support(sasl.SASLSupport, tls.TLSSupport): self._sync_user(nick, user, host) # Emit a fake join message. - fakemsg = self._construct_message('JOIN', channels, source=message.source) + fakemsg = self._create_message('JOIN', channels, source=message.source) super().on_raw_join(fakemsg) if account == NO_ACCOUNT: