stats: Actually initialize the word maps
This commit is contained in:
parent
0a117e7918
commit
1389b5dc40
1 changed files with 7 additions and 3 deletions
|
@ -325,10 +325,14 @@ func processWords(message tg.APIMessage) {
|
|||
data := b.Get([]byte(word))
|
||||
|
||||
var count UserCount
|
||||
if data == nil {
|
||||
count = make(UserCount)
|
||||
} else {
|
||||
err := json.Unmarshal(data, &count)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
val, ok := count[message.User.Username]
|
||||
if !ok {
|
||||
|
|
Reference in a new issue