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

cmd/funcommand.go   A

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 10
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A cmd.SlapCommand 0 5 3
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