Fork this repository and you can move on to the next step.
How to configure the app:
- You provide the app with some settings of your HoYoLab website cookies.
- You provide the app with your Telegram bot token
- You launch the app and send a message to the bot, and you'll receive your chat ID in response
- You provide the program with your chat id
- If you have configured the card parameters, they will be applied during generation, if not, then the default parameters will be used during generation
- The bot will send you your stats card
Instruction
- I'm using Chrome browser, if you're using a different browser, some names may vary.
- Open the get cookies skript file and copy its contents.
var cookie=start(); var ask=confirm('Cookie: '+cookie+'\n\nClick confirm to copy Cookie.');if(ask==true){copy(cookie);msg=cookie}else{msg='Cancel'} function start() { return "ltoken=" + getCookie("ltoken") + ";ltuid=" + getCookie("ltuid") + ";"; function getCookie(name) { const value = ";" + document.cookie; const parts = value.split("; " + name + "="); if (parts.length === 2) return parts.pop().split(';').shift(); } }
- Go to https://www.hoyolab.com/genshin/ then login.
- Right-click on the page and click on View Code, then click on the Console tab.
- Paste the code you copied in the second paragraph and press Enter.
- In the window that appears, click Ok and the necessary Cookies will be automatically copied to your clipboard.
Instruction
- Open a chat with an official Telegram bot (@botfather) to create your own bot.
- Send the bot the command "/newbot" to initiate the process of creating a new bot
- Come up with a name for your bot, in my case it will be "GenshinCard"
- Now we need to come up with a nickname for the bot, I chose "GenshinCardExampleBot"
- In response, we will receive a message containing a link to your bot and an API token
Instruction
- Let's add Cookies to the variable, for this go to the following path in the cloned repository
Settings -> Secrets -> Actions -> New repository secret
- Enter a variable name and Cookies depending on what you want to set up your repository for.
In the first field you need to specify the name of the variable, in the second field Cookies. See examples below.
- Variable name:
HOYOLAB_COOKIES
, Cookies example:["ltoken=a**************************************B;ltuid=1******2;","ltoken=c**************************************D;ltuid=3******4;","ltoken=e**************************************F;ltuid=5******6;"]
In this case, you need to open square brackets[
list received in the sectionGetting your account's Cookies
, Cookies must be in double quotes"
, separated by commas and then close square brackets]
. - Click the Add secret button to add a variable.
The first two steps are similar, so let's move on to the third 3. Variable name: TG_API
, Secret: 5656875323:AAG9KsVrNg02cvBgIbpUOs18htgaPKQehGw
(the API key of your bot)
Instruction
- Open "Actions" in a new tab because we will still need the current one.
- Create an action that will be executed daily at 06:00 (UTC+8)
Actions -> Card generate -> Run workflow -> Run workflow
- Now go to your telegram bot and run it, if everything is done correctly you will get a message with your ID. Take your time, the bot needs time to install all modules and start. (You can send him any messages to make sure you don't miss a moment when he will be working)
Instruction
Instruction
-
Choose an avatar
Show available avatars (60)
-
Add a secret with the name
CARD_AVATAR
and the avatar parameter of your choice. For example, I choseChongyun
Add a secret with the name CARD_HIDE_ID
and the avatar parameter of your choice. For example, I chose lang_UA
Show parameters
| Parameter | What is he doing | | --------- | ------------------------------------------------------------------------------------------------------ | | `All` | Your name ID will not appear on the card and the bot will send your card without the ID in the message | | `Card` | Your name ID will not appear on the card | | `Message` | The bot will send your card without the ID in the message |Instruction
- Follow the same steps as in section 4. I've made very detailed comments, so you'll always know what the app is doing right now.
- If you did everything correctly, the bot will send you a card to each specified account
- Result (Because telegram compresses the image before sending and changes the format to jpg, the background appears in the card. If you send cards without compression, the format will not change)