Gpt4Free-Chat-bot 🤖
This is a Python-based Discord bot using the discord.py
library. The bot responds to messages, can change its profile picture, and provide latency information. Additionally, it uses the theb
from GPT4FREE for generating responses based on conversation history.
Preview 👀
Commands ⚙️⚙️
- For all commands use
/help
in discord
Steps to install and run 🚩 :
Step 1. 🎬 Git clone repository
git clone https://github.com/mishalhossin/Discord-Chatbot-Gpt4Free
Step 2. 📁 Changing directory to cloned directory
cd Discord-Chatbot-Gpt4Free
here
Step 3. 🔑 Getting discord bot token and enabling intents fromFor more info click here ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ IMPORTENT ⚠️ ⚠️ ⚠️ ⚠️ ⚠️
here
Step 4. 🔑 Get hugging face Access Tokens fromRead or Write it dosent matter (I use Write)
example.env
to .env
and put the discord token and hugging face access token. It will look like this:
Step 5. 🔐 Rename HUGGING_FACE_API=hf_access_token_from_step_4
DISCORD_TOKEN=token_from_step_3
Step 6. ⚙️ Install all the dependencies
pip install -r requirements.txt
Step 7. 🚀 Run the bot
python main.py
Step 8. 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 /help
✨✨✨ Other ways to run ✨✨✨
Using docker to run 🐳
- Have a working bot token
- Follow up-to step 5
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
Using replit to run ☁️
- Follow all the steps except
step 1
- Have a replit account
- Please note
.env
found in secrets tab of replit :
- Config
secrets
in replit like this :