Completed
Push — master ( cdc03e...ed8e9c )
by Viktor
02:29 queued 10s
created

cmd.WeatherWeekCommand   A

Complexity

Conditions 2

Size

Total Lines 8
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 7
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
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
comment on exported function WeatherWeekCommand should be of the form "WeatherWeekCommand ..."
Loading history...
20
func WeatherWeekCommand(ctx bot.Context) {
21
	ctx.MetricsCommand("weather", "week")
22
	buf, err := darksky.GetWeatherImage(&ctx)
23
	if err != nil {
24
		ctx.Log("Weather", ctx.Guild.ID, err.Error())
25
		return
26
	}
27
	ctx.ReplyFile("weather.png", buf)
28
}