code: def do_part(self, cmdargs, nick, target, msgtype, send, c):
          
          channel = self.config['core']['channel']
          botnick = self.config['core']['nick']
          if not cmdargs:
              # don't leave the primary channel
              if target == channel:
                  send("%s must have a home." % botnick)
                  return
              else:
                  cmdargs = target
          if not cmdargs.startswith(('#', '+', '@')):
              cmdargs = '#' + cmdargs
          # don't leave the primary channel
          if cmdargs == channel:
              send("%s must have a home." % botnick)
              return
          # don't leave the control channel
          if cmdargs == self.config['core']['ctrlchan']:
              send("%s must remain under control, or bad things will happen." % botnick)
              return
          self.send(cmdargs, nick, "Leaving at the request of %s" % nick, msgtype)
          c.part(cmdargs)
docs: Leaves a channel.
  
          Prevent user from leaving the primary channel.