Documentation
¶
Index ¶
Constants ¶
View Source
const (
PER_SEARCH_LIMIT = 12
)
Variables ¶
View Source
var MessageTypeFromString = map[string]MessageType{ "text": MessageTypeText, "photo": MessageTypePhoto, "video": MessageTypeVideo, "document": MessageTypeDocument, "voice": MessageTypeVoice, "audio": MessageTypeAudio, "poll": MessageTypePoll, "story": MessageTypeStory, }
View Source
var MessageTypeToEmoji = map[MessageType]string{ MessageTypeText: "💬", MessageTypePhoto: "🖼️", MessageTypeVideo: "🎥", MessageTypeDocument: "📄", MessageTypeVoice: "🎙️", MessageTypeAudio: "🎵", MessageTypePoll: "📊", MessageTypeStory: "🪟", }
View Source
var (
StickerFileNames = []string{"sticker.webp", "sticker.webm"}
)
Functions ¶
This section is empty.
Types ¶
type MessageDocument ¶
type MessageDocument struct {
// Telegram MessageID
ID int64 `json:"id"`
Type int `json:"type"`
// The original text of the message
Message string `json:"message"`
// The ID of the user who sent the message
UserID int64 `json:"user_id"`
ChatID int64 `json:"chat_id"`
Timestamp int64 `json:"timestamp"`
}
type MessageSearchResponse ¶
type MessageSearchResponse struct {
Hits []SearchHit `json:"hits,omitempty"`
ProcessingTimeMs int64 `json:"processingTimeMs,omitempty"`
Offset int64 `json:"offset,omitempty"`
Limit int64 `json:"limit,omitempty"`
EstimatedTotalHits int64 `json:"estimatedTotalHits,omitempty"`
SemanticHitCount int64 `json:"semanticHitCount,omitempty"`
Raw any
}
type MessageType ¶
type MessageType int
const ( MessageTypeText MessageType = iota MessageTypePhoto MessageTypeVideo MessageTypeDocument MessageTypeVoice MessageTypeAudio MessageTypePoll MessageTypeStory )
type SearchRequest ¶
type SearchRequest struct {
ChatID int64 `json:"chat_id"`
Query string `json:"query"`
ChatIDs []int64 `json:"chat_ids"`
TypeFilters []MessageType `json:"type_filters"`
UserFilters []int64 `json:"user_filters"`
Limit int64 `json:"limit"`
Offset int64 `json:"offset"`
}
func (SearchRequest) FilterExpression ¶ added in v0.6.0
func (r SearchRequest) FilterExpression() string
Click to show internal directories.
Click to hide internal directories.