Add Private Comment via custom function

Add Private Comment via custom function

We want to use a Supervise rule to input a public comment on a ticket after certain days of inactivity. Can you please help provide with the code to create and input a public comment on a ticket?