This module provides weather information using the Pirate Weather API.
- Get current weather for any location (city, address, postal code, etc.)
- Stores user's location search string and coordinates in SQLite database
- Rate limited to prevent abuse
- Configurable through YAML configuration
- Supports global locations
weather [location]- Get current weather for a location (location is optional if previously set)
Create a config.yaml file with the following structure:
# Rate limiting configuration
ratelimit:
mode: drop
level: user
limit: 5
interval: 1mMODULE_CONFIG_PATH- Path to the YAML configuration fileMODULE_DATA- Path to the directory where the SQLite database will be storedNATS_HOST- NATS server hostnameNATS_TOKEN- NATS authentication tokenPIRATE_WEATHER_API_KEY- Pirate Weather API key (get one at https://pirateweather.net/)
- When a user provides a location string, it's converted to coordinates using OpenStreetMap Nominatim
- Both the original search string and coordinates are stored in a SQLite database for that user
- Subsequent requests without a location use the stored search string and coordinates
- Weather data is fetched from the Pirate Weather API using the coordinates
You can use various location formats:
- Postal codes (US, Canada, UK, etc.)
- City names ("New York", "London", "Tokyo")
- Addresses ("123 Main St, Anytown, ST")
- Landmarks ("Statue of Liberty", "Eiffel Tower")