Conditions | 6 |
Total Lines | 19 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | package cmd |
||
34 | func FUCommand(ctx bot.Context) { |
||
35 | if len(ctx.Args) > 0 { |
||
36 | ctx.MetricsCommand("fun", "fu") |
||
37 | url, err := fun.GetImageURL("fu") |
||
38 | if err == nil { |
||
39 | if len(ctx.Args) > 0 { |
||
40 | var userID string |
||
41 | if len(ctx.Args[0]) > 3 { |
||
42 | userID = ctx.Args[0][2 : len(ctx.Args[0])-1] |
||
43 | } |
||
44 | user := ctx.GetGuildUser(userID) |
||
45 | var mention = ctx.Args[0] |
||
46 | if user != nil { |
||
47 | mention = user.Username |
||
48 | } |
||
49 | ctx.ReplyEmbedAttachmentImageURL("", fmt.Sprintf(ctx.Loc("send_fu"), ctx.User.Username, mention), url) |
||
50 | } |
||
51 | } else { |
||
52 | fmt.Printf(err.Error()) |
||
53 | } |
||
55 | } |