Skip to content

IRC Channel

Abrar edited this page Jan 16, 2023 · 2 revisions

In Internet Relay Chat (IRC), a channel is a virtual meeting place where users can communicate with each other in real-time. Users can join channels by sending a command to the IRC server, and once they are in a channel, they can send messages to everyone else in the channel. Channels are identified by a name that begins with a "#" symbol, such as "#examplechannel". They are used for group discussions of specific topics, and can be moderated by designated users called channel operators.

image

Channel communication

The PRIVMSG command is used in IRC to send a private message to a specific user or to send a message to a channel. To send a message to a channel, the command is typically used in the following format:

PRIVMSG #channelname :message

Where #channelname is the name of the channel you want to send the message to, and "message" is the text of the message you want to send.

When a user sends a PRIVMSG command to a channel, the server receives the command and checks to see if the channel specified in the command exists. If the channel does exist, the server then checks to see if the user is currently a member of the channel. If the user is a member, the server will then forward the message to all other users in the channel.

The message is then broadcasted to every user in the channel, and each user's client will display the message in the channel's chat window. The message will be shown as sent by the user who sent the PRIVMSG command.

Channel general command

The JOIN command is used in IRC to join a specific channel. The command is typically used in the following format:

JOIN #channelname

Where #channelname is the name of the channel you want to join. Once a user joins a channel, they will be able to see and participate in the conversation in that channel.

The PART command is used to leave a specific channel. The command is typically used in the following format:

PART #channelname

Where #channelname is the name of the channel you want to leave. Once a user parts a channel, they will no longer be able to see or participate in the conversation in that channel.

When a server receives a JOIN command, it will add the user to the list of users in the specified channel. If the channel does not exist, the server may create the channel. Once the user is added to the channel, the server will broadcast a message to all users in the channel to let them know that a new user has joined.

When a server receives a PART command, it will remove the user from the list of users in the specified channel. Once the user is removed from the channel, the server will broadcast a message to all users in the channel to let them know that a user has left.

Channel operator command

A channel operator is a user on an Internet Relay Chat (IRC) channel who has been granted additional privileges to manage and moderate the channel. Channel operators have the ability to set and enforce rules, kick or ban users from the channel, and perform other tasks to keep the channel running smoothly.

  • KICK: Kick a user from a channel.
  • MODE: Set or modify the modes of a channel or user
  • TOPIC: Change the channel topic in a mode +t channel
  • INVITE: Invite a client to an invite-only channel (mode +i)
  • PRIVMSG: Sending messages to the channel (mode +m, +v)

The first operator of a channel is typically the user who created the channel, also known as the channel founder. This user is automatically granted operator status when the channel is created.

To become a channel operator, a user must typically be granted operator status by the current channel operator or by the channel founder. This is done by using the MODE command to grant operator status to the desired user.

It's worth noting that channel operator status is specific to each individual channel and does not carry over to other channels. A user who is an operator on one channel may not be an operator on another channel.

Modes

The MODE command in Internet Relay Chat (IRC) is used to change the settings or attributes of a user or a channel. The basic format of the command is:

/mode [target] [mode] [parameter(s)]

The target can be either a user or a channel, depending on the mode being set. For example, to set a mode for a user, the target would be the user's nickname. To set a mode for a channel, the target would be the channel name preceded by a "#" symbol.

The mode can be a combination of different characters, depending on the attribute that you want to change. Some common modes include:

    O - give "channel creator" status;
    o - give/take channel operator privilege;
    v - give/take the voice privilege;
    i - toggle the invite-only channel flag;
    m - toggle the moderated channel;
    t - toggle the topic settable by channel operator only flag;
    k - set/remove the channel key (password);
    l - set/remove the user limit to channel;
    b - set/remove ban mask to keep users out;
    e - set/remove an exception mask to override a ban mask;
    I - set/remove an invitation mask to automatically override
        the invite-only flag;

The character - before the mode character is used to remove the mode and the + character is used to set the mode.

The parameter(s) is optional and depends on the mode being set. For example, when setting +o mode, the parameter would be the nickname of the user to who you want to give operator status. You can check them all in RFC-2812 3.2.3.

In Internet Relay Chat (IRC), a "mask" is a string of characters used to match a user's hostname or IP address. Masks are used in several commands, mainly the MODE command in +b, +I, +e modes.

The MODE +b command is used to prevent a specific user or group of users from joining a channel. The command is typically used in the following format:

MODE #channel +b mask

where #channel is the name of the channel you want to ban a user from, and "mask" is the mask that will be used to match the user's hostname or IP address.

The mask is formatted in this way:

nick!user@host\ipaddress

The mask can use wildcard characters, such as "" and "?" to match multiple hostnames or IP addresses. For example, "!@.example.com" would match any user whose hostname ends in ".example.com", regardless of their username or ident.

When a user attempts to join a channel that they are banned from, the server will check their hostname or IP address against the mask and will prevent them from joining if there is a match.

It's worth noting that the ban mask can be removed by using the -b option in the command MODE, and also different servers may have different implementations and may not support all modes, and some may have additional modes.

Read more about the format here.

Clone this wiki locally