Passed
Push — master ( 7f7da9...d308f4 )
by Viktor
01:34
created

cmd.AlbionCommand   C

Complexity

Conditions 9

Size

Total Lines 20
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 9
eloc 18
nop 1
dl 0
loc 20
rs 6.6666
c 0
b 0
f 0
1
package cmd
2
3
import (
4
	"github.com/FlameInTheDark/dtbot/bot"
5
)
6
7
// AlbionCommand handle dice
8
func AlbionCommand(ctx bot.Context) {
9
	if len(ctx.Args) > 0 {
10
		switch ctx.Args[0] {
11
		case "kills":
12
			if len(ctx.Args) > 1 {
13
				ctx.MetricsCommand("albion", "kills")
14
				ctx.AlbionShowKills()
15
			}
16
		case "kill":
17
			if len(ctx.Args) > 1 {
18
				ctx.MetricsCommand("albion", "kill")
19
				ctx.AlbionShowKill()
20
			}
21
		case "watch":
22
			if len(ctx.Args) > 1 {
23
				err := ctx.Albion.Add(&ctx)
24
				if err != nil {
25
					ctx.ReplyEmbed("Albion Killboard", ctx.Loc("albion_add_error"))
26
				} else {
27
					ctx.ReplyEmbed("Albion Killboard", ctx.Loc("albion_added"))
28
				}
29
			}
30
		}
31
	}
32
33
}
34