Homebrew RELEASE Switch Game Updates: a Telegram bot to check and notify you about game updates

evertonstz

Well-Known Member
OP
Member
Joined
Jan 5, 2019
Messages
208
Trophies
0
Age
27
XP
529
Country
Brazil
What does it do?
This bot is a way for people using incognito/blanking to know when one of their games got a new update. It uses nx-versions maintained by our boy 16BitWonder as a source for update information and Rebirth's titledb.
It was created mainly for personal use and out of necessity, since I keep forgetting to look for updates for my current games.
If you have any games you want to watch for new updates, all you need to do is add their Game ID to the bot and it'll notify you next time these games are updated by their developers.

Why?
Simple: if you don't use Tinfoil and use incognito/blanking, there's no way your console will notify you about new game updates. You can ofc, use NX-Update-Checker, but you'll have to check manually every time in your console. This bot on the other hand will do it automatically for you, all you have to do is feed it the Game IDs you want to watch for new updates, once these are out you'll be notified.

Bugs and caveats
  • User can only add or remove games by using Title ID (both Base ID or UpdateID will work)
  • Maximum 15 games in the watch list per user, in case it's feasible to scale, I'll up this limit
  • The bot was tested to death past two weeks and bugs should be rare, but in case they occur, a huge part of my work was done implementing various types of error handlers, so the bot should notify me automatically about most of them and they should be fixed in no time. Anyhow, I'm always available here on GBATemp in case you have any lasting problems.
Thank yous
Big thank you to 16BitWonder for allowing me to scrape his repositories and for explaining to me how he handles version checking in NX-Update-Checker. Thank you to blawar for providing TitleDB that was used in the first versions and thank you Rebirth Team for the TitleDB repository that's currently being used.

Bot link and source code
The bot can be found here, all you need to use it is a Telegram: https://t.me/switch_updates_bot
Source: https://github.com/evertonstz/telegram_switch_updates_bot





Changelog:
23/08/2020 - Version 0.0.6
  • added ability to mute the bot (inside /settings)
  • added ability to get notifications for every single game in the switch library (inside /settings)
  • some bug fixes
15/08/2020 - Version 0.0.5
  • To the users that watched games before 11 AUGUST: please, make sure to rewatch your games, during database migration I actually fried my SD card and lost the old user database, won't happen again as I now have a proper backup solution in place.
  • new database system is in place: users can now add up to 50 games in their watch list.
  • new command /s: it's used to search the database using game names, it's useful if you want to know a Game ID for certain games. Example: /s mario will return information for any game that has the "mario" word in the name, alongside game id, latest versions and update id. Like this: https://i.imgur.com/Y4Xjkop.png
  • /l command returns a lot more information to the user, including name, game id, update id and latest version number. Like this: https://i.imgur.com/OA20R7t.png
  • use titledb from Rebirth
06/08/2020 - Internal Version 0.0.3
  • TitleDB is finally implemented, when being notified you should see the game's name (in case it's on titledb ofc). This is how you should see it: https://i.imgur.com/9h6fgaZ.png. Titledb is very information rich, so I'm studying implementing a search function so people can search for a Game's ID in case they don't know it.
  • Anywhere in the bot you see a Base ID, Update ID or Version Number, you should be able to quick copy the code just by clicking over it.
  • STABILITY improvements
  • Code should be ready for public release soon
 
Last edited by evertonstz,

CitizenStile

Member
Newcomer
Joined
Oct 18, 2019
Messages
22
Trophies
0
Age
33
XP
350
Country
Canada
I'm very interested to see how this progresses! If/when it has access to even the most basic meta data of the game name I will be jumping onboard :D Thank you for the effort you have put into this project!!!
 

evertonstz

Well-Known Member
OP
Member
Joined
Jan 5, 2019
Messages
208
Trophies
0
Age
27
XP
529
Country
Brazil
I'm very interested to see how this progresses! If/when it has access to even the most basic meta data of the game name I will be jumping onboard :D Thank you for the effort you have put into this project!!!
It's a little complex job making all these databases interact with each other without breaking something, so it'll probably take some weeks before I release this part. For now I'm cleaning some code and trying to iron bugs out so I can release the source code.
 

evertonstz

Well-Known Member
OP
Member
Joined
Jan 5, 2019
Messages
208
Trophies
0
Age
27
XP
529
Country
Brazil
Thank you, a very interesting project of yours!

