Documentation ¶
Index ¶
- Constants
- func Fahrenheit(celsius float64) float64
- func Forecast(place string, forecast ForecastType) (ret string, err error)
- func Geocode(place string, extractState bool) (ret *pb.GeocodingApi_Geoname, err error)
- func Inches(mm float64) float64
- func Mph(kmPerH float64) float64
- type DiscordUI
- type ForecastType
Constants ¶
const ( ColorCmd = "color" JoinCmd = "join" LeaveCmd = "leave" WeatherCmd = "weather" ShutdownCmd = "shutdown" ColorOption = "color" GroupOption = "group" LocationOption = "location" ForecastOption = "forecast" )
Constants related to the bot's discord commands and their options
Variables ¶
This section is empty.
Functions ¶
func Fahrenheit ¶
Fahrenheit converts celsius to fahrenheit
func Forecast ¶
func Forecast(place string, forecast ForecastType) (ret string, err error)
Forecast returns a forecast for a location, or an error if something goes wrong. The forecast parameter specifies the type of forecast we want.
func Geocode ¶
func Geocode(place string, extractState bool) (ret *pb.GeocodingApi_Geoname, err error)
Geocode calls the open-meteo geocoding API to get information a postal code or place name, and returns a struct containing that information unless an error occurred or we failed to find anything. If extractState is true, it splits the place string at a "," if one exists, searches for the left hand side, and looks through the results to try to find one whose geo.Admin1 matches the right hand side.
Types ¶
type DiscordUI ¶
type DiscordUI struct {
// contains filtered or unexported fields
}
DiscordUI holds data needed to interact with Discord.
func NewDiscordUI ¶
NewDiscordUI returns a new DiscordUI object.
type ForecastType ¶
type ForecastType int
ForecastType indicates what type of forecast the user wants.
const ( CurrentForecast ForecastType = iota // The current conditions TodayForecast // Today's forecast WeekForecast // The forecast for the next week )
Constants representing which forecast the user is requesting