torikushiii / hoyolab-auto

Auto check-in and others for any Hoyoverse games
https://ko-fi.com/torikushiii
GNU Affero General Public License v3.0
56 stars 13 forks source link

Dailies Reminder, Check-in and Expedition [ZZZ] #26

Closed JiLleON closed 2 weeks ago

JiLleON commented 2 weeks ago
  1. Expeditions are not supported, it seems. image
  2. Is it normal behavior that a daily reminder reminds you even when all the daily tasks are completed? According to starrail-auto, I remember that the notification came only in the case when it was not done by the time of the reminder image
  3. Shouldn't there be a notification that if the check-in has already been performed today, then send this notification, and not just write about it in the logs? image
JiLleON commented 2 weeks ago

I also noticed that I did not receive a notification that the check-in was made via missed-check-in. There are no logs anymore, but then I had an older version fixed on commit aa70cff. Perhaps this has already been fixed in the current version.

JiLleON commented 2 weeks ago

Btw how correct would it be to leave the code-redeem value at the current check value every minute? Do I understand correctly that requests for code assembly go online every minute? I also don't see anything in the logs that concerns checking for the keywords "shop" or "shop-status"

torikushiii commented 2 weeks ago
  1. Expeditions are not supported, it seems.

I'm pretty sure Zenless Zone Zero does not have expeditions.

  1. Is it normal behavior for a daily reminder to notify you even when all the daily tasks are completed? According to starrail-auto, I remember that the notification only came if the tasks were not done by the time of the reminder.

Oh yeah, that behavior is not expected, and I will fix it in the next commit.

  1. Shouldn't there be a notification that if the check-in has already been performed today, it should send a notification instead of just writing about it in the logs?

This one is intended.

I also noticed that I did not receive a notification that the check-in was made via missed-check-in. There are no logs anymore, but then I had an older version fixed on commit aa70cff. Perhaps this has already been fixed in the current version.

missed-check-in only sends notification via console if you already checked-in, other than that that behavior is intended. And as for you didn't see any logs at all, this cron runs every 11:00 PM before midnight your local time

Btw how correct would it be to leave the code-redeem value at the current check value every minute? Do I understand correctly that requests for code assembly go online every minute?

You're correct, it's running every minute but I do not recommend you to go lower than that because some website will outright block you or rate-limit you.

I also don't see anything in the logs that concerns checking for the keywords "shop" or "shop-status"

This is intended, shop-status will not print anything to the console

JiLleON commented 2 weeks ago

I'm pretty sure Zenless Zone Zero does not have expeditions.

Then the command shouldn't return information that the game supports it. My guess.

Oh yeah, that behavior is not expected, and I will fix it in the next commit.

Thank you!

This one is intended. missed-check-in only sends notification via console if you already checked-in, other than that that behavior is intended.

If I understand you correctly, check-in sends a notification to telegram only when successful. If it detects already signed in today, it will not send a notification to telegram about it. As for missed-check-in, it should also send notification to telegram only on successful execution and no notification if already signed in today. If so, yesterday I didn't get a notification to telegram on successful execution of missed-check-in.

Is it possible to suggest about adding the ability to send already signed in today information to telegram? I see that you have added cron black/whitelists. I would put missed-check-in in blacklist and not get the extra notification. Or you could rewrite the function so that if the bot received an award, the subsequent check-in/missed-check-in would know about it and not send a second notification about it.

And as for you didn't see any logs at all, this cron runs every 11:00 PM before midnight your local time

I apologize, you misunderstood me. I have no logs left then, because I don't save logs behind that container. Only within the actual session.

You're correct, it's running every minute but I do not recommend you to go lower than that because some website will outright block you or rate-limit you.

I implied that once a minute is too often in my opinion. I was surprised that requests were going out every minute, so I thought I'd clarify if that was the case. For myself, I will increase the value to once every half hour.

This is intended, shop-status will not print anything to the console

Okay.

torikushiii commented 2 weeks ago

If I understand you correctly, check-in sends a notification to telegram only when successful. If it detects already signed in today, it will not send a notification to telegram about it.

yep, that is correct

As for missed-check-in, it should also send notification to telegram only on successful execution and no notification if already signed in today.

missed-check-in will not log or send you a notification, even on a successful attempt. The sole purpose of missed-check-in is to silently run in the background and ensure the program doesn't miss any check-ins. But I could change this behavior at check-in if you want.

Is it possible to suggest about adding the ability to send already signed in today information to telegram? I see that you have added cron black/whitelists. I would put missed-check-in in blacklist and not get the extra notification. Or you could rewrite the function so that if the bot received an award, the subsequent check-in/missed-check-in would know about it and not send a second notification about it.

I think I could modify it to return the data and send you a notification if you've already checked in.

JiLleON commented 2 weeks ago

I think I could modify it to return the data and send you a notification if you've already checked in.

