Passed
Push — master ( a266ab...6dd3ac )
by Viktor
01:47
created

cmd.SlapCommand   A

Complexity

Conditions 3

Size

Total Lines 5
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 5
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
package cmd
2
3
import (
4
	"fmt"
5
	"github.com/FlameInTheDark/dtbot/api/fun"
6
	"github.com/FlameInTheDark/dtbot/bot"
7
)
8
9
// SlapCommand returns slap image
10
func SlapCommand(ctx bot.Context) {
11
	if len(ctx.Args) > 0 {
12
		url, err := fun.GetImageURL("slap")
13
		if err != nil {
14
			ctx.ReplyEmbedAttachmentImageURL(fmt.Sprintf("%v slaping %v", ctx.User.Mention(), ctx.Args[0]), url)
15
		}
16
	}
17
}
18