From 0df1fae25358b9b9dd59cd10aeb82133919095fc Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Fri, 7 May 2021 08:25:01 -0400 Subject: [PATCH] Add user activity --- commands.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/commands.go b/commands.go index f785aa0..a32f39a 100644 --- a/commands.go +++ b/commands.go @@ -122,6 +122,16 @@ func Reboot(b BotCommand) bool { } func ActivityReport(b BotCommand) bool { + useCounter := true + counterStop := 4 + if len(b.Parts) > 0 { + test, err := strconv.Atoi(b.Parts[0]) + if err == nil { + counterStop = test + } else { + useCounter = false + } + } statistics := "```" n := map[int][]string{} counter := 0 @@ -135,7 +145,7 @@ func ActivityReport(b BotCommand) bool { sort.Sort(sort.Reverse(sort.IntSlice(a))) for _, k := range a { for _, s := range n[k] { - if counter == 4 { + if useCounter && counter == counterStop-1 { return true } user, err := b.Session.GuildMember(config.GuildID, s)