Empowering weather updates with seamless interactions.
- 📍 Overview
- 👾 Features
- 📁 Project Structure
- 🚀 Getting Started
- 📌 Project Roadmap
- 🔰 Contributing
- 🎗 License
- 🙌 Acknowledgments
**Overview:
Telegram Bot Server simplifies the creation of Telegram bots for weather updates. It offers seamless user management, weather notifications, and uplifting quotes. Ideal for developers building weather-focused bots, it streamlines bot settings, user interactions, and weather data retrieval, enhancing user engagement and experience.
Feature | Summary | |
---|---|---|
⚙️ | Architecture |
|
🔩 | Code Quality |
|
📄 | Documentation |
|
🔌 | Integrations |
|
🧩 | Modularity |
|
🧪 | Testing |
|
⚡️ | Performance |
|
🛡️ | Security |
|
📦 | Dependencies |
|
└── telegram-bot-server/
├── README.md
├── bot
│ ├── index.js
│ ├── services
│ └── utils
├── models
│ ├── BotSetting.js
│ └── User.js
├── package-lock.json
├── package.json
└── server
├── index.js
└── routes
TELEGRAM-BOT-SERVER/
__root__
package-lock.json - The `package-lock.json` file in the `weather-telegram-bot` project manages dependencies such as axios, cors, dotenv, express, jsonwebtoken, and mongoose
- It ensures that the project uses specific versions of these dependencies to maintain stability and consistency in the codebase architecture.package.json - Orchestrates concurrent execution of bot and server scripts using Node.js
- Manages dependencies for Axios, Express, Mongoose, and more
- Designed for a weather Telegram bot project with a modular architecture.
models
BotSetting.js - Defines a schema for bot settings in the project, ensuring a single document always exists
- The schema includes fields for name, bot URL, and weather token
- The static method retrieves the existing document or creates a new one with default values if none exists
- This file plays a crucial role in managing and maintaining bot settings within the codebase architecture.User.js - Defines a user schema for MongoDB using Mongoose, capturing essential user details like chat ID, username, full name, subscription status, and location
- The schema ensures data integrity and uniqueness, forming a crucial part of the project's data model.
server
index.js - Establishes an Express server handling user and bot settings routes, connecting to a MongoDB database named "weather." Utilizes CORS for security and JSON parsing
- The server listens on a specified port, providing API endpoints for user and bot settings interactions.routes
botSettings.js - Handles fetching and updating bot settings, connecting to the database to retrieve and modify configuration data
- The code defines routes for retrieving and updating bot settings, ensuring seamless communication between the frontend and backend systems.users.js - Defines routes for user management operations like fetching, updating, blocking, and deleting users
- Handles requests to interact with the User model, providing endpoints for common user actions such as viewing, modifying, and removing user data
- Facilitates seamless communication between the frontend and backend systems for efficient user management within the application.
bot
index.js - The code in the provided file orchestrates a Telegram bot that enables users to subscribe to weather updates, manage their location settings, and receive periodic weather notifications
- It leverages MongoDB for data storage, integrates with external weather APIs, and utilizes cron jobs for automated updates
- The bot interacts with users through commands and text inputs, ensuring a seamless experience for weather enthusiasts.utils
quotes.js - Generates weather-related quotes based on the current weather condition to provide uplifting messages to users
- The code file 'quotes.js' contains a function that selects a random quote corresponding to the weather condition provided
- This feature enhances user experience by adding a personalized touch to the bot's responses.services
weatherService.js - Implements a weather service function that fetches weather data based on city coordinates using the OpenWeatherMap API
- Handles data retrieval, parsing, and error management to provide a formatted weather report including location, temperature, humidity, and description.
Before getting started with telegram-bot-server, ensure your runtime environment meets the following requirements:
- Programming Language: JavaScript
- Package Manager: Npm
Install telegram-bot-server using one of the following methods:
Build from source:
- Clone the telegram-bot-server repository:
❯ git clone https://github.com/NageshMandal/telegram-bot-server
- Navigate to the project directory:
❯ cd telegram-bot-server
- Install the project dependencies:
❯ npm install
Run telegram-bot-server using the following command:
Using npm
❯ npm start
Run the test suite using the following command:
Using npm
❯ npm test
-
Task 1
:Implement feature one. -
Task 2
: Implement feature two. -
Task 3
: Implement feature three.
- 💬 Join the Discussions: Share your insights, provide feedback, or ask questions.
- 🐛 Report Issues: Submit bugs found or log feature requests for the
telegram-bot-server
project. - 💡 Submit Pull Requests: Review open PRs, and submit your own PRs.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your github account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone https://github.com/NageshMandal/telegram-bot-server
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.'
- Push to github: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
This project is protected under the SELECT-A-LICENSE License. For more details, refer to the LICENSE file.
- List any resources, contributors, inspiration, etc. here.