Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package cmd |
||
2 | |||
3 | import ( |
||
4 | "github.com/FlameInTheDark/dtbot/bot" |
||
5 | "strings" |
||
6 | ) |
||
7 | |||
8 | func GreetingCommand(ctx *bot.Context) { |
||
|
|||
9 | if len(ctx.Args) > 0 { |
||
10 | switch ctx.Args[0] { |
||
11 | case "add": |
||
12 | if len(ctx.Args) > 1 { |
||
13 | ctx.MetricsCommand("greetings", "add") |
||
14 | ctx.AddGreeting(strings.Join(ctx.Args[1:], " ")) |
||
15 | ctx.ReplyEmbed(ctx.Loc("greetings"), ctx.Loc("greetings_add")) |
||
16 | } else { |
||
17 | ctx.MetricsCommand("greetings", "add_no_text") |
||
18 | ctx.ReplyEmbed(ctx.Loc("greetings"), ctx.Loc("greetings_no_text")) |
||
19 | } |
||
20 | case "remove": |
||
21 | ctx.MetricsCommand("greetings", "remove") |
||
22 | ctx.RemoveGreeting() |
||
23 | case "test": |
||
24 | ctx.ReplyEmbed(ctx.Loc("greetings"), ctx.Loc("greetings_removed")) |
||
25 | } |
||
28 |