nest a function for readable
This commit is contained in:
22
main.go
22
main.go
@@ -49,17 +49,19 @@ func matrixrecv() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
states := map[string]map[config.State]struct{}{}
|
||||
for _, msg := range messages {
|
||||
if _, ok := states[msg.Sender]; ok {
|
||||
continue
|
||||
func() {
|
||||
states := map[string]map[config.State]struct{}{}
|
||||
for _, msg := range messages {
|
||||
if _, ok := states[msg.Sender]; ok {
|
||||
continue
|
||||
}
|
||||
states[msg.Sender] = map[config.State]struct{}{}
|
||||
for _, state := range parseOutStates([]byte(msg.Content)) {
|
||||
states[msg.Sender][state] = struct{}{}
|
||||
}
|
||||
}
|
||||
states[msg.Sender] = map[config.State]struct{}{}
|
||||
for _, state := range parseOutStates([]byte(msg.Content)) {
|
||||
states[msg.Sender][state] = struct{}{}
|
||||
}
|
||||
}
|
||||
setNewStates(states)
|
||||
setNewStates(states)
|
||||
}()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user