Documentation
¶
Index ¶
- func AddAudioRequest(userID int64, username string)
- func AddDownloadError(userID int64, username string)
- func AddUnrecognizedCommand(userID int64, username string)
- func AddVideoRequest(userID int64, username string)
- func GetAllUserChatIDs() ([]int64, error)
- func GetUserCount() (int, error)
- func Init(dir string)
- func RegisterUser(chatID, userID int64, username, firstName, lastName string)
- type BroadcastResult
- type Counts
- type SendMessageFunc
- type Stats
- type UserStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAudioRequest ¶
func AddDownloadError ¶
func AddUnrecognizedCommand ¶
func AddVideoRequest ¶
func GetAllUserChatIDs ¶ added in v1.6.0
GetAllUserChatIDs returns all user chat IDs from the database
func GetUserCount ¶ added in v1.6.0
GetUserCount returns the total number of users
func Init ¶
func Init(dir string)
Init opens and migrates the stats database in the given base directory.
func RegisterUser ¶ added in v1.6.0
RegisterUser updates the sender's profile separately from the broadcast chat. In a group, chatID is the group's ID and userID is the sender's personal ID.
Types ¶
type BroadcastResult ¶ added in v1.6.0
BroadcastResult contains the results of a broadcast operation
func BroadcastMessage ¶ added in v1.6.0
func BroadcastMessage(ctx context.Context, message string, sendFunc SendMessageFunc) *BroadcastResult
BroadcastMessage sends a message to all users
type Counts ¶ added in v1.19.0
type SendMessageFunc ¶ added in v1.6.0
SendMessageFunc is a function type for sending messages
type UserStats ¶ added in v1.19.0
type UserStats struct {
UserID int64 `json:"user_id"`
Username string `json:"username"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Legacy bool `json:"legacy"`
Counts
}
func (UserStats) DisplayName ¶ added in v1.19.0
DisplayName is a label only; aggregation always uses UserID for new events.