Skip to content

About

Automatically monitors for new HoYoLab redemption codes and sends notifications to Discord via webhook.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

18 Commits

Folders and files

Repository files navigation

HoYoLab Code Notifier

Docker Build GitHub release Docker Pulls License: MIT

Automatically monitors for new HoYoLab redemption codes and sends notifications to Discord via webhook.

HoYoLab Code Notifier

Features

  • ๐ŸŽฎ Supports Genshin Impact, Honkai: Star Rail, and Zenless Zone Zero
  • ๐Ÿ”” Multi-Webhook Support - Send to multiple Discord channels with per-webhook game selection
  • โฐ Code Expiration Tracking - See when codes expire with timezone-aware display
  • ๏ฟฝ Code Statistics Dashboard - Track total codes, weekly/monthly stats, and frequency charts
  • ๐Ÿ’› Support Notifications - Send support reminders globally or per-webhook
  • ๐ŸŽญ Game-specific mascot avatars (Paimon, PomPom, Eous) for Discord notifications
  • ๐Ÿ–ผ๏ธ Official HoYoverse game icons in the UI
  • ๐Ÿšซ Duplicate code prevention - never sends the same code twice
  • ๐ŸŒ Modern HoYoLab-inspired web GUI for easy configuration
  • ๐ŸŒ Configurable timezone for expiration display
  • ๐Ÿ“ฆ Export statistics as CSV/JSON
  • ๐Ÿ“ Config file support for manual configuration
  • ๐Ÿณ Docker ready for easy deployment
  • โšก Lightweight and efficient

Quick Start

Using Docker Compose (Recommended)

  1. Clone or copy the project files

  2. Start the container:

    docker-compose up -d
  3. Access the web interface at http://localhost:5050

  4. Configure your Discord webhook URL and enable/disable games

Manual Installation

  1. Install dependencies:

    pip install -r requirements.txt
  2. Run the application:

    python app.py
  3. Access the web interface at http://localhost:5000

Configuration

Via Web GUI

  1. Open the web interface
  2. Set the check interval (minimum 60 seconds)
  3. Configure your timezone for expiration display
  4. Click Add Webhook to add Discord webhooks
  5. For each webhook, toggle which games to receive notifications for
  6. Click "Save" to apply settings

Via Config File

Edit data/config.json:

{
  "webhooks": [
    {
      "name": "Main Server",
      "url": "https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN",
      "games": {
        "genshin": true,
        "starrail": true,
        "zenless": true
      }
    },
    {
      "name": "Genshin Only Channel",
      "url": "https://discord.com/api/webhooks/ANOTHER_WEBHOOK_ID/ANOTHER_TOKEN",
      "games": {
        "genshin": true,
        "starrail": false,
        "zenless": false
      }
    }
  ],
  "check_interval": 300,
  "timezone": "UTC"
}
Option Description
webhooks Array of webhook configurations
webhooks[].name Display name for the webhook
webhooks[].url Discord webhook URL
webhooks[].games Object with game toggles (genshin, starrail, zenless)
check_interval How often to check for new codes (in seconds, minimum 60)
timezone Timezone for expiration display (e.g., "UTC", "Asia/Tokyo", "America/New_York")

Discord Notification Example

When a new code is found, you'll receive a Discord notification with game-specific mascots:

Game Mascot Avatar
Genshin Impact Paimon Official game icon
Honkai: Star Rail PomPom Official game icon
Zenless Zone Zero Eous Official game icon
๐ŸŽ New Code Available for Genshin Impact!

Code: GENSHINGIFT

Rewards: Primogems x60, Mora x10000

โฐ Expires: Jan 15, 2026 at 11:59 PM (UTC)

Redeem Link:
https://genshin.hoyoverse.com/en/gift?code=GENSHINGIFT

API Endpoints

Endpoint Method Description
/ GET Web interface
/api/config GET Get current configuration
/api/config POST Update configuration
/api/status GET Get current status and sent codes
/api/check-now POST Manually trigger code check
/api/webhooks GET List all webhooks
/api/webhooks POST Add a new webhook
/api/webhooks/<index> PUT Update a webhook
/api/webhooks/<index> DELETE Delete a webhook
/api/webhooks/<index>/test POST Test a specific webhook
/api/webhooks/<index>/support POST Send support reminder to webhook
/api/send-support-notification POST Send support reminder to all webhooks
/api/clear-codes POST Clear sent codes history

Statistics (via integrated backend)

The statistics dashboard connects to an integrated backend service for tracking code discovery metrics:

  • Total codes discovered per game
  • Weekly/Monthly code counts
  • Frequency charts showing code discovery over time
  • Export statistics as CSV or JSON

Environment Variables

Variable Default Description
CONFIG_PATH /app/data/config.json Path to config file
CODES_PATH /app/data/sent_codes.json Path to sent codes file
PORT 5000 Web server port

Data Persistence

All data is stored in the data/ directory:

  • config.json - Configuration settings
  • sent_codes.json - History of sent codes (prevents duplicates)

When using Docker, mount this directory as a volume to persist data.

Credits

Code data sourced from api.ennead.cc (maintained by torikushiii)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

If you find this project helpful, consider supporting:

Buy Me A Coffee Ko-Fi PayPal

Star History

Star History Chart

License

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

About

Automatically monitors for new HoYoLab redemption codes and sends notifications to Discord via webhook.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages