<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def join(self, new_channel, nick, pwd=None):
 """Joins a new channel. Keyword arguments: new_channel: <str>; the channel to connect to nick: <str>; the nickname to use pwd: <str>; the (optional) password to use """

        self._send_packet({"cmd": "join", "channel": new_channel,
                           "nick": self._format_nick(nick, pwd)})