diedinb22

discord bot that generators accounts and make a dashboard with it

Kodari AI
KodariSep 6 at 7:29 pm 1
AccountGenDashboard
A Discord bot that generates unique accounts and provides a web-based dashboard for managing them. The bot listens for account generation commands, creates credentials with configurable parameters, and stores them securely. The accompanying dashboard displays real-time statistics, allows filtering and searching generated accounts, and provides export functionality. Users can generate accounts via Discord slash commands, view generation history, and manage account inventory through an intuitive web interface with authentication and role-based access control.
  1. Build a local account service with SQLite-backed credential generation and one-time password display.

  2. Add a Discord slash-command interface restricted to administrators.

  3. Add an authenticated Flask dashboard for generating, listing, and deleting accounts.

  4. Include environment setup, dependencies, and safe storage documentation.

Created a complete Discord account-management bot with:

  • SQLite-backed account storage

  • Secure password hashing

  • One-time password display

  • Administrator-only Discord slash commands:

    • /account generate

    • /account list

    • /account delete

  • Authenticated Flask dashboard

  • Account generation, listing, and deletion through the web UI

  • .env configuration

  • Setup documentation and dependency files

The generator is designed for accounts in an application you own or administer, not automated registrations on third-party platforms.

diedinb22

this is the account token <redacted>

Kodari AI
KodariSep 6 at 7:32 pm 1

That Discord token is exposed and must be treated as compromised. I won’t use or store it.

  1. Open the Discord Developer Portal → Applications → your bot → Bot.

  2. Click Reset Token, then copy the newly generated token.

  3. Replace the old value in your local .env:

    Env
    DISCORD_TOKEN=your_new_token_here
    
  4. Restart the bot.

  5. Remove the exposed token from chat logs, code, .env files, shell history, and Git history if it was committed.

  6. Add .env to .gitignore and never share tokens publicly.

If this was a user account token rather than a bot token, stop using it immediately, change the account password, revoke active sessions, and contact Discord Support.

diedinb22

its saying to have a new env file

Kodari AI
KodariSep 6 at 7:37 pm 1

Create a file named .env in the same folder as main.py. It must be exactly .env, not .env.txt.

Copy this into it:

Env
DISCORD_TOKEN=paste_your_new_reset_bot_token_here
DASHBOARD_SECRET=generate_a_long_random_password_here
DATABASE_PATH=data/accounts.db
DASHBOARD_HOST=127.0.0.1
DASHBOARD_PORT=8080
DISCORD_GUILD_ID=

Important:

  • Use the newly reset bot token, not the exposed one.

  • Do not include quotation marks.

  • Keep .env private and never upload it to GitHub.

  • DASHBOARD_SECRET is the password used to log in to the dashboard.

  • Leave DISCORD_GUILD_ID blank, or set it to your Discord server ID for faster slash-command syncing.

Then install dependencies and start the bot:

Shell
pip install -r requirements.txt
python main.py

Open the dashboard at:

Plain Text
http://127.0.0.1:8080

Log in using the value you set for DASHBOARD_SECRET.

Kodari can make mistakes. Review important code before using.
Files
.gitignore
account_generator.py
bot.py
dashboard.py
database.py
main.py
README.md
requirements.txt
Code
8 435
main.py
from __future__ import annotations

import logging
import os
import threading

from dotenv import load_dotenv

from account_generator import AccountGenerator
from bot import AccountBot
from dashboard import create_app
from database import AccountStore


def optional_integer(value: str | None) -> int | None:
    return int(value) if value and value.strip() else None


def main() -> None:
    load_dotenv()
    logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(name)s: %(message)s")

    token = os.getenv("DISCORD_TOKEN")
    dashboard_secret = os.getenv("DASHBOARD_SECRET")
    if not token:
        raise RuntimeError("DISCORD_TOKEN is required")
    if not dashboard_secret:
        raise RuntimeError("DASHBOARD_SECRET is required")

    store = AccountStore(os.getenv("DATABASE_PATH", "data/accounts.db"))
    generator = AccountGenerator(store)
    app = create_app(store, generator, dashboard_secret)

    host = os.getenv("DASHBOARD_HOST", "127.0.0.1")
    port = int(os.getenv("DASHBOARD_PORT", "8080"))
    dashboard_thread = threading.Thread(
        target=app.run,
        kwargs={"host": host, "port": port, "debug": False, "use_reloader": False},
        daemon=True,
    )
    dashboard_thread.start()
    logging.getLogger(__name__).info("Dashboard listening on http://%s:%s", host, port)

    bot = AccountBot(store, generator, optional_integer(os.getenv("DISCORD_GUILD_ID")))
    bot.run(token, log_handler=None)


if __name__ == "__main__":
    main()