| Conditions | 9 |
| Total Lines | 25 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package cmd |
||
| 11 | func DebugCommand(ctx bot.Context) { |
||
| 12 | ctx.MetricsCommand("debug", "admin") |
||
| 13 | if ctx.GetRoles().ExistsName("bot.admin") { |
||
| 14 | if len(ctx.Args) == 0 { |
||
| 15 | return |
||
| 16 | } |
||
| 17 | switch ctx.Args[0] { |
||
| 18 | case "roles": |
||
| 19 | var roles []string |
||
| 20 | for _, val := range ctx.GetRoles().Roles { |
||
| 21 | roles = append(roles, val.Name) |
||
| 22 | } |
||
| 23 | ctx.ReplyEmbedPM("Debug", strings.Join(roles, ", ")) |
||
| 24 | case "time": |
||
| 25 | ctx.ReplyEmbedPM("Debug", time.Now().String()) |
||
| 26 | case "session": |
||
| 27 | sess := ctx.Sessions.GetByGuild(ctx.Guild.ID) |
||
| 28 | if sess != nil { |
||
| 29 | ctx.ReplyEmbed("Debug", sess.ChannelID) |
||
| 30 | } else { |
||
| 31 | ctx.ReplyEmbed("Debug", "Session is nil") |
||
| 32 | } |
||
| 33 | } |
||
| 34 | } else { |
||
| 35 | ctx.ReplyEmbedPM("Debug", "Not a Admin") |
||
| 36 | } |
||
| 38 |