- Python 99.4%
- Shell 0.3%
- Dockerfile 0.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
Build and Push Docker Image / build (push) Successful in 22s
A temporary ".mp3.part" file made ffmpeg refuse the format, so !segue add failed on a normal mp3. |
||
| .forgejo/workflows | ||
| cogs | ||
| data | ||
| plugins | ||
| .dockerignore | ||
| .gitattributes | ||
| .gitignore | ||
| .python-version | ||
| AGENTS.md | ||
| config.py.example | ||
| dave_voice.py | ||
| Dockerfile | ||
| entrypoint.sh | ||
| func.py | ||
| hathor.py | ||
| lastfm_session_gen.py | ||
| LICENSE | ||
| logs.py | ||
| pyproject.toml | ||
| pyrightconfig.json | ||
| README.md | ||
| track_identity.py | ||
| uv.lock | ||
Hathor
A discord music bot.
Hathor offers:
- 🎶 Music playback from YouTube, Spotify, and SoundCloud.
- 🤖 Radio stations generated using AI.
- 🔀 Fuse multiple radio stations together to increase variety.
- 🎤 DJ segues for songs.
- 📑 Queue management (skip, bump, etc).
- 💬 Ask AI.
- 📸 AI image generation.
- 🧐 Have AI generate an image generation prompt.
- 🤬 Responds to "@grok".
- 🧩 Plugin support.
🚀 Installation
1. From Source
git clone https://git.dsabecky.com/nothaldu/hathor.git
cd hathor
uv run python hathor.py
2. From DockerHub
docker pull nothaldu/hathor:latest
docker run -d \
--name hathor \
--restart unless-stopped \
-v /full/path/to/data:/app/data \
-v /full/path/to/db:/app/db \
-v /full/path/to/plugins:/app/plugins \ # optional
nothaldu/hathor:latest
/app/data→ your folder withconfig.pyand JSON/app/db→ your folder for cached music or other persistent files
Age-restricted YouTube videos need a signed-in cookies.txt in that data folder (YOUTUBE_COOKIES = True). The container cannot see your browser. On your computer, sign in to YouTube, export cookies.txt with the "Get cookies.txt LOCALLY" extension, and drag the file into the bot's DMs. You can also copy it yourself to data/cookies.txt on the host.
⚙️ Configuration
-
(From Source only) Copy the example config into your data folder:
mkdir data cp config.py.example data/config.py -
Edit data/config.py:
DISCORD_BOT_TOKEN # Your Discord bot token OPENAI_API_KEY # Your OpenAI API key SPOTIFY_CLIENT_ID # Your Spotify client ID SPOTIFY_CLIENT_SECRET # Your Spotify client secret YOUTUBE_API_KEY # Your Google API key BOT_ADMIN # Your Discord user ID (no quotes)
🔗 (Optional) Last.FM Scrobbling
In data/config.py add:
LASTFM_API_KEY # Your Last.FM API key
LASTFM_API_SECRET # Your Last.FM API secret
LASTFM_SERVER # The server ID to scrobble for
Then generate your session key:
uv run python3 lastfm_session_gen.py
# Follow prompts, then:
uv run python3 lastfm_session_gen.py TOKEN_FROM_PREVIOUS_STEP
# Copy SESSION_KEY back into data/config.py
💬 Commands
Music
- !play <query|url>
- !playnext <query|url>
- !aiplaylist <theme>
- !pause / !resume / !skip
- !queue / !clear / !remove <#> / !bump <#>
- !shuffle / !repeat
Radio
- !radio <theme> / !radio to toggle
- !fuse <theme1> | <theme2> | …
- !defuse <theme>
- !segue / !seg
- !segue list
- !segue add <name> (+ one audio attachment)
- !segue remove <name>
- !segue replace <name> (+ one audio attachment)
- !segue rename <old> | <new>
!segue weight changes are for people with DJ permission. Adding, listing, replacing, renaming, and removing clips is only the owner of that server, or the bot owner. Attach one audio file (30 seconds or less) to !segue add and !segue replace. New clips are used on the next segue, without a restart.
AI
- !chatgpt <prompt>
- !imagine <prompt>
- !gptimagine <prompt>
- !gptedit <prompt> + image attachments
Server Admin
- !join / !leave
- !permissions [add | remove] [channel | role | user ] <ID>
- !volume <1-100>
Bot Owner
- !botservers
- !botleave
- !botsync