Emperor-One / Hamster-Key-Telegram-Bot

Your very own Telegram Bot to generate Hamster Kombat Keys for all available games. It will be updated for new games coming out.
GNU General Public License v3.0
15 stars 9 forks source link

How to run api call client side? #6

Closed avocado-beans closed 2 months ago

avocado-beans commented 3 months ago

Great project. But I was wondering if there was a way to make the requests from the client side instead of the server to avoid a 'too many requests from same ip' kind of error. It would also reduce the load on the server, right?

sfpghjgf commented 3 months ago

That would be cool)

Emperor-One commented 3 months ago

It could be possible if it is restructured as a mini app, something like Hamster Kombat. This would involve creating and running a webserver with a domain name and a TLS cert. The thing is I originally created this with the intention of it being used by me and my friend. I never intended it to be used by an entire channel, for example. Another, simpler, solution for the 429 Error is to use proxies. I could do different IP addresses per key (or per request).

sfpghjgf commented 3 months ago

I’m a noob in programming) How to add a function to this bot that will check whether a person is subscribed to a certain channel?

Emperor-One commented 3 months ago

I’m a noob in programming) How to add a function to this bot that will check whether a person is subscribed to a certain channel?

It's easy. You just have to do a simple check before you allow them to generate keys. There was a fork of this repo that tried to do that. I don't know if they succeeded though.

Emperor-One commented 3 months ago

I know it's a bit late, but I've added proxies for all you channel and group owners.