Skip to content

This is a Python-based Discord bot using the discord.py library. The bot responds to messages

License

Notifications You must be signed in to change notification settings

Rithmatist/Coding-Chatbot-Gpt4Free

 
 

Repository files navigation

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 usesless from GPT4FREE for generating responses based on conversation history.

Preview 👀

image

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

Step 3. 🔑 Getting discord bot token and enabling intents from here

For more info click here ⚠️⚠️⚠️⚠️⚠️ IMPORTENT ⚠️⚠️⚠️⚠️⚠️

Step 4. 🔑 Get hugging face Access Tokens from here

Read or Write it dosent matter (I use Write)

image

Step 5. 🔐 Rename example.env to .env and put the discord token and hugging face access token. It will look like this:

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

image

🏁 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

image

✨✨✨ 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 :

image

  • Config secrets in replit like this :

image

Try on repl.it

Want something nsfw ? then check this out: SEX-GPT

About

This is a Python-based Discord bot using the discord.py library. The bot responds to messages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.1%
  • Dockerfile 0.9%