https://github.com/torikushiii/hoyolab-auto/blob/main/setup/DISCORD_WEBHOOK.md#discord-webhooks image I expected that everything works the same way as in discord, because in the instructions for telegram there are no pictures with examples of work. If you can add the same behavior as in discord screenshots it would be great.

How about adding a reminder about the Howl Scratch Card? It can drop to 60 polychrome there, so a reminder of it would look relevant. If hoyolab would return coffee status info from the cafe that would be great too.

edit: I see that discord-bot has added the ability to enter promo codes manually. Is it possible to add the same to the telegram bot? Naturally, if you have the desire and time for it. Also it would be great to add a /help command to show what commands are available. There is no mention of available commands in https://github.com/torikushiii/hoyolab-auto/blob/main/setup/TELEGRAM.md. I wanted to know why Zenless Zone Zero is abbreviated as nap? When I checked the commands in telegram I didn't even realize it referred to this game. Maybe I'm not the only one. edit2: I may have realized where the acronym comes from. Okay xd https://github.com/torikushiii/hoyolab-auto/blob/259622cf4fab9913b4e8b72c0123b70e2aeec9ae/hoyolab-modules/zenless.js#L13 https://github.com/torikushiii/hoyolab-auto/blob/35f851d36622712b55baa2fa19a0564da8f3da0a/services/google-script/index.js#L90

torikushiii commented 2 weeks ago

I've added some of your suggestion to the latest commits, such as:

As for Howl Scratch Card, I will add it for the next commit. Howl Scratch Card have been added at this commit: https://github.com/torikushiii/hoyolab-auto/commit/04795b41a136c1c03cac89ec506d7859d00c5c62

Lastly, for redeeming individual code on Telegram, I dont think it will be possible since the current system on Discord is you have a list of the accounts that you can choose

JiLleON commented 2 weeks ago

@torikushiii oh, that's great. Thank you very much for the work you've done, it will make my experience of interacting with the game more enjoyable and easier.

Sends notification if you're already checked-in today

On the ac92fc3 version, I got non-stop notifications in telegram this morning that the login was already done after a successful check-in. I will only be able to re-check this behavior after a server reset. image

I dont think it will be possible since the current system on Discord is you have a list of the accounts that you can choose

If you are interested, I think a simple solution to this problem is to use the command /redeem. In response to the command comes a message to which attached to the buttons with the choice of account, which are in the config. After clicking on the button with the desired account 'StarRail Nickname1 AR 40' or 'Genshin Nickname2 AR 50' the bot will offer to manually send it the required code. https://core.telegram.org/bots/2-0-intro#new-inline-keyboards Or there is a method through inline and entering the command redeem, example, @hoyolab_auto_bot redeem to display the list of accounts on top. Then the user can click on the desired account, enter and submit the desired code. https://telegram.org/blog/inline-bots

torikushiii commented 2 weeks ago

how about this?

image

JiLleON commented 2 weeks ago

@torikushiii looks comfortable.

I will only be able to re-check this behavior after a server reset.

I got the logs. Notifications are sent before the end of the minute. Cron value "check-in": "* 21 1 * * *",. Tested on version from 192dffd. _hoyolab-auto_logs.txt edit: I restarted the container after that and set the check-in time to 7 am as I usually had it set and the situation repeated itself, just not limited to a minute. It seemed to me that the messages would have been coming in for an hour if I hadn't turned it off. Now even if I recreate the container I get a check-in message every second. Changing the check-in time in the cron config to 6 am has stopped this, but only until tomorrow morning.

2024-07-13 07:00:01 <INFO:ZenlessZoneZero:CheckIn> JiLleON already signed in today
...
2024-07-13 07:02:06 <INFO:ZenlessZoneZero:CheckIn> JiLleON already signed in today
torikushiii commented 2 weeks ago

i see the problem, there's an unnecessary asterisk "" at your cron expression, change it into this `"check-in": "21 1 "` and you should be fine.

your current cron expression is set to run every second during 21st minute

JiLleON commented 2 weeks ago

i see the problem, there's an unnecessary asterisk "" at your cron expression, change it into this "check-in": "21 1 " and you should be fine.

Oh, I get it. I didn't pay attention to the default.config.js example. If I need to check shop-status and realm-currency every 15 minutes, it will work fine with this cron value "*/15 * * * *" ? edit: I can see now that everything is working fine. From what I additionally noticed - you should add to the documentation url zenless zone zero https://github.com/torikushiii/hoyolab-auto/blob/main/services/google-script/README.md#1-setup-in-google-apps-script and about the new command /redeem here https://github.com/torikushiii/hoyolab-auto/blob/main/setup/TELEGRAM.md#commands. That's the end of my questions and suggestions. Thank you very much for improving the bot and helping me customize it. You can close this issue when you see fit.

torikushiii commented 2 weeks ago

Oh, I get it. I didn't pay attention to the default.config.js example. If I need to check shop-status and realm-currency every 15 minutes, it will work fine with this cron value "*/15 * * * *" ?

yes, that is correct.

Thank your for the suggestions, I will add the rest of them.