Code
; Oper Tools for TheArkNet
; by Raccoon 2019

; This script assumes that opers are not subject to excess flood disconnect.
; You can access this tool from menu by right-clicking the channel chat area.
; Actions are logged to operclosechan.log
; Example: /operclosechan #badchan You guys are misbehaving!

; /OperCloseChan <#channel_name> <reason_required>
ALIAS OperCloseChan {
  var %chan = $1, %reason = $2-
  if (!%chan) { echo -atic notice * Usage: /OperCloseChan #channel_name This channel is closed due to violation. | return }
  if (!%reason) { echo 4 -ati * OperCloseChan: You MUST specify a reason for closing the channel! | return }
  if ($left(%chan,1) !isin $chantypes) { echo 4 -ati * OperCloseChan: %chan is an invalid channel name! | return }
  if ($me !ison %chan) {
    set -eu10 %_operclosechan. $+ %chan %reason
    !JOIN %chan
    return
  }
  ; -----
  
  MSG %chan This channel has been determined to be in violation of the terms of service for this network and is being closed. $&
    If you have any questions please join #Help and speak to an IRCop.  (Reason: %reason $+ )
  CS CLEAR %chan USERS
  CS CLEAR %chan BANS
  CS DROP %chan %chan
  MODE %chan +muski $regsubex(randomstring,$str(x,10),/x/g,$r(a,z))
  PART %chan
  echo -stic info * OperCloseChan: Closed channel %chan for %reason
  write operclosechan.log $asctime %chan %reason
  
} ; by Raccoon 2019


; End of /NAMES (you joined a channel)
RAW 366:*: {
  var %chan = $2
  if ($($+(%,_operclosechan.,%chan),2)) {
    unset $+(%,_operclosechan.,%chan)
    OperCloseChan %chan $v1
  }
  ; ...
} ; by Raccoon 2019


MENU Channel {
  -
  Oper Tools
  .Close Channel: {
    OperCloseChan $&
      $$input(Enter channel to permanently close.,ews,$active,Oper Tools: Close Channel,$active) $&
      $$input(Enter reason for closing the channel.,ews,$active,Oper Tools: Close Channel)
  }
  ;...
}
; by Raccoon 2019

; eof


Well. At least I won lunch.
Good philosophy, see good in bad, I like!