AI IRC Bot is a simple IRC bot written in Python. It was initially forked from the knrd1/chatgpt into oiramNet/ChatGPT-IRC-Bot but turned into its own project to support other AI back-ends. It connects to the selected AI endpoints to answer questions or generate images and uses official bindings from AI to interact with it using the API through the HTTP/HTTPS requests. You can find more details about supported APIs below:
- ChatGPT (OpenAI): https://platform.openai.com/docs/api-reference
- Claude (Anthropic): https://docs.anthropic.com/en/api/getting-started
- Create an account and obtain your API KEY
- ChatGPT (OpenAI): https://platform.openai.com/account/api-keys
- Claude (Anthropic): https://console.anthropic.com/settings/keys
- Install Python3 and the official bindings (pyshorteners; pytz; openai; anthropic)
- Debian/Ubuntu
apt install python3 python3-pip pip3 install pyshorteners pytz openai anthropic
- RedHat/CentOS
yum install python3 python3-pip pip3 install pyshorteners pytz openai anthropic
- FreeBSD
pkg install python311 py311-pip pip install pyshorteners pytz openai anthropic
- Debian/Ubuntu
Clone the package using the below command. It will copy all files into the AI-IRC-Bot directory, which you can later rename.
git clone https://github.com/oiramNet/AI-IRC-Bot
AI IRC Bot uses a plain-text file as its configuration file. The package includes an example configuration file (AIbot.conf.sample) which is set to connect to IRCnet. You can copy and modify it to suit your preferences.
cd AI-IRC-Bot
cp AIbot.conf.sample SampleBot.conf
Some of the settings apply only to the specific AI API or models. Make sure to check the sample configuration file for details.
AI IRC Bot can use any of the below models.
- ChatGPT (OpenAI): https://platform.openai.com/docs/models
- Chat Completion models
gpt-4o, gpt-4o-mini, gpt-4, gpt-4-turbo, gpt-4-turbo-preview, gpt-3.5-turbo
- Image creation models
dall-e-2, dall-e-3
- Chat Completion models
- Claude (Anthropic): https://docs.anthropic.com/en/docs/about-claude/models
- Chat Completion models
claude-3-5-sonnet-latest, claude-3-5-haiku-latest
- Chat Completion models
We suggest starting experimenting with gpt-4o-mini for the ChatGPT (OpenAI) or claude-3-5-haiku-latest for Claude (Anthropic).
To start the bot, run the command below. Make sure to replace CONFIG with the name of your configuration file.
- Debian/Ubuntu/RedHat/CentOS
python3 AIbot.py CONFIG
- FreeBSD
python3.11 AIbot.py CONFIG
AI IRC Bot is designed to process messages on standard channels (#CHANNEL) and will interact (respond) only to messages directed to it using its nickname (BOTNAME: MESSAGE).
12:34:12 < user> SampleBot: how are you?
12:34:13 < SampleBot> I'm doing well, thank you for asking! How are you today? Is there anything specific I can help you with?
12:56:21 < user> SampleBot: do you like IRC?
12:56:22 < SampleBot> I'm an AI, so I don't personally "like" or "dislike" things in the way humans do. However, I'm familiar with IRC (Internet Relay Chat) as a communication protocol. It's an older form of real-time internet chat that was very popular before modern messaging platforms. Would you like to discuss IRC or chat protocols?
If you set the model to dall-e-2 or dall-e-3 (ChatGPT/Image creation), the AI IRC Bot will return a shortened URL to the generated image.
13:14:05 < user> SampleBot: red apples on the table
13:14:35 < SampleBot> https://tinyurl.com/1a2b3c4d
Feel free to contact us through the GitHub.