mirror of
https://github.com/ultrasn0w/huso.git
synced 2025-12-14 06:09:52 +01:00
Chat feature
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -163,3 +164,10 @@ func FetchProgress(animeId, userId int64, username string, progress int) (int, t
|
||||
// has no progress or dropped/hold
|
||||
return 0, time.Now(), nil
|
||||
}
|
||||
|
||||
func AddToChat(old, new, user string) string {
|
||||
buf := NewRingBuf(chatLength)
|
||||
buf.Write([]byte(old))
|
||||
buf.Write([]byte(fmt.Sprintf("[%s][%s]: %s\n", time.Now().Format("02.01.|15:04:05"), user, new)))
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user