Skip to main content
This guide will help you quickly set up and run Junkie, your AI-powered Discord selfbot.
1

Clone the repository

First, clone the Junkie repository to your local machine:
git clone https://github.com/maanya0/junkie.git
cd junkie
2

Install dependencies

Install all required Python packages:
pip install -r requirements.txt
Junkie requires Python 3.12 or higher. Make sure you have the correct version installed.
3

Configure environment variables

Create a .env file in the root directory with your Discord token and API keys:
.env
# Discord Configuration (Required)
DISCORD_TOKEN=your_discord_token_here

# AI Provider Configuration
CUSTOM_PROVIDER=groq
CUSTOM_MODEL=openai/gpt-oss-120b
GROQ_API_KEY=your_groq_api_key_here

# Optional: Database Configuration
POSTGRES_URL=your_postgres_connection_string

# Optional: Additional API Keys
FIRECRAWL_API_KEY=your_firecrawl_api_key

# Optional: Logging
LOG_LEVEL=INFO
Your Discord token is sensitive information. Never share it or commit it to version control.
4

Run Junkie

Start the bot with:
python main.py
You should see a message confirming the bot is logged in:
[SELF-BOT] Logged in as YourUsername (ID: 123456789)
5

Test your first command

Junkie uses two command prefixes:
  • . (dot) - For bot commands
  • ! (exclamation) - For chatbot interactions
Try these commands in any Discord channel:
.tldr
The bot will only respond to messages from your account since it’s configured as a selfbot.

Next steps

Now that you have Junkie running, you can:
  • Configure advanced settings in your .env file
  • Explore available commands and features
  • Customize the AI model and provider settings
  • Set up tracing and debugging for development

Bot initialization

Here’s how Junkie initializes under the hood:
main.py
import os
from dotenv import load_dotenv
from discord_bot.chat_handler import setup_chat
from discord_bot.selfbot import SelfBot
from discord_bot.tldr import setup_tldr

load_dotenv()

bot = SelfBot(
    token=os.getenv("DISCORD_TOKEN"),
    prefix=".",
)

setup_tldr(bot)
setup_chat(bot)

if __name__ == "__main__":
    bot.run()
The bot uses a custom SelfBot class that wraps discord.py-self with a command prefix of . for bot commands.

Build docs developers (and LLMs) love