stats: I am retarded.
This commit is contained in:
parent
1389b5dc40
commit
6ad3dd7ce0
1 changed files with 2 additions and 14 deletions
|
@ -318,22 +318,10 @@ func processWords(message tg.APIMessage) {
|
|||
err := db.Update(func(tx *bolt.Tx) error {
|
||||
b := tx.Bucket([]byte("words"))
|
||||
for _, word := range wordList {
|
||||
if len(word) < 3 {
|
||||
continue
|
||||
}
|
||||
|
||||
data := b.Get([]byte(word))
|
||||
|
||||
var count UserCount
|
||||
if data == nil {
|
||||
count, ok := words[word]
|
||||
if !ok {
|
||||
count = make(UserCount)
|
||||
} else {
|
||||
err := json.Unmarshal(data, &count)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
val, ok := count[message.User.Username]
|
||||
if !ok {
|
||||
val = 0
|
||||
|
|
Reference in a new issue