Skip to content

Connection Commands

Set a connection password before registering.

Syntax: PASS <password>

When: Must be sent before NICK and USER if the server requires a password.

Behavior:

  • The password is checked during the handshake when registration completes
  • If the server has no password configured (password: nil), any PASS value is accepted
  • If the password does not match, the connection is closed with ERROR :Bad Password

Example:

PASS serverpassword

Set or change your nickname.

Syntax: NICK <nickname>

Constraints:

  • Maximum length: 30 characters (configurable via max_nick_length)
  • Must not be in use by another connected user
  • Cannot be a reserved nickname (in reservation period after RECOVER/REGAIN)
  • Comparison is case-insensitive using the server’s case mapping

Behavior:

  • During pre-registration: sets the nick for the upcoming handshake
  • After registration: changes your current nick; broadcasts the change to all shared channels and users

Example:

NICK Alice
NICK Alice_Away

Errors:

  • 433 ERR_NICKNAMEINUSE — nick is already taken
  • 432 ERR_ERRONEUSNICKNAME — invalid nick format
  • 484 ERR_NICKNAMEINUSE — nick is reserved (custom error)

Provide your username, hostname hints, and real name during registration.

Syntax: USER <username> <hostname> <servername> :<realname>

Fields:

FieldUsageLimit
usernameident/username10 chars (max_ident_length)
hostnameignored (server resolves it)
servernameignored
realnamereal name (GECOS)50 chars (max_realname_length)

Example:

USER alice 0 * :Alice Wonderland

Test whether the connection is still alive. Clients typically send this to the server.

Syntax: PING <token>

Behavior:

  • The server responds immediately with PONG :<token>
  • Also resets the user’s inactivity timer

Example:

PING LAG1234567890

Server response:

:server.hostname PONG server.hostname :LAG1234567890

Reply to a server-initiated PING. The server sends PING to clients to check liveness.

Syntax: PONG <token>

Behavior:

  • Resets the user’s inactivity timer
  • No visible response from the server

Disconnect from the server gracefully.

Syntax: QUIT [:<message>]

Behavior:

  • Broadcasts a QUIT message to all channels the user is in
  • The user’s information is saved to WHOWAS history
  • The connection is closed

Example:

QUIT :Going to sleep
QUIT :Goodbye!

The quit message appears to other users as:

* Alice has quit (Going to sleep)