a telegram bot for subscribing to ntfy.sh topics
- receiving notifications from ntfy.sh topics using the topic name
- publishing messages to topics from telegram
- 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)NTFY_DOMAIN
- just the domain name of ntfy.sh instance (ex: ntfy.sh); one ntfy.tg instance can only support one ntfy.sh instance.- The server must support websockets with a trusted TLS certificate
- 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