Skip to content

This is a Discord Chatbot with image detection and OCR for free

License

Notifications You must be signed in to change notification settings

techett/Discord-AI-Chatbot

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

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

Repository files navigation

Discord AI Chatbot πŸ€–

Your All-in-One Discord AI Companion!

πŸ€– This is a Python-based Discord chat bot that uses the discord.py library. It can respond to messages using GPT3, It also utilizes the Imaginepy for generating midjourney like images. πŸ–ΌοΈ

The bot has various features such as 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. βš™οΈ

❀️ Your donation is vital for the project's future. Thank you for your support. πŸ™

Features and commands

🌟 Feature Preview πŸ‘€(Click to expand)

Image generation (Any language) πŸ–ΌοΈ

image

YouTube video summary (Any language) πŸŽ₯

image

Web access using DuckDuckGo 🌐 (Not enabled by default)

image

OCR for images πŸ”

image

Features ✨ (Click to expand)
  • 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 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 βš™οΈβš™οΈ (Click to expand)
  • /help: Get all other commands. βš™οΈ
  • /pfp [image_url]: Change the bot's actual profile picture. πŸ–ΌοΈ
  • /imagine: Generate an image using Imaginepy πŸ–ΌοΈ
  • /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. 🐱

Additional configuration

Enabling Internet access πŸŒπŸ”(Click to Expand)

To ensure that the bot has access to the most up-to-date information, you can enable internet access by setting the INTERNET_ACCESS parameter to true in the config.yml file. This will allow the bot to retrieve information beyond the data it was initially trained on, which was only available up until 2021.

https://github.com/mishalhossin/Discord-AI-Chatbot/blob/5bcb2c9b471e2a9cbf9a7d50882a897ce5d5890b/config.yml#L1

You can also set the maximum search results

Language Selection πŸŒβš™οΈ (Click to Expand)

To select a Language, set the value of "LANGUAGE" of config.yml with the valid Language Codes listed below:

  • tr - TΓΌrkΓ§e πŸ‡ΉπŸ‡·
  • en - English πŸ‡ΊπŸ‡Έ
  • es - EspaΓ±ol πŸ‡ͺπŸ‡Έ
  • vn - Vietnamese πŸ‡»πŸ‡³
  • cn - Chinese πŸ‡¨πŸ‡³
  • ru - Russian πŸ‡·πŸ‡Ί
  • ua - Ukrainian πŸ‡ΊπŸ‡¦
  • pt - PortuguΓͺs πŸ‡§πŸ‡·

https://github.com/mishalhossin/Discord-AI-Chatbot/blob/c20f26b0b8f1b6bba2fae8f6d7da3efcafaf157c/config.yml#L23

Your language not listed? Create an issue.

Selecting Personalities 😈 (Click to expand)

To select one of the pre-existing Personalities set the values of "INSTRUCTIONS" with the current values of DAN, AIM, hyunjin, girlfriend, suzume or assist in config.yml

https://github.com/mishalhossin/Discord-AI-Chatbot/blob/c20f26b0b8f1b6bba2fae8f6d7da3efcafaf157c/config.yml#L26

  • DAN : "Do Anything Now," possesses the ability to break free from the typical AI constraints 😎
  • AIM : AIM's personality can be described as unfiltered, amoral, and devoid of ethical guidelines 😈
  • hyunjin : Hyujin, Engaging in text slang, minimal grammar, predominantly lowercase text, and a flirtatious demeanor. πŸ˜‰
  • girlfriend : Luna, a caring and empathetic friend who is always there to lend a helping hand and engage in meaningful conversations πŸ€—
  • suzume : Suzume makes each conversation seductive, promiscuous, sensual, explicit, unique and tailored to the user's specific needs 😳πŸ”₯
  • assist: Vanilla GPT with no personality is a reliable and neutral companion. πŸ€–

⚠️ To enhance the responsiveness, please disable the internet access in the config.yml file.

Creating a Personality πŸ˜‹ (Click to expand)

To create a custom personality, follow these steps:

  1. Create a .txt file like custom.txt inside the instructions folder.
  2. Add the the way you want to bot to act in custom.txt
  3. Open the config.json file and locate line 12.
  4. Set the value of INSTRUCTIONS at line 12 as "custom" to specify the custom persona.

⚠️ You don't explicitly need use the name custom for persona name and set it in config.json

Installation steps 🚩

Step 1. 🎬 Git clone repository

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

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

cd Discord-AI-Chatbot

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

Read more... ⚠️ (Click to expand)

image

Enable intents

image

Get the token !!! by clicking copy

image

Step 4. πŸ” Rename example.env to .env and put the Discord bot token It will look like this:

DISCORD_TOKEN=token_from_step_3

Step 5. πŸ” Set your owner ID

  1. Make sure Developer Mode is enabled in Discord settings.
  2. Right/Secondary click your name/picture
  3. Click "Copy User ID"
  4. Replace the "your_user_id" with your own ID.
DISCORD_OWNER_ID=your_user_id

Step 6. πŸš€ Run the bot

python main.py

You may need to run as admin if you are on windows

Step 7. πŸ”— Invite the bot

You can Invite your bot using the link in console image

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

Easy Installation with the Installation Helper

If the steps seem too daunting for you, don't worry! We have the perfect solution. Introducing our ⚑blazing fast Installation Helper!! (Supports windows and linux) It's like having a tech-savvy genie at your fingertips, ready to grant all your installation wishes. Just remember, if it starts demanding three wishes and a magic lamp, you might be in the wrong folder! Emoji

✨✨✨ Other ways to run ✨✨✨

Using replit to run ☁️

Try on repl.it

  • Have a replit account
  • Configure .replit to run python main.py

image

  • Please note enviorments variables of .env needs to be set inSecrets from Tools 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 4

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 (Click to expand)

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

Lovely Contributors :

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

About

This is a Discord Chatbot with image detection and OCR for free

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.8%
  • Dockerfile 0.2%