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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
states := map[string]map[config.State]struct{}{}
|
func() {
|
||||||
for _, msg := range messages {
|
states := map[string]map[config.State]struct{}{}
|
||||||
if _, ok := states[msg.Sender]; ok {
|
for _, msg := range messages {
|
||||||
continue
|
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{}{}
|
setNewStates(states)
|
||||||
for _, state := range parseOutStates([]byte(msg.Content)) {
|
}()
|
||||||
states[msg.Sender][state] = struct{}{}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
setNewStates(states)
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user