Discover what's visible in the night sky, right from your Telegram messenger π
Features β’ Demo β’ Installation β’ Usage β’ Tech Stack β’ Contributing
SkyWhisper is an intelligent Telegram bot that brings the wonders of astronomy to your fingertips. Simply message the bot with your location, and it will tell you exactly which celestial bodies are visible in your night sky right now!
Using advanced astronomical calculations and AI-powered natural language understanding, SkyWhisper provides:
- πͺ Real-time planetary visibility from your location
- π Moon phase information and viewing times
- β Rise, set, and transit times for celestial objects
- π Best viewing recommendations for each object
- π Telescope observing tips
- Calculate celestial visibility from any coordinates on Earth
- Support for latitude, longitude, and elevation
- Automatic timezone handling
- Natural language understanding powered by DeepSeek via OpenRouter
- Conversational interface - just chat naturally!
- Context-aware recommendations
- Planets: Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune
- Moon: Phase information, illumination percentage, viewing times
- Sun: Position tracking (with safety warnings!)
- Rise/set times and transit calculations
- Altitude, azimuth, and magnitude data
- Instant calculations using the astronomy-engine library
- Workflow-based architecture with Inngest
- Memory persistence for conversation context
- Simple, intuitive chat interface
- Works on all Telegram platforms (mobile, desktop, web)
- No app installation required!
You: Hi! What can I see tonight?
Bot: Hello! I'd be happy to help you discover what's visible in
the night sky! To provide accurate information, I'll need your
location. Could you please share your approximate latitude and
longitude, or just tell me your city?
You: I'm in Patna
Bot: Great! Let me check what's visible from Patna tonight...
Currently 4 celestial bodies are visible: Saturn, Neptune, Mars,
and Mercury!
πͺ Saturn - Currently visible! Best viewing around 8:45 PM when
it's highest in the sky. Perfect for telescope viewing - don't
miss those spectacular rings!
βοΈ Mars - Visible now! Sets in about 3.2 hours. The Red Planet
is showing well tonight.
βΏοΈ Mercury - Morning object: Rises at 5:23 AM. Best viewing 1-2
hours after rise, just before sunrise.
π΅ Neptune - Currently visible but very faint (magnitude 7.8).
You'll need a telescope to spot this one!
Would you like detailed information about any specific object?
- astronomy-engine - Precise astronomical calculations
- @mastra/core - Agent and workflow framework
- @mastra/inngest - Workflow orchestration
- @openrouter/ai-sdk-provider - AI model integration
- ai (Vercel AI SDK) - LLM streaming and tool calling
- Node.js >= 20.9.0
- npm or yarn
- A Telegram Bot Token (Get one from @BotFather)
- OpenRouter API Key (Get one here)
-
Clone the repository
git clone https://github.com/Aryan-git-byte/SkyWhisper.git cd SkyWhisper -
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory:TELEGRAM_BOT_TOKEN=your_telegram_bot_token OPENROUTER_API_KEY=your_openrouter_api_key PORT=5000
-
Start the Inngest dev server
npm run dev:inngest # Or manually: ./scripts/inngest.sh -
Start the application
npm run dev
-
Set up Telegram webhook (for local testing, use ngrok)
# In a new terminal ngrok http 5000 # Then set webhook curl -X POST "https://api.telegram.org/bot<YOUR_BOT_TOKEN>/setWebhook" \ -H "Content-Type: application/json" \ -d '{"url": "https://your-ngrok-url.ngrok.io/webhooks/telegram/action"}'
-
Fork this repository
-
Create a new Web Service on Render
- Connect your GitHub repository
- Use the following settings:
- Build Command:
npm install && npm run build - Start Command:
node scripts/start-render.js - Environment: Node
- Build Command:
-
Set environment variables in Render Dashboard:
TELEGRAM_BOT_TOKEN=your_token OPENROUTER_API_KEY=your_key PORT=10000 NODE_ENV=production MASTRA_HIDE_CLOUD_CTA=true -
Deploy! Render will automatically build and deploy your bot
-
Set Telegram webhook to your Render URL:
curl -X POST "https://api.telegram.org/bot<YOUR_BOT_TOKEN>/setWebhook" \ -H "Content-Type: application/json" \ -d '{"url": "https://your-app.onrender.com/webhooks/telegram/action"}'
The bot can be deployed to any Node.js hosting platform. Key requirements:
- Node.js 20.9.0 or higher
- Persistent file system for SQLite (or configure PostgreSQL)
- Support for long-running processes (for Inngest server)
-
Start a conversation
/startor simply say "Hi!"
-
Ask about visibility
What can I see in the sky tonight? What planets are visible? I'm in [your city] -
Get specific information
When does Jupiter rise? Tell me about Saturn What phase is the Moon?
- π Provide your location for accurate calculations
- π Ask about specific celestial objects for detailed info
- π Mention if you have a telescope for specialized tips
- π Check Moon phase for best stargazing nights
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Telegram User β
ββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Telegram Bot API (Webhook) β
ββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Mastra Server (Hono) β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Telegram Trigger Handler β β
β ββββββββββββββββββ¬ββββββββββββββββββββββββββββββ β
ββββββββββββββββββββΌβββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Inngest Workflow Engine β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β celestialTelegramWorkflow β β
β β β β
β β Step 1: useCelestialAgent β β
β β ββ Call Celestial Agent β β
β β ββ Use celestialVisibilityTool β β
β β ββ Generate AI response β β
β β β β
β β Step 2: sendTelegramReply β β
β β ββ Send message back to user β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Celestial Agent β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β DeepSeek LLM (via OpenRouter) β β
β β + celestialVisibilityTool β β
β β + Conversation Memory (SQLite) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Astronomy Engine Library β
β (Planetary calculations & ephemeris data) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Telegram Trigger: Receives webhook events from Telegram
- Mastra Workflow: Orchestrates the bot's response pipeline
- Celestial Agent: AI-powered assistant with astronomy knowledge
- Visibility Tool: Performs astronomical calculations
- Memory System: Maintains conversation context
| Variable | Description | Required | Default |
|---|---|---|---|
TELEGRAM_BOT_TOKEN |
Your Telegram bot token from @BotFather | β Yes | - |
OPENROUTER_API_KEY |
API key for OpenRouter (DeepSeek) | β Yes | - |
PORT |
Port for the web server | β No | 5000 |
NODE_ENV |
Environment (development/production) | β No | development |
MASTRA_HIDE_CLOUD_CTA |
Hide Mastra cloud promotions | β No | false |
Edit src/mastra/agents/celestialAgent.ts:
model: openrouter("deepseek/deepseek-chat"), // Change thisAvailable models on OpenRouter:
openai/gpt-4-turboanthropic/claude-3-opusgoogle/gemini-pro
Customize the agent's personality and behavior in src/mastra/agents/celestialAgent.ts:
instructions: `Your custom instructions here...`Create tools in src/mastra/tools/ and register them with the agent.
npm run checknpm run formatcurl -X POST http://localhost:5000/webhooks/telegram/action \
-H "Content-Type: application/json" \
-d '{
"message": {
"message_id": 1,
"from": {"id": 123456789, "first_name": "Test"},
"chat": {"id": 123456789, "type": "private"},
"date": 1234567890,
"text": "Hi"
}
}'Contributions are welcome! Here's how you can help:
- π Report bugs
- π‘ Suggest new features
- π Improve documentation
- π§ Submit pull requests
- β Star the repository
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Use Prettier for formatting:
npm run format - Add comments for complex logic
- Write descriptive commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
- Mastra - Powerful AI agent framework
- astronomy-engine - Accurate astronomical calculations
- OpenRouter - Access to DeepSeek AI
- Telegram - Excellent bot platform
- Render - Free hosting for the bot
Aryan Kumar
- GitHub: @Aryan-git-byte
- Email: aryan17550@gmail.com
If you find this project helpful, please consider:
- β Starring the repository
- π Reporting bugs
- π‘ Suggesting new features
- π’ Sharing with others