EmacsChannelMaintenance

Page http://freenode.net/using_the_network.html lists the available modes on the FreeNode network.

Typical /topic pattern optimizing for newbies (link first):

/topic See http://emacswiki.org/emacs/EmacsChannel for tips, code of conduct | Go ahead and ask your Emacs question | Treat people with respect. No sexism, racism, homophobia, or discrimination of any kind. | No public logging

Typical /topic pattern optimizing for the amusement of regulars (quote first):

/topic quote | See http://emacswiki.org/emacs/EmacsChannel for tips, code of conduct | Go ahead and ask your Emacs question | Treat people with respect. No sexism, racism, homophobia, or discrimination of any kind. | No public logging

Dealing with violations of the code of conduct

Here are some options:

Quiet the user

They can stay in channel, but they can’t say anything.

/mode #emacs +q nick

Kick the user

/kick nick

Ban returning rude people by hostname

/mode #emacs +b *!user@hostname

IRC commands

See access list

/msg ChanServ access #emacs list

Check what the levels mean:

/msg chanserv level #emacs list

Modify access list

Add only the nicks of identified users.

/msg ChanServ access #emacs add noob 10

ERC Commands

You may also want to check out https://github.com/jwiegley/dot-emacs/blob/master/lisp/erc-macros.el for ideas.

Easy op/deop

(defun erc-cmd-OPME ()
  "Request chanserv to op me."
  (erc-message "PRIVMSG"
               (format "chanserv op %s %s"
                       (erc-default-target)
                       (erc-current-nick)) nil))

(defun erc-cmd-DEOPME ()
  "Deop myself from current channel."
  (erc-cmd-DEOP (format "%s" (erc-current-nick))))

Ban, kickban

(defun erc-cmd-BAN (nick)
  (let* ((chan (erc-default-target))
         (who (erc-get-server-user nick))
         (host (erc-server-user-host who))
         (user (erc-server-user-login who)))
    (erc-send-command (format "MODE %s +b *!%s@%s" chan user host))))

(defun erc-cmd-KICKBAN (nick &rest reason)
  (setq reason (mapconcat #'identity reason " "))
  (and (string= reason "")
       (setq reason nil))
  (erc-cmd-BAN nick)
  (erc-send-command (format "KICK %s %s %s"
                            (erc-default-target)
                            nick
                            (or reason
                                "Kicked (kickban)"))))

Make people quiet

They can stay in channel, but they can’t say anything. Source

(defun erc-cmd-QUIET (nick)
  (erc-cmd-OPME)
  (sleep-for 0 250)
  (erc-send-command (format "QUIET %s %s"
                            (erc-default-target)
                            nick))
  (sleep-for 0 250)
  (erc-cmd-DEOPME))

Kick/ban based on IP address

Source

(defun erc-cmd-KICKBANIP (nick &rest reason)
  (setq reason (mapconcat #'identity reason " "))
  (and (string= reason "")
       (setq reason nil))
  (erc-cmd-OPME)
  (sleep-for 0 250)
  (erc-cmd-BAN nick nil t)
  (erc-send-command (format "KICK %s %s %s"
                            (erc-default-target)
                            nick
                            (or reason
                                "Kicked (kickbanip)")))
  (sleep-for 0 250)
  (erc-cmd-DEOPME))

Circe commands

https://github.com/jorgenschaefer/Config/blob/master/emacs.el#L886-L914

  (defun circe-command-AKICK (args)
    "Kick a user from the current channel using ChanServ.

Example uses:

/akick someidiot Get lost
- Kick someidiot with the message 'Get lost' for 30 minutes
/akick someidiot !T 15 Try again later
- Kick someidiot with the message 'Try again later' for 15 minutes"
    (cond
     ((string-match "!T" args)
      (circe-command-MSG "ChanServ"
                         (format "AKICK %s ADD %s"
                                 circe-chat-target
                                 args)))
     ((string-match "^ *\\([^ ]+\\) \\([0-9]+\\) \\(.*\\)" args)
      (circe-command-MSG "ChanServ"
                         (format "AKICK %s ADD %s !T %s %s"
                                 circe-chat-target
                                 (match-string 1 args)
                                 (match-string 2 args)
                                 (match-string 3 args))))
     ((string-match "^ *\\([^ ]+\\) \\(.*\\)" args)
      (circe-command-MSG "ChanServ"
                         (format "AKICK %s ADD %s !T %s %s"
                                 circe-chat-target
                                 (match-string 1 args)
                                 "30"
                                 (match-string 2 args))))))

EmacsChannel