This snipped sets the default IRC server, port and nickname for user.

(defun wenshan-erc ()
  "Log into FreeNode"
  (interactive)
  (let
      ((password-cache nil))
    (erc
     :server "irc.freenode.net"
     :port "6667"
     :nick "YourNick"
     :password (password-read (format "Password FreeNode")))))

My site is free of ads and trackers. Was this post helpful to you? Why not BuyMeACoffee