let mcchunkie do other things

This commit is contained in:
Aaron Bieber 2022-04-03 13:50:25 -06:00
parent ce6902f0dd
commit 8244cff3df

View File

@ -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"), " ")
go func() {
SendText(c, ev.RoomID, fmt.Sprintf("Banning %d users with %d seconds inbetween bans.", len(bans), speed)) SendText(c, ev.RoomID, fmt.Sprintf("Banning %d users with %d seconds inbetween bans.", len(bans), speed))
for _, ban := range bans { for _, ban := range bans {
st := fmt.Sprintf("hammer ban ob user %s spam", ban) st := fmt.Sprintf("hammer ban ob user %s spam", ban)
SendText(c, ev.RoomID, st) SendText(c, ev.RoomID, st)
time.Sleep(time.Second * time.Duration(speed)) time.Sleep(time.Second * time.Duration(speed))
} }
SendText(c, ev.RoomID, "Done banning.")
}()
} }
return nil return nil
} }