How m685319/space-events-bot works
Space Events Bot is a Telegram interface for space information and daily APOD notifications. Users issue commands or use callbacks; command handling delegates to domain services, which fetch and format APOD, asteroid, launch, or news data for replies. APOD also supports date lookup and a scheduled subscriber broadcast, with subscriptions persisted to the filesystem. The README documents the layered command/action → service → client design; sampled source confirms APOD and asteroid service/client behavior and file-backed subscription persistence. Some command, routing, launch/news, and scheduler wiring is represented from documented capabilities and the tree rather than inspected source.
Main entry points: SpaceTelegramBot.java Bot adapter · ApodNotificationScheduler.java Daily APOD scheduler · command Command handlers · ApodServiceImpl.java APOD logic/cache
Components 22
Telegram Interface
- Bot adapter
src/main/java/com/spacebot/bot/SpaceTelegramBot.java - Command handlers
src/main/java/com/spacebot/bot/command - Callback actions
src/main/java/com/spacebot/bot/action - Inline keyboards
src/main/java/com/spacebot/bot/ui/KeyboardFactory.java - Command cooldown
src/main/java/com/spacebot/service/impl/CommandCooldownServiceImpl.java
Space Information
- APOD commands
src/main/java/com/spacebot/bot/command/ApodCommand.java - Asteroid command
src/main/java/com/spacebot/bot/command/AsteroidsCommand.java - Launch command
src/main/java/com/spacebot/bot/command/LaunchesCommand.java - News command
src/main/java/com/spacebot/bot/command/NewsCommand.java - APOD logic/cache
src/main/java/com/spacebot/service/impl/ApodServiceImpl.java - Asteroid formatting
src/main/java/com/spacebot/service/impl/AsteroidsServiceImpl.java - Launch service
src/main/java/com/spacebot/service/impl/LaunchesServiceImpl.java - News service
src/main/java/com/spacebot/service/impl/NewsServiceImpl.java
External Data
- APOD fetcher
src/main/java/com/spacebot/client/ApodClient.java - Asteroid fetcher
src/main/java/com/spacebot/client/AsteroidsClient.java - Launch fetcher
src/main/java/com/spacebot/client/LaunchesClient.java - News fetcher
src/main/java/com/spacebot/client/NewsClient.java
APOD Notifications
- Subscription service
src/main/java/com/spacebot/service/impl/FileBasedSubscriptionServiceImpl.java - Subscriber file
- Daily APOD scheduler
src/main/java/com/spacebot/scheduler/ApodNotificationScheduler.java
Other components
- Telegram user
- Space data APIs
Connections 22
- Telegram user → Bot adapter: sends updates
- Bot adapter → Command handlers: routes commands
- Bot adapter → Callback actions: routes callbacks
- Bot adapter → Command cooldown: checks cooldown
- Command handlers → Inline keyboards: builds menus
- APOD commands → APOD logic/cache: requests APOD
- Asteroid command → Asteroid formatting: requests asteroids
- Launch command → Launch service: requests launches
- News command → News service: requests news
- APOD logic/cache → APOD fetcher: fetches APOD
- Asteroid formatting → Asteroid fetcher: fetches objects
- Launch service → Launch fetcher: fetches launches
- News service → News fetcher: fetches articles
- APOD fetcher → Space data APIs: retrieves content
- Asteroid fetcher → Space data APIs: queries objects
- Launch fetcher → Space data APIs: queries launches
- News fetcher → Space data APIs: retrieves news
- Command handlers → Subscription service: manages subscriptions
- Daily APOD scheduler → Subscription service: loads subscribers
- Daily APOD scheduler → APOD logic/cache: requests notification
- Subscription service → Subscriber file: reads and writes
- Daily APOD scheduler → Bot adapter: sends notifications