Coder Social home page Coder Social logo

najmul190 / discord-ai-selfbot Goto Github PK

View Code? Open in Web Editor NEW
92.0 6.0 26.0 166 KB

A Discord chatbot / selfbot that allows users to talk to AI powered by Groq API which uses Meta Llama-3 or use your own ChatGPT API key. The AI runs on a genuine Discord account, not a bot account and so it can be put in any server without any permissions! Try it out at: https://discord.gg/yUWmzQBV4P

License: GNU General Public License v3.0

Python 97.17% Batchfile 2.83%
ai chatbot chatbots chatgpt chatgpt4free discord discord-bot discord-py discord-selfbot freeai gpt-3 python selfbot selfcord

discord-ai-selfbot's Introduction

Discord-AI-Selfbot

This is a Python-based Discord selfbot using the discord.py-self library. The selfbot automatically responds to messages that mention it's trigger word using Groq API's Llama-3, one of the highest performing models, all for completely free. You can also add your own API key for ChatGPT functionality, but this is not required. It functions as a normal Discord bot, but on a real Discord account, allowing other people to talk to it within DMs, servers and even group chats without you needing to invite a bot or add the bot to the server - making it seem like a real user to others.

There is always the slight risk of a ban so make sure to use this selfbot on an account you don't mind losing, but the risk is incredibly low and I have used it for over a year without any issues.

This bot was originally Discord-AI-Chatbot by MishalHossin but was heavily edited by Najmul190 to work as a selfbot rather than a Discord bot.

I take no responsibility for any actions taken against your account for using these selfbots, or how users use my open source code.

Using this on a user account is prohibited by the Discord TOS and can lead to your account getting banned in very rare cases.

Preview of text responses:

image

image

Preview of Analyse command:

image

Note: This analysis is based on the user's message history and is not 100% accurate. It is just for fun and should not be taken seriously.

Features

  • Discord Selfbot: Runs on a genuine Discord account, allowing you to use it without even needing to invite a bot.
  • Custom AI Instructions: You can replace the text inside of instructions.txt and make the AI act however you'd like!
  • Free LLM Model: Enjoy the powerful capabilities of this language model without spending a dime.
  • Mention Recognition: The bot only responds when you mention it or say its name.
  • Reply Recognition: If replied to, the bot will continue to reply to you. It's like having a conversation with a real person!
  • 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; It can also handle numerous messages at once!
  • Channel-Specific Responses: Use the ~toggleactive command to pick what channel the bot responds in.
  • Psychoanalysis Command: Use the ~analyse command to analyse a mentioned user's messages and find insights on their personality. It's like having a therapist in your server!
  • Runs on Meta AI's Llama-3: The bot uses the Llama-3 model from Meta AI, which is one of the most powerful models available.
  • Secure Credential Management: Keep your credentials secure using environment variables.
  • Crafted with Care: Made with lots of love and attention to detail.

Commands

  • analyse [user] - Analyze a user's message history and provides a - gical profile
  • wipe - Clears history of the bot
  • ping - Shows the bot's latency
  • toggleactive - Toggle the current channel to the list of active channels
  • toggledm - Toggle if the bot should be active in DM's or not
  • togglegc - Toggle if the bot should be active in group chats or not
  • ignore [user] - Stop a user from using the bot
  • reload - Reloads all cogs
  • restart - Restarts the entire bot

Steps to install and run:

Step 1: Git clone repository

git clone https://github.com/najmul190/Discord-AI-Selfbot

Step 2: Changing directory to cloned directory

cd Discord-AI-Selfbot

Step 3: Getting your Discord token

  • Go to Discord and login to the account you want the token of
  • Press Ctrl + Shift + I (If you are on Windows) or Cmd + Opt + I (If you are on a Mac).
  • Go to the Network tab
  • Type a message in any chat, or change server
  • Find one of the following headers: "messages?limit=50", "science" or "preview" under "Name" and click on it
  • Scroll down until you find "Authorization" under "Request Headers"
  • Copy the value which is your token

Step 4: Getting a Groq API key

  • Go to Groq and sign up for a free account
  • Get your API key, which should look like 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 (this is an example key, it isn't real)

Step 5: Turn on "Show file extensions" in Windows Explorer and rename example.env to .env, then put your Discord token and Groq API key in. It'll look like this:

# Token of the selfbot
DISCORD_TOKEN=TOKEN_GOES_HERE

# Your API Key for GROQ API (https://console.groq.com/keys)
GROQ_API_KEY=GROQ_API_KEY_GOES_HERE

# Your API Key for OpenAI (https://platform.openai.com/api_keys) (Optional - Leave blank to use free API)
OPENAI_API_KEY=

# Owner ID of your account (can't be same as bot's ID)
OWNER_ID=ID_OF_YOUR_MAIN_DISCORD_ACCOUNT

# The word you want the AI to respond to (e.g: TRIGGER=John)
TRIGGER=WORD_YOU_WANT_TO_TRIGGER_BOT_WITH

# Prefix you want bot commands to be triggered with
PREFIX=~

# Realistic Typing - If set to true, the bot will type for a realistic(ish) amount of time before sending a message
REALISTIC_TYPING=false

The OWNER_ID is the ID of your main Discord account, which will be the only account allowed to use important commands, such as toggleactive, wipe, etc.

Step 6: Install all the dependencies and run the bot

Windows:

  • Simply open run.bat if you're on Windows. This will install all pre-requisites and run the bot as well.

  • If run.bat doesn't work, then open CMD and run cd Discord-AI-Selfbot to change directory to the bot files directory

  • Create a virtual environment by running python -m venv bot-env

  • Activate the virtual environment by running bot-env\Scripts\activate.bat

  • Run pip install -r requirements.txt to install all the dependencies

  • Install discord.py-self using pip install -U discord.py-self

  • Run the bot using python3 main.py

Linux:

  • If you're on Linux, then run cd the\bot\files\directory to change directory to the bot files directory
  • Create a virtual environment by running python3 -m venv bot-env
  • Activate the virtual environment by running source bot-env/bin/activate
  • Run pip install -r requirements.txt to install all the dependencies
  • Install discord.py-self using pip install -U discord.py-self
  • Run the bot using python3 main.py

How to talk to the bot

  • To activate it in a channel use ~toggleactive in the channel or manually add the channel ID in channels.txt
  • To see all commands use ~help
  • Bear in mind that the bot will only respond to other accounts and not itself, including any commands.
  • You must also set a trigger word within the .env, this is the word that the bot will respond to. For example, if you set the trigger word to John, people must say "Hey John, how are you today?" for the bot to respond.

Support + Try out the bot!

I probably won't be accepting friend requests so if you have any questions or require help, join a quick Discord server I put together and ask in there! (You can leave after getting help, or stick around if you want!)

You can also try out this project in this server, in the #italiano channel! Click the image below to join.

Discord Banner 2

Donate

If you're feeling rich and grateful, feel free to donate by clicking this button!

ko-fi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.