Class OpenWeatherMapService
Inheritance
System.Object
OpenWeatherMapService
Namespace: CommonBotLibrary.Services
Assembly: cs.temp.dll.dll
Syntax
public class OpenWeatherMapService : IWeatherService
Constructors
OpenWeatherMapService(String)
Constructs an
Declaration
public OpenWeatherMapService(string apiKey = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | apiKey | Defaults to API key in Tokens if null. |
Methods
GetCurrentWeatherAsync(String, Unit)
Gets current weather data for a city from openweathermap.com
Declaration
public Task<OpenWeatherMapResult> GetCurrentWeatherAsync(string city, Unit units = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | city | The city to lookup weather for. |
Unit | units | The units for temperature, etc. |
Returns
Type | Description |
---|---|
Task<OpenWeatherMapResult> | Current weather conditions. |