let mcchunkie do other things
This commit is contained in:
parent
ce6902f0dd
commit
8244cff3df
@ -45,12 +45,15 @@ func (h *Ban) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post str
|
|||||||
re := regexp.MustCompile(h.Re())
|
re := regexp.MustCompile(h.Re())
|
||||||
bans := strings.Split(re.ReplaceAllString(post, "$1"), " ")
|
bans := strings.Split(re.ReplaceAllString(post, "$1"), " ")
|
||||||
|
|
||||||
SendText(c, ev.RoomID, fmt.Sprintf("Banning %d users with %d seconds inbetween bans.", len(bans), speed))
|
go func() {
|
||||||
for _, ban := range bans {
|
SendText(c, ev.RoomID, fmt.Sprintf("Banning %d users with %d seconds inbetween bans.", len(bans), speed))
|
||||||
st := fmt.Sprintf("hammer ban ob user %s spam", ban)
|
for _, ban := range bans {
|
||||||
SendText(c, ev.RoomID, st)
|
st := fmt.Sprintf("hammer ban ob user %s spam", ban)
|
||||||
time.Sleep(time.Second * time.Duration(speed))
|
SendText(c, ev.RoomID, st)
|
||||||
}
|
time.Sleep(time.Second * time.Duration(speed))
|
||||||
|
}
|
||||||
|
SendText(c, ev.RoomID, "Done banning.")
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user