Air Pollution Telegram Bot
This is a Telegram bot that notifies users when the Air Quality Index (AQI) changes.
Features
- AQI updates: The bot continuously monitors the AQI and sends notifications to users whenever there is a change.
- Location-based tracking: The bot can track the AQI of multiple locations and provide personalized notifications based on user preferences.
- User-friendly interface: The bot provides a simple and intuitive interface for users to interact with and manage their notification settings.
- Support of locales. At the moment partially added russian and belarusian.
Getting Started
To use the Air Pollution Telegram Bot, follow these steps:
- Install Telegram on your device if you haven't already.
- Open https://t.me/AirPollution_Bot or search for the "@AirPollution_Bot" in the Telegram app.
- Start a conversation with the bot and share your location.
- Create a subsription and get AQI updates to be informed about air pollution in your area!
Translation
How to Modify the messages.gotext.json File for a Specific Language (e.g., Belarusian):
- Locate the Language File. Navigate to the folder containing the language files. For Belarusian, the file path should be something like translations/be/messages.gotext.json.
- Open the JSON File: Open the messages.gotext.json file using a text editor.
- Edit Translations: Inside the file, you'll see key-value pairs where each key is an identifier in English, and the value is the corresponding translation in Belarusian.
- Save the File: Once you've made the necessary changes, save the file and create a PR.
Update the translations:
go install golang.org/x/text/cmd/gotext@latest
go generate translations/translations.go
Docker
To build and run the Docker image, use the following commands:
docker build -t airpollutionbot .
docker run -e TELEGRAM_API_TOKEN=<your_telegram_token> -e OWM_API_TOKEN=<your_openweathermap_token> airpollutionbot
Replace <your_telegram_token> and <your_openweathermap_token> with your actual Telegram bot token and OpenWeatherMap API token, respectively.
Deployment to Kubernetes
To deploy the application, follow these steps:
kubectl create secret generic airpollution-bot-token -n airpollutionbot --from-literal=token=<your_telegram_token> --from-literal=owmToken=<your_openweathermap_token>
helm upgrade --install airpollutionbot dist/helm/airpollutionbot -f deploy/values.yaml -n airpollutionbot --create-namespace --set telegramBot.existingSecret=airpollution-bot-token
Contributing
Contributions are welcome! If you have any ideas, bug reports, or feature requests, please open an issue on the GitHub repository.
License
This project is licensed under the MIT License.