a telegram bot for subscribing to ntfy.sh topics
- receiving notifications from ntfy.sh topics using the topic name
- self-hosted ntfy.sh instances
- assuming your instance supports websockets, you can edit the code and replace the base URL of ntfy.sh to point it to your instance
- publishing messages to topics
- this bot uses "Storage Engine" to persist user data across restarts, you need to host an instance of this - it needs a mongoDB instance, I recommend using MongoDB Atlas if you don't have an instance running
- the environment variables needed are:
APP_ENV=prod
- used by loggerAPI_TOKEN
- telegram bot API tokenADMIN_CHAT_ID
-used to notify when subscriber restartsSE_OBJ_ID
- object ID / note name to use on Storage EngineSE_OBJ_PASS
- object / note passwordSE_URL
- base URL of above hosted API (ex: http://127.0.0.1:3003)
- The bot uses it to store data mapping topic name to user ID, thanks to this library I built on top of the storeage engine API, it is very easy to add a backing store for small things like this. If you want to, you can add a proper store into the code base
- To get an idea of how easy this was to add, see diff for
subscription_manager.go
in this commit
- They are - but the bot is built with one instance in mind, adding multiple instances would mean changing the validation, subscription and subscriber manager logic and since I don't have a usecase that requires this, its not supported.