Skip to content

This is a Discord Chatbot that can also Detect image, Access internet , Generate Image, Summerize any youtube video with transcript

License

Notifications You must be signed in to change notification settings

lixudesu/Discord-AI-Chatbot

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Discord-Chat-bot πŸ€–

This is a Python-based Discord chat bot that uses the discord.py library. It can respond to messages, change its profile picture, and provide latency information. It also utilizes the chatbase model from OpenGPT for generating responses based on conversation history and Imaginepy for generating midjourney like images.

The bot has various features, including image generation using DALL-E, OCR for images, web access using DuckDuckGo, and YouTube video summarization. It supports hybrid command systems, recognizes mentions, handles messages, and allows for channel-specific responses.

My Discord

If you want to use Replit or Docker check this

Feature Showcase πŸ‘€ (Click to expand)

Image generation

image

YouTube video summary (Any language)

image

Web access using DuckDuckGo

image

OCR for images (Needs Hugging Face API key)

image

Features ✨
  • Hybrid Command System: Get the best of slash and normal commands. It's like a buffet! βš™οΈ
  • Imagine generation: Make your imagination come true for free πŸ€–
  • Free LLM Model: Enjoy the powerful capabilities of this language model without spending a dime. πŸ€–
  • Mention Recognition: The bot always responds when you mention it or say its name. It's as attentive as a squirrel spotting a shiny acorn! βš™οΈ
  • Message Handling: The bot knows when you're replying to someone else, so it won't cause confusion. It's like having a mind reader in your server! πŸͺ„
  • Channel-Specific Responses: Use the /toggleactive command to chill the bot in a specific channel. βš™οΈ
  • GPT-3.5-Turbo Model: This bot runs on turbo power! Powered by the lightning-fast GPT-3.5-Turbo language model. πŸ€–
  • Image Detection Model: The bot can detect objects and text in images with OCR and GPT2 captioning using a fancy Hugging Face API. πŸ•΅οΈβ€β™‚οΈ
  • Secure Credential Management: Keep your credentials secure using environment variables. πŸ”‘
  • Web Access: Web Access is now available! Unlock a whole new level of awesomeness. 🌐
  • YouTube Video Summarizer: This is a feature that utilizes the power of the Language Model (LLM) to generate summaries of YouTube videos. 🌐
  • Speech recognition: Coming soon! Get ready for an LLM-powered voice assistant.
Commands βš™οΈβš™οΈ
  • /pfp [image_url]: Change the bot's actual profile picture.
  • /changeusr [new_username]: Change the bot's username.
  • /ping: Get a "Pong" response from the bot.
  • /toggleactive: Toggle active channels.
  • /toggledm: Toggle DM for chatting.
  • /bonk: Clear the message history.
  • /neko: Display a random image or GIF of a neko, waifu, husbando, kitsune, or other actions.
  • /help: Get all other commands.
  • /imagine: Generate an image using an endpoint.

Steps to install and run 🚩 :

Step 1. 🎬 Git clone repository

image

git clone https://github.com/mishalhossin/Discord-AI-Chatbot

Step 2. πŸ“ Changing directory to cloned directory

image

cd Discord-AI-Chatbot

Step 3. πŸ”‘ Getting discord bot token and enabling intents from HERE

Read more... ⚠️

image

Enable intents

image

Get the token !!! by clicking copy

image

Step 4. πŸ”‘ Get hugging face Access Tokens from HEREE

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

image

pip install -r requirements.txt

Step 7. πŸš€ Run the bot

image

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 replit to run ☁️

Try on repl.it

  • 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

Using docker to run

Docker

  • Have a working bot token
  • Follow up-to step 5

Install docker compose on linux machine :

For Debian-based distributions (such as Ubuntu):

apt update -y ; sudo apt upgrade -y; sudo apt autoremove -y; sudo apt install docker-compose -y
Other linux distro

For Red Hat-based distributions (such as CentOS and Fedora):

sudo yum update -y && sudo yum install -y docker-compose

For Arch-based distributions (such as Arch Linux):

sudo pacman -Syu --noconfirm && sudo pacman -S --noconfirm docker-compose

For SUSE-based distributions (such as openSUSE):

sudo zypper update -y && sudo zypper install -y docker-compose

Start the bot in docker container :

sudo docker-compose up --build

Contributors

Crafted with Care: Made with lots of love and attention to detail. ❀️

About

This is a Discord Chatbot that can also Detect image, Access internet , Generate Image, Summerize any youtube video with transcript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.8%
  • Dockerfile 0.2%