GPT-4 is OpenAI’s most recent and powerful natural language processing model, which has yet to be published for public usage. The GPT4Free-Chatbot, on the other hand, provides a look into GPT-4’s potential by utilizing a variation of the GPT4Free model to produce answers based on prior discussion history. This Python-based Discord bot not only provides practical features like replying to messages and updating its profile image, but it also displays significant advances in natural language understanding.
Table of Contents
GPT4Free-Chatbot
This is a Discord bot written in Python that makes use of the discord.py
package. The bot reacts to messages, can change its profile image, and reports latency. It also makes use of theb
from GPT4FREE to generate replies based on conversation history.
Commands
- Toggle the active channel for a server using the
!toggleactive
command. - Use to toggle whether or not dm should be active
!toggledm
- with the
!pfp [url or attachment]
command, it changes its profile picture. - The
!ping
command returns latency information. - with the
!changeusr [New username]
command, it changes its username. - If something goes wrong, use
!bonk
to clear history.
Steps to install and run.
Step1: Git clone repository
git clone https://github.com/mishalhossin/Discord-Chatbot-Gpt4Free
Step2: Changing directory to cloned directory.
cd Discord-Chatbot-Gpt4Free
Step3: Getting discord bot token and enabling intents from here
Select application

Enable intents

Get the token by clicking copy.

Step4: Rename example.env
to .env
and put the discord token.
DISCORD_TOKEN=token_from_step_3
Step5: Install all the dependencies
- If you don’t have pip already. Run
python get-pip.py
on windows
pip install -r requirements.txt
Linux:
pip3 install -r requirements.txt
Step6: Run the bot
Windows:
py main.py
or
python main.py
Linux:
python main.py
or
python3 main.py
Step7: Invite the bot

Finally talk to the bot
There are 2 ways to talk to the ai
- Invite your bot and DM (Direct message) it Make sure you have DM enabled.
- If you want it in server channel use !toggleactive
- For more awesome commands use !welp
Using docker to run
- Have a working bot token
- Follow up-to step 4
Install docker compose on linux machine:
apt update -y ; sudo apt upgrade -y; sudo apt autoremove -y; sudo apt install docker-compose -y
Start the bot in docker container:
sudo docker-compose up --build
Also Read ChatGPT4 for Free.
This article helps you learn about GPT4Free-Chatbot. We trust that it has been helpful to you. Please feel free to share your thoughts and feedback in the comment section below.