Skip to content

EpharGy/TraCord-DJ

Repository files navigation

TraCord DJ

A comprehensive Discord bot for managing music requests, interacting with Traktor DJ software collections, and enhancing DJ workflow automation. This is a standalone GUI application suitable for personal DJ environments. Spout integration is included for cover art display in other supported applications. Automatically creates a flask webserver for web overlays, allowing real-time song updates in OBS or other streaming software. MIDI support is included for song transitions, when enabled, a simple note is played when a song is played, allowing you to use this with other MIDI listeners. (recommend Free software for non-commercial, LoopBe1 - https://www.nerds.de/en/download.html)

πŸ“ Version: Current version in version.py Was monstly built in Python 3.11 but recently updated to 3.13, so may not work with 3.11 anymore.

Features

  • πŸ–₯️ Standalone GUI Application: Qt (PySide6) control panel with real-time monitoring
  • 🎧 Now Playing Song: Traktor Broadcast Listening for Song/Artist details, integrated with collection details for advanced meta data (coverart, BPM, Key)
  • πŸ–ΌοΈ Spout Cover Art Integration: Send cover art to other applications via Spout (Windows only)
  • πŸ–ΌοΈ Webpage for OBS/Overlays: Flask webserver with Current Song Playing details. http://127.0.0.1:5000/
  • πŸ–₯️ MIDI: Simple MIDI note played on song change (can use this to trigger things via MIDI)
  • 🎡 Dynamic Song Search: Intelligent search with interactive selection
  • πŸ“‹ Song Request Management: Full CRUD operations with user permissions
  • πŸ“‚ Collection Integration: Automatic Traktor collection integration for data
  • πŸ†• New Song Tracking: Display recently imported songs
  • πŸ“’ Live Streaming Notifications: Broadcast notifications with role mentions
  • πŸ”’ Permission System: Granular access control for different user roles or channels
  • 🧹 Admin Controls: Collection refresh and track history via GUI buttons
  • πŸ“Š Search Analytics: Track and display search statistics

Screenshots

Main Interface

TraCord DJ GUI

Spout Cover Art Integration β†’ Nest Drop β†’ OBS

Any application that supports Spout can receive cover art from this bot, allowing you to display it in OBS or other software. (OBS does support spout directly via plugin)

Overlay Screenshots

Current workflow, Traktor -> TraCord DJ -> Spout/Web Overlay -> Nest Drop -> OBS Spout Integration Spout Integration Spout Integration

Quick Start

Setup notes: the first launch creates settings.json. Update it (or use the GUI Settings dialog) with your Traktor base path (for example C:/Users/<user>/Documents/Native Instruments/), Discord token, and channel IDs before connecting the bot.

Common launch commands:

  • python run_bot.py

Documentation

Commands

Music Discovery

  • /song <search> - Search for songs with interactive selection (restricted to designated channels), reply to the bot's message with the number of the song to request it.
  • /srbnew [days] - Display newly added songs from the last N days (default: 7)

Request Management

  • /srbreqlist - Display all pending song requests
  • /srbreqdel <number|'all'|'self'|username> - Delete song requests with flexible options

Utility Commands

  • /srblive <message> - Send live streaming notifications with role mentions (admin only)

Configuration

Settings File

The bot uses a settings.json file for configuration. This file is created on the first run and can be edited via the GUI settings panel.

Web Overlay

The web overlay can be found at http://127.0.0.1:5000/. You can use this in OBS; by default, width is 1024px and height is 350px, which should be plenty in the case of text wrapping (entire panel has a default of 1024). By default cover art is 200px. Variables can be set at the top of the default_overlay.html file.

πŸ› οΈ For Developers

Branches available:

  • main - Stable releases only
  • dev - Active development (use this for contributions)

Quick start:

python run_bot.py  # Run the application

Running the Bot

πŸš€ GUI Application (Recommended)

  • Windows: Double-click start_bot.bat or run the built executable
  • Cross-platform: Run python run_bot.py

The GUI provides real-time monitoring, admin controls, and automatic bot startup.

🧩 Extending with Discord Cogs (Plugins)

This bot uses a dynamic cog loader! To add new discord features or commands, simply drop a .py file into the cogs/ folder (if using EXE, create one where the exe is launched from). The bot will automatically load all cogs in this folder at startupβ€”no need to edit the main code!

  • To add a new cog:
    1. Place your my_cool_feature.py in the cogs/ folder.
    2. Restart the bot. That's it! Your cog will be loaded automatically.
  • To remove a cog:
    1. Delete or move the .py file from cogs/.
    2. Restart the bot.

Note for Contributors: The _internal_cogs.py file is auto-managed and contains an always-up-to-date list of internal cogs. Do not edit this file manually.

Project Structure

The bot uses a modular Discord.py Cogs architecture for better organization:

TraCord-DJ/
β”œβ”€β”€ πŸš€ Entry Points
β”‚   β”œβ”€β”€ run_bot.py
β”‚   β”œβ”€β”€ main.py
β”‚   β”œβ”€β”€ run_bot.py
β”‚   └── start_bot.bat
β”œβ”€β”€ πŸ“ Core Application
β”‚   β”œβ”€β”€ cogs/
β”‚   β”‚   β”œβ”€β”€ admin.py
β”‚   β”‚   β”œβ”€β”€ collection.py
β”‚   β”‚   β”œβ”€β”€ music.py
β”‚   β”‚   β”œβ”€β”€ music_requests.py
β”‚   β”‚   └── _internal_cogs.py
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── settings.py
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   β”œβ”€β”€ collection.json
β”‚   β”‚   β”œβ”€β”€ Debug_unmatched_songs.txt
β”‚   β”‚   β”œβ”€β”€ settings.json
β”‚   β”‚   β”œβ”€β”€ settings_example.json
β”‚   β”‚   β”œβ”€β”€ song_requests.json
β”‚   β”‚   β”œβ”€β”€ stats.json
β”‚   β”‚   └── _datafiles_stored_here.txt
β”‚   β”œβ”€β”€ ui_qt2/
β”‚   β”‚   β”œβ”€β”€ app.py
β”‚   β”‚   β”œβ”€β”€ controller.py
β”‚   β”‚   β”œβ”€β”€ log_bridge.py
β”‚   β”‚   β”œβ”€β”€ main_window.py
β”‚   β”‚   β”œβ”€β”€ signals.py
β”‚   β”‚   └── panels/
β”‚   β”‚       β”œβ”€β”€ bot_info_panel.py
β”‚   β”‚       β”œβ”€β”€ controls_panel.py
β”‚   β”‚       β”œβ”€β”€ log_panel.py
β”‚   β”‚       β”œβ”€β”€ now_playing_panel.py
β”‚   β”‚       β”œβ”€β”€ song_requests_panel.py
β”‚   β”‚       β”œβ”€β”€ song_requests_popup.py
β”‚   β”‚       β”œβ”€β”€ stats_panel.py
β”‚   β”‚       └── status_panel.py
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ discord_bot.py
β”‚   β”‚   β”œβ”€β”€ traktor_listener.py
β”‚   β”‚   └── web_overlay.py
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ events.py
β”‚   β”‚   β”œβ”€β”€ harmonic_keys.py
β”‚   β”‚   β”œβ”€β”€ helpers.py
β”‚   β”‚   β”œβ”€β”€ logger.py
β”‚   β”‚   β”œβ”€β”€ midi_helper.py
β”‚   β”‚   β”œβ”€β”€ song_matcher.py
β”‚   β”‚   β”œβ”€β”€ spout_sender_helper.py
β”‚   β”‚   β”œβ”€β”€ stats.py
β”‚   β”‚   └── traktor.py
β”‚   β”œβ”€β”€ version.py
β”œβ”€β”€ docs/
β”‚   └── TODO-Main.md
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ app_icon.ico
β”‚   β”œβ”€β”€ icon.png
β”‚   └── screenshots/
β”œβ”€β”€ web_overlay/
β”‚   β”œβ”€β”€ templates/
β”‚   β”‚   └── default_overlay.html
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
└── TraCord DJ.code-workspace

Note: The ui_qt2/ folder contains the PySide6 GUI. The services/ folder contains bot lifecycle logic. The utils/ folder contains helpers, logging, and Traktor utilities. The data/ and extra_cogs/ folders are generally ignored in releases.

βš™οΈ Discord Cog Loading Behavior

  • All cogs in cogs/ are always loaded and are considered part of the core bot functionality.
  • Any .py files in extra_cogs/ (top-level only) are also loaded as cogs.
  • Errors for missing cogs in extra_cogs are suppressed for a clean dev experience.
  • Use extra_cogs/ for personal, experimental, or private cogs and files. This folder is gitignored by default. Create the folder if it does not exist.

πŸ–ΌοΈ Spout Cover Art Integration (Optional)

This app supports sending cover art to other applications via Spout (Windows only) using Python-SpoutGL.

  • Spout is optional: The rest of the app works even if you do not install SpoutGL.
  • If you click the Spout button in the GUI without SpoutGL installed, you will see a warning message.

Enable Spout support

  1. Install dependencies:

    pip install PyOpenGL glfw
  2. Clone and install Python-SpoutGL:

    git clone https://github.com/jlai/Python-SpoutGL.git
    cd Python-SpoutGL
    pip install .
  3. Delete Python-SpoutGL source files after installation to avoid including them in your own repo:

    cd ..
    Remove-Item -Recurse -Force Python-SpoutGL

Do not include the Python-SpoutGL source in your own repo. Just document these steps for users who want Spout support.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

About

Designed for use with Discord & Traktor. It will allow users to search for songs in your Traktor Collection file and also request songs to play. Integration with Traktor Broadcast feature to display current playing song via Flask websocket, with Artist, Title, Album, Cover Art & other Metdata. Optionally output Cover Art via Spout.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors