A Discord bot that automatically posts daily alerts for licensed light novel digital releases. The bot scrapes data from various official sources (publishers, stores) and notifies your Discord server when new volumes are released.
- Docker & Docker Compose
- Discord Bot Token (Create one here)
-
Clone the repository
git clone https://github.com/AlpinDale/lnrelease-discord-bot cd lnrelease-discord-bot -
Create environment file
Create a
.envfile in the project root:DISCORD_TOKEN=your_discord_bot_token_here BOT_TIMEZONE_DEFAULT=UTC
-
Start the bot
docker-compose up -d
-
View logs
docker-compose logs -f bot
-
Create a Discord Bot
- Go to https://discord.com/developers/applications
- Create a new application
- Go to "Bot" tab and create a bot
- Copy the token and add it to your
.envfile
-
Invite Bot to Your Server
Option A: Simple URL (recommended)
https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=19464&scope=bot%20applications.commandsOption B: If you need
guilds.joinscope (some setups require it)First, add a redirect URI in Developer Portal:
- Go to OAuth2 → General
- Add redirect URI:
http://localhost - Save
Then use this URL:
https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=19464&scope=bot%20applications.commands%20guilds.join&redirect_uri=http%3A%2F%2FlocalhostOption C: Use URL Generator (easiest)
- Go to OAuth2 → URL Generator
- Select scopes:
bot,applications.commands(andguilds.joinif needed) - Select permissions: View Channels, Send Messages, Embed Links, Use Application Commands
- Copy the generated URL
This grants the bot:
- View Channels
- Send Messages
- Embed Links
- Use Application Commands
-
Configure in Discord
In your Discord server, run:
/set_channel #your-channel
| Command | Description | Permissions |
|---|---|---|
/set_channel #channel |
Set the channel for release notifications | Manage Server |
/uncollected [date] |
Show uncollected releases (ephemeral) | None |
/get_releases start_date:YYYY-MM-DD [end_date:YYYY-MM-DD] |
Show all releases for a date or date range | None |
/resync_today |
Manually trigger today's releases | Administrator |
Set notification channel:
/set_channel #releases
View all uncollected releases:
/uncollected
View uncollected for specific date:
/uncollected date:2024-12-25
View all releases for a specific date:
/get_releases start_date:2024-12-25
View all releases for a date range:
/get_releases start_date:2024-12-20 end_date:2024-12-25
Manually trigger today's posts:
/resync_today
-
Every 8 hours, the bot:
- Scrapes release data from official sources (publishers, stores)
- Parses and normalizes the data
- Generates a list of today's digital releases
-
For each configured server, the bot:
- Filters releases to "digital-only" (no physical books or audiobooks)
- Posts new releases that haven't been sent yet
- Tracks sent releases in a SQLite database
-
Users can:
- Click "Done" to mark releases as collected
- Use
/uncollectedto see what they haven't collected yet - Only see releases the bot has actually sent to their server
| Variable | Default | Description |
|---|---|---|
DISCORD_TOKEN |
(required) | Your Discord bot token |
BOT_DB_PATH |
./data/bot.sqlite |
Path to SQLite database file |
BOT_TIMEZONE_DEFAULT |
UTC |
Default timezone for date calculations |
BOT_SCRAPE_INTERVAL_HOURS |
8 |
Hours between scrape cycles (can be decimal, e.g., 0.5 for 30 minutes) |
Common timezone values:
America/New_York- Eastern TimeAmerica/Chicago- Central TimeAmerica/Denver- Mountain TimeAmerica/Los_Angeles- Pacific TimeUTC- Coordinated Universal TimeEurope/London- British TimeAsia/Tokyo- Japan Time
See full list
The bot scrapes from official sources including:
Publishers:
- Cross Infinite World
- Hanashi Media
- J-Novel Club
- Kodansha
- One Peace Books
- Seven Seas Entertainment
- Square Enix
- TOKYOPOP
- VIZ Media
- Yen Press
Stores:
- BOOK☆WALKER
- Crunchyroll
- Apple Books
- Barnes & Noble
- Google Play Books
- Kobo
- And more...
-
Install dependencies
pip install .Or for development with test dependencies:
pip install -e ".[dev]" -
Set environment variables
export DISCORD_TOKEN="your_token_here" export BOT_TIMEZONE_DEFAULT="UTC" export BOT_SCRAPE_INTERVAL_HOURS="8"
-
Run the bot
python -m lnrelease.bot
Set the BOT_SCRAPE_INTERVAL_HOURS environment variable:
export BOT_SCRAPE_INTERVAL_HOURS="12" # Scrape every 12 hoursOr in your .env file:
BOT_SCRAPE_INTERVAL_HOURS=4-
Open the URL in a web browser (not the Discord desktop app)
- Copy the invite URL
- Open it in Chrome, Firefox, Safari, or Edge
- Make sure you're logged into Discord in the browser
-
Check Discord Developer Portal settings:
- Go to https://discord.com/developers/applications
- Select your application
- Go to "OAuth2" → "General"
- Redirect URIs: For bot invites, you don't need any redirect URIs. If the portal requires at least one, add
http://localhost(it won't be used for bot invites) - Go to "Bot" tab and ensure:
- Bot is enabled (toggle at top)
- "Public Bot" can be disabled for personal use
- "Requires OAuth2 Code Grant" should be OFF
-
Try alternative URL formats:
https://discord.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=19464&scope=bot%20applications.commands -
Manual invite via Developer Portal:
- Go to OAuth2 → URL Generator
- Select scopes:
bot,applications.commands - Select permissions: View Channels, Send Messages, Embed Links, Use Application Commands
- Copy the generated URL
- Verify the bot is online (green status in Discord)
- Check bot has necessary permissions in your server
- View logs:
docker-compose logs bot - Ensure slash commands are synced (restart bot if needed)
- The bot only posts digital releases for the current day in your timezone
- Check if there are actually releases today
- Try
/resync_todayto manually trigger - Check logs for scraping errors
- Ensure
data/directory exists and is writable - Check:
ls -la data/should showbot.sqlite - If corrupted, stop bot, backup/delete
data/bot.sqlite, restart
/uncollectedonly shows releases the bot has sent to your server- If you just set up the bot, it will only track new releases going forward
- Old releases aren't retroactively tracked
Start bot:
docker-compose up -dStop bot:
docker-compose downView logs:
docker-compose logs -f botRestart bot:
docker-compose restart botRebuild after code changes:
docker-compose up -d --buildMIT License - See LICENSE file for details
Built on top of the lnrelease project's scraping infrastructure.