| Conditions | 4 |
| Total Lines | 13 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package cmd |
||
| 10 | func SlapCommand(ctx bot.Context) { |
||
| 11 | if len(ctx.Args) > 0 { |
||
| 12 | ctx.MetricsCommand("fun", "slap") |
||
| 13 | url, err := fun.GetImageURL("slap") |
||
| 14 | if err == nil { |
||
| 15 | user := ctx.GetGuildUser(ctx.Args[0][2 : len(ctx.Args[0])-1]) |
||
| 16 | var mention = ctx.Args[0] |
||
| 17 | if user != nil { |
||
| 18 | mention = user.Username |
||
| 19 | } |
||
| 20 | ctx.ReplyEmbedAttachmentImageURL("", fmt.Sprintf(ctx.Loc("slapping"), ctx.User.Username, mention), url) |
||
|
|
|||
| 21 | } else { |
||
| 22 | fmt.Printf(err.Error()) |
||
| 23 | } |
||
| 43 | } |