Add user activity
This commit is contained in:
12
commands.go
12
commands.go
@ -122,6 +122,16 @@ func Reboot(b BotCommand) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ActivityReport(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 := "```"
|
statistics := "```"
|
||||||
n := map[int][]string{}
|
n := map[int][]string{}
|
||||||
counter := 0
|
counter := 0
|
||||||
@ -135,7 +145,7 @@ func ActivityReport(b BotCommand) bool {
|
|||||||
sort.Sort(sort.Reverse(sort.IntSlice(a)))
|
sort.Sort(sort.Reverse(sort.IntSlice(a)))
|
||||||
for _, k := range a {
|
for _, k := range a {
|
||||||
for _, s := range n[k] {
|
for _, s := range n[k] {
|
||||||
if counter == 4 {
|
if useCounter && counter == counterStop-1 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
user, err := b.Session.GuildMember(config.GuildID, s)
|
user, err := b.Session.GuildMember(config.GuildID, s)
|
||||||
|
|||||||
Reference in New Issue
Block a user