This Discord bot automates daily check-ins for Hoyoverse games, including Genshin Impact, Honkai Starrail, and Zenless Zone Zero. By using the bot, users can schedule automated daily check-ins through the Hoyoverse API using their Hoyolab cookies. These cookies do not contain any Personally Identifiable Information (PII).
To use the bot, invite it to your server using one of the following links:
Once the bot is in a server you are part of, follow these steps to register your account:
-
Use the
/registercommand:- This will provide instructions on how to retrieve your Hoyolab cookies.
-
Click the "Register" button:
- Enter your profile nickname and your cookies.
-
Confirmation:
- If successful, your game information will be displayed, confirming your registration.
-
Adding Multiple Profiles:
- You can add multiple profiles if needed by repeating the registration process with different nicknames.
-
Refreshing Expired Cookies:
- Cookies typically expire after about a year.
- To refresh them, use the
/update_profilecommand and provide new cookies.
- Command:
/checkin - Description: Manually performs a check-in for all registered profiles.
- Command:
/register - Description: Starts the registration process for daily check-ins.
- Command:
/update_profile {profile_nickname} {cookies} - Description: Refreshes cookies for an existing profile.
- Command:
/list_profiles - Description: Displays all profiles linked to your Discord account.
- Command:
/delete {profile_nickname} - Description: Removes a profile from the bot's database.
- The bot uses cookies to authenticate with the Hoyoverse API and automate check-ins.
- Please ensure your cookies are valid and properly formatted for the bot to function correctly.
- If you experience any issues or errors, try refreshing your cookies or reach out to the bot administrator.
If you would like to contribute to the project, feel free to submit a pull request or open an issue. Your feedback and contributions are always welcome!
- Node.js (v20.x or higher)
- MongoDB (local or cloud-based)
- Discord Bot Token
- Clone the repository:
git clone https://github.com/NickAwrist/Dailycheckin_Bot - Install dependencies:
npm install - Create a
.envfile in the root directory with the following structureTOKEN=your_discord_bot_token CLIENT_ID=your_discord_bot_client_id BOT_ADMIN_ID=your_discord_user_id MONGODB_URI=your_mongodb_connection_uri DATABASE_NAME=your_mongodb_database_name METRICS_PORT=3001
- Your
.envfile should have the environment type appended to the filename (e.g.,.env.development,.env.production). - You must also have a
.env.encryptionfile with the following structure:This key is used to encrypt and decrypt the cookies stored in the database.ENCRYPTION_KEY=your_32char_encryption_key
- Start the bot:
npm start
Option 1: Using npm
- Start the bot:
npm start
Option 2: Using docker
- Build the Docker image:
docker compose up -d --build - To view logs:
docker logs dailycheckin-bot
- The bot includes a metrics server that provides information on the bot's status and usage via prometheus.
- To access the metrics, visit
http://localhost:3001/metrics(or the specifiedMETRICS_PORT). - A
prometheus.ymlfile is included in the repository for scraping the metrics.