| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | package cmd |
||
| 2 | |||
| 3 | import ( |
||
| 4 | "github.com/FlameInTheDark/dtbot/bot" |
||
| 5 | ) |
||
| 6 | |||
| 7 | // AlbionCommand handle dice |
||
| 8 | func AlbionCommand(ctx bot.Context) { |
||
| 9 | if len(ctx.Args) > 0 { |
||
| 10 | switch ctx.Args[0] { |
||
| 11 | case "kills": |
||
| 12 | if len(ctx.Args) > 1 { |
||
| 13 | ctx.MetricsCommand("albion", "kills") |
||
| 14 | ctx.AlbionShowKills() |
||
| 15 | } |
||
| 16 | case "kill": |
||
| 17 | if len(ctx.Args) > 1 { |
||
| 18 | ctx.MetricsCommand("albion", "kill") |
||
| 19 | ctx.AlbionShowKill() |
||
| 20 | } |
||
| 21 | case "watch": |
||
| 22 | if len(ctx.Args) > 1 { |
||
| 23 | ctx.MetricsCommand("albion", "watch") |
||
| 24 | err := ctx.AlbionAddPlayer() |
||
| 25 | if err != nil { |
||
| 26 | ctx.ReplyEmbed("Albion Killboard", ctx.Loc("albion_add_error")) |
||
| 27 | } else { |
||
| 28 | ctx.ReplyEmbed("Albion Killboard", ctx.Loc("albion_added")) |
||
| 29 | } |
||
| 30 | } |
||
| 31 | case "unwatch": |
||
| 32 | if _,ok := ctx.Albion.Players[ctx.User.ID]; ok { |
||
| 33 | ctx.MetricsCommand("albion", "unwatch") |
||
| 34 | delete(ctx.Albion.Players, ctx.User.ID) |
||
| 35 | ctx.DB.RemoveAlbionPlayer(ctx.User.ID) |
||
| 36 | ctx.ReplyEmbed("Albion Killboard", ctx.Loc("albion_removed")) |
||
| 37 | } else { |
||
| 38 | ctx.ReplyEmbed("Albion Killboard", ctx.Loc("albion_not_watching")) |
||
| 39 | } |
||
| 44 |