This repository contains the implementation of an Internet Relay Chat (IRC) server in C++. The server allows users to connect, communicate, and interact with each other in real-time through chat rooms (channels). Users can join different channels, send messages, and perform various IRC commands.
To get started with this project, you'll need to have a C++ compiler. The project uses a Makefile for building and compiling.
- C++ compiler (e.g., g++)
- Terminal or command prompt
- Download and install Irssi as your client
- Clone the repository
git clone https://github.com/Stte/ft_irc.git - Navigate to the project directory
cd ft_irc - Run
maketo compile the project.
- After building the project, run the server executable
./ircserv <port> <password>. Replace<port>and<password>following the IRC protocol rules. - The server will start listening for incoming connections on the specified port.
We chose to implement our IRC server to work with Irssi as our client.
- Open your terminal.
- Run
irssi. - Connect to the server by typing
/connect localhost <port> <password>. Replace with the port and password you chose.
Syntax: PASS password
Used to authenticate the user with the server. Replace password with the actual password.
Syntax: NICK nickname
Used to set or change the user's nickname. Replace nickname with the desired nickname.
Syntax: USER username hostname servername :realname
Used to specify the username, hostname, servername, and real name of the user.
Syntax: JOIN #channelname
Used to join a channel. Replace channelname with the name of the channel you want to join. If the channel does not exist it will create it.
Syntax: MODE #channelname +/- o nickname - Give/take channel operator privilege.
Syntax: MODE #channelname +/- i - Set/remove Invite-only channel.
Syntax: MODE #channelname +/- t - Set/remove the restrictions of the TOPIC command to channel operators.
Syntax: MODE #channelname +/- k password - Set/remove the channel key (password).
Syntax: MODE #channelname +/- l limit - Set/remove the user limit to channel.
Used to change the mode of a channel or user.
Syntax: KICK #channelname nickname
Used to remove a user from a channel. Replace channelname with the name of the channel and nickname with the nickname of the user to be kicked.
Syntax: INVITE nickname #channelname
Used to invite a user to a channel. Replace nickname with the nickname of the user and channelname with the name of the channel.
Syntax: PRIVMSG #channelname/nickame message
Used to send a private message to a user or a message to a channel. Replace channelname or nickname with the name of the channel or the nickname of the user, and message with the message you want to send.
Syntax: QUIT
Used to disconnect from the server.
Syntax: TOPIC #channelname topic
Used to set or view the topic of a channel. Replace channelname with the name of the channel and topic with the new topic.
Syntax: PART #channelname
Used to leave a channel. Replace channelname with the name of the channel.
The bot.py script is a simple IRC bot that can join channels, respond to messages, and fetch random quotes. only works on localhost.
- Ensure you have Python3 installed.
- Run the bot script by typing
python3 bot.py -p <port> -pw <password>in your terminal. - The bot will connect to the server and join a channel. You can interact with it by sending messages in the channel.