Browse Source

Add user activity

master
Gregory Rudolph 3 years ago
parent
commit
0df1fae253
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 12
      commands.go

12
commands.go

@ -122,6 +122,16 @@ func Reboot(b BotCommand) bool { @@ -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 { @@ -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)

Loading…
Cancel
Save