code: async def part(self, channel, message=None):
          
          if not self.in_channel(channel):
              raise NotInChannel(channel)
  
          # Message seems to be an extension to the spec.
          if message:
              await self.rawmsg('PART', channel, message)
          else:
              await self.rawmsg('PART', channel)
docs: Leave channel, optionally with message.