1 | package cmd |
||
2 | |||
3 | import ( |
||
4 | "github.com/FlameInTheDark/dtbot/api/darksky" |
||
5 | "github.com/FlameInTheDark/dtbot/bot" |
||
6 | ) |
||
7 | |||
8 | // WeatherCommand weather handler |
||
9 | func WeatherCommand(ctx bot.Context) { |
||
10 | ctx.MetricsCommand("weather", "main") |
||
11 | buf, err := darksky.GetWeatherImage(&ctx) |
||
12 | if err != nil { |
||
13 | ctx.Log("Weather", ctx.Guild.ID, err.Error()) |
||
14 | return |
||
15 | } |
||
16 | ctx.ReplyFile("weather.png", buf) |
||
17 | } |
||
18 | |||
19 | // WeatherCommand weather handler |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
20 | func WeatherWeekCommand(ctx bot.Context) { |
||
21 | ctx.MetricsCommand("weather", "week") |
||
22 | buf, err := darksky.GetWeatherWeekImage(&ctx) |
||
23 | if err != nil { |
||
24 | ctx.Log("Weather", ctx.Guild.ID, err.Error()) |
||
25 | return |
||
26 | } |
||
27 | ctx.ReplyFile("weather.png", buf) |
||
28 | } |