My Discord
🤖
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 🎬 Git clone repository
Step 1. git clone https://github.com/mishalhossin/Discord-Chatbot-Gpt4Free
📁 Changing directory to cloned directory
Step 2. cd Discord-Chatbot-Gpt4Free
🔑 Getting discord bot token and enabling intents from here
Step 3. For more info click here ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ IMPORTENT ⚠️ ⚠️ ⚠️ ⚠️ ⚠️
🔑 Get hugging face Access Tokens from here
Step 4. Read or Write it dosent matter (I use Write)
🔐 Rename example.env
to .env
and put the discord token and hugging face access token. It will look like this:
Step 5. HUGGING_FACE_API=hf_access_token_from_step_4
DISCORD_TOKEN=token_from_step_3
⚙️ Install all the dependencies
Step 6. pip install -r requirements.txt
🚀 Run the bot
Step 7. 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 :