Skip to content

About

Hoyolab Automation with Google Docs Script.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

HoyoLab GDS logo

HoyoLab GDS

Independent fork of canaria3406/hoyolab-auto-sign

Important

There is always a risk when using automation software. No one is responsible if anything happens to your account.

Features

  • Auto Check In - Get daily rewards in hoyo games.
  • Discord & Telegram Notifications - Get the daily results on a Discord webhook, a Telegram bot, or both.
  • Update Notifications - Get notified when there is a new release.
  • Code Redeem(WIP) - Redeem codes without you knowing it.

Setup

  1. Go to Google Apps Script and create a new project with your custom name.
  2. Select the editor and paste the content of src/main.js into the default file.
  3. Click + > Script, name the new file config, paste the content of config.example.js into it and fill in your webhook, bot and profiles. All accounts go in the profiles list. Your credentials only live in this file, so updating later means replacing main and nothing else.
  4. Select "main" and click the "Run" button at the top. Grant the necessary permissions and confirm that the configuration is correct (Execution started > completed).
  5. Click the trigger button on the left side and add a new trigger. Select the function to run: main Select the event source: Time-driven Select the type of time based trigger: Day timer Select the time of day: recommended to choose any off-peak time between 0900 to 1500.

Telegram

  1. Create a bot with @BotFather and put its token in telegram.token in your config file.
  2. Put the target chat in telegram.chat_id. For a private chat this is your user ID (message the bot first); for a group or channel add the bot to it and use the number from a t.me/c/<id>/... link with -100 in front. Sending a message and opening https://api.telegram.org/bot<TOKEN>/getUpdates shows the exact ID.
  3. For groups with Topics set thread_id to the topic number, otherwise leave it empty.

Leave token empty to disable Telegram, or discord.url empty to disable Discord.

Notifications

Every run sends one message with the result of each account, labelled with the profile's accountName. On Telegram every message has a button under it that opens the repository.

  • Routine runs (every game checked in, or was already checked in) mention nobody. On Telegram they are also delivered without a notification sound.
  • Runs that need attention (captcha, expired cookie, or any other error from HoyoLab) are delivered with sound on Telegram, and the affected profile's discord_id is mentioned on Discord.
  • Update notices are always delivered as a normal message.

Development

bun i
bun run format # prettier, src folder only
bun run check # eslint + tsc

To push with clasp, copy .clasp.json.example to .clasp.json and fill in your script ID, then copy config.example.js to src/config.js and fill it in. src/config.js is git-ignored so your credentials stay out of the repository, and clasp pushes it together with src/main.js.

Inspirations and Special Thanks

About

Hoyolab Automation with Google Docs Script.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Contributors

Languages