But that:


..is a VERY LOW limit of watching titles. 100-200 is a bare minimum, with the possible upgrade to 500-1000, for me.

Don't worry, you'll be able to self host the bot once code it's public, I made it pretty easy to change the limit or even remove it. Be prepared to sink some money on servers tho, the bot is not performance friendly at all, it's basically jugling 3 databases and 2 jobqueue's alongside user inputs.

From my servers you'll probably never see this kind of high limit, I'm hosting it from a raspberry pi and I'm just a third world student, I don't have money for servers to keep up with this kind of demand. 15 games imo is a nice compromise because rarely people have more than 15 games installed in their console.
 
Last edited by evertonstz,

evertonstz

Well-Known Member
OP
Member
Joined
Jan 5, 2019
Messages
208
Trophies
0
Age
27
XP
529
Country
Brazil
Are you sure you optimized it well?
Opsie, sorry, I missed your comment. About the optimization, I migrated everything to MongoDB a week ago or so, so things are pretty optimized already compared to the Pickle+SqliteDict implementation I had in the beginning. I'm not a Mongo expert but I think I made database calls as optimized as I could, so much I even upped the limit to 50 games per user. Anyways, there's just so much I can extract from a raspi and no ammount of optimization can work around such underpowered devices. Anyways, if you're able to optimize the code better than I am, I'm open to pull requests at: https://github.com/evertonstz/telegram_switch_updates_bot (there's also documentation there in case you want to run it in your own server)



PSA: To the users that watched games before 11 august: please, make sure to rewatch your games, during database migration I actually fried my SD card and lost the old user database, won't happen again as I now have a proper backup solution in place.
 
Last edited by evertonstz,
  • Like
Reactions: mathew77

cucholix

Banners guy
Member
Joined
Jan 17, 2017
Messages
2,832
Trophies
1
Age
41
XP
3,716
Country
Chile
Yesterday there was an update for Mortal Kombat 11 from ver.1.0.20 to ver.1.0.21. However it wasn’t detected by the Telegram bot.

This is the version that shows today AFTER the update August 29:
01179EA5-88D8-4958-B3BC-6A60AFA598B7.jpeg


This is the info displayed BEFORE the update August 18:
7138F256-0483-4819-914F-1BEE87CAF800.jpeg


As you can see it’s exactly the same.
 
Joined
Mar 17, 2010
Messages
21,254
Trophies
3
Location
Space
XP
10,063
Country
Norway
This is very useful, but I think the bigger issue might be actually finding the updates. The available nsps always seem to be out of date. Sadly there's no easy solution to that. I think that maybe crowdsourcing it with a RCM payload to check for new updates on sysNAND and automatically upload them, and just have people load that payload which chainloads into Hekate or Atmosphere could be effective, but getting enough people to use it might be an issue, since it would slow down boot speed.
 
Last edited by The Real Jdbye,

evertonstz

Well-Known Member
OP
Member
Joined
Jan 5, 2019
Messages
208
Trophies
0
Age
27
XP
529
Country
Brazil
Yesterday there was an update for Mortal Kombat 11 from ver.1.0.20 to ver.1.0.21. However it wasn’t detected by the Telegram bot.

This is the version that shows today AFTER the update August 29:View attachment 223106

This is the info displayed BEFORE the update August 18:
View attachment 223107

As you can see it’s exactly the same.

There are two "points of lag" in the current implementation for how the bot check for updates: 16BitWonder's nx-versions and the delay I use to check his repository (one or two hours). In the case of Mortal Kombat what is causing this problem is that nx-versions didn't picked this update up, probably because when 16Bit's bot scrapped the update information yesterday the update was probably not released yet.
That being said, assuming this is not a bug on nx-versions, the update will probably show up in nx-versions today and be scrapped by my bot a couple hours latter maximum. I'll keep an eye on it just to make sure.

--------------------- MERGED ---------------------------

This is very useful, but I think the bigger issue might be actually finding the updates. The available nsps always seem to be out of date. Sadly there's no easy solution to that. I think that maybe crowdsourcing it with a RCM payload to check for new updates on sysNAND and automatically upload them, and just have people load that payload which chainloads into Hekate or Atmosphere could be effective, but getting enough people to use it might be an issue, since it would slow down boot speed.
I'll DM you some information I have about this.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
    The Real Jdbye @ The Real Jdbye: i install gentoo for fun