teleblog

package
v0.0.0-...-8f6a0aa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChatQuery

func ChatQuery(dao *daos.Dao) *dbx.SelectQuery

func CommentQuery

func CommentQuery(dao *daos.Dao) *dbx.SelectQuery

func CorrectTagValue

func CorrectTagValue(rawValue string) (string, error)

func ExtractTagsFromPost

func ExtractTagsFromPost(post Post) ([]string, error)

func FormHistoryTextWithMarkup

func FormHistoryTextWithMarkup(markup []HistoryMessageTextEntity) string

func FormWebhookTextMarkup

func FormWebhookTextMarkup(srcText string, entities telebot.Entities) (string, error)

func PostQuery

func PostQuery(dao *daos.Dao) *dbx.SelectQuery

func PostTagQuery

func PostTagQuery(dao *daos.Dao) *dbx.SelectQuery

func TagQuery

func TagQuery(dao *daos.Dao) *dbx.SelectQuery

func TgVerificationTokenQuery

func TgVerificationTokenQuery(dao *daos.Dao) *dbx.SelectQuery

func UserQuery

func UserQuery(dao *daos.Dao) *dbx.SelectQuery

func WriteJsonMessage

func WriteJsonMessage(message *telebot.Message) error

Types

type Chat

type Chat struct {
	models.BaseModel

	UserId       string `json:"userId" db:"user_id"`
	LinkedChatId string `json:"linkedChatId" db:"linked_chat_id"`

	TgUsername     string `json:"tgUsername" db:"tg_username"`
	TgChatId       int64  `json:"tgChatId" db:"tg_chat_id"`
	TgType         string `json:"tgType" db:"tg_type"` //  "private" | "group" | "supergroup" | "channel" | "privatechannel"
	TgLinkedChatId int64  `json:"tgLinkedChatId" db:"tg_linked_chat_id"`
}

func (*Chat) TableName

func (m *Chat) TableName() string

type Comment

type Comment struct {
	models.BaseModel

	ChatId             string `json:"chatId" db:"chat_id"`
	PostId             string `json:"postId" db:"post_id"`
	IsTgHistoryMessage bool   `json:"isTgHistoryMessage" db:"is_tg_history_message"`

	Text string `json:"text" db:"text"`

	TgMessageId        int           `json:"tgMessageId" db:"tg_comment_id"`
	TgMessageRaw       types.JsonMap `json:"tgMessageRaw" db:"tg_message_raw"`
	TgReplyToMessageId int           `json:"tgReplyToMessageId" db:"tg_reply_to_message_id"`
}

func (*Comment) TableName

func (m *Comment) TableName() string

type History

type History struct {
	Id       int64            `json:"id"`
	Name     string           `json:"name"`
	Type     string           `json:"type"` // "public_channel" | "public_supergroup"
	Messages []HistoryMessage `json:"messages"`
}

func (*History) GetChatTgId

func (h *History) GetChatTgId() (int64, error)

type HistoryMessage

type HistoryMessage struct {
	Id               int                        `json:"id"`
	Type             string                     `json:"type"` // service | message
	Date             string                     `json:"date"`
	DateUnix         string                     `json:"date_unixtime"`
	Edited           string                     `json:"edited"`
	EditedUnix       string                     `json:"edited_unixtime"`
	From             string                     `json:"from"`
	FromId           string                     `json:"from_id"`
	TextEntities     []HistoryMessageTextEntity `json:"text_entities"`
	File             *string                    `json:"file"`
	Photo            *string                    `json:"photo"`
	ReplyToMessageId int                        `json:"reply_to_message_id"`
	ForwardedFrom    *string                    `json:"forwarded_from"`
}

type HistoryMessageTextEntity

type HistoryMessageTextEntity struct {
	Type telebot.EntityType `json:"type"`
	Text string             `json:"text"`
}

type MarkupByPosition

type MarkupByPosition struct {
	Offset   int
	Priority int
	IsOpen   bool
	Tag      []rune
}

type Post

type Post struct {
	models.BaseModel

	ChatId             string `json:"chatId" db:"chat_id"`
	IsTgMessage        bool   `json:"isTgMessage" db:"is_tg_message"`
	IsTgHistoryMessage bool   `json:"isTgHistoryMessage" db:"is_tg_history_message"`

	Text string `json:"text" db:"text"`

	TgMessageId      int           `json:"tgMessageId" db:"tg_post_id"`
	TgGroupMessageId int           `json:"tgGroupMessageId" db:"tg_group_message_id"`
	TgMessageRaw     types.JsonMap `json:"tgMessageRaw" db:"tg_message_raw"`
}

func (*Post) TableName

func (m *Post) TableName() string

type PostTag

type PostTag struct {
	models.BaseModel

	ChatId string `json:"chatId" db:"chat_id"`
	PostId string `json:"postId" db:"post_id"`
	TagId  string `json:"tagId" db:"tag_id"`
}

func (*PostTag) TableName

func (m *PostTag) TableName() string

type Tag

type Tag struct {
	models.BaseModel

	Value string `json:"value" db:"value"`
}

func (*Tag) TableName

func (m *Tag) TableName() string

type TgVerificationToken

type TgVerificationToken struct {
	models.BaseModel

	UserId   string `json:"userId" db:"user_id"`
	Value    string `json:"value" db:"value"`
	Verified bool   `json:"verified" db:"verified"`
}

func (*TgVerificationToken) TableName

func (m *TgVerificationToken) TableName() string

type User

type User struct {
	models.BaseModel

	Email    string `json:"email" db:"email"`
	Verified bool   `json:"verified" db:"verified"`
	Name     string `json:"name" db:"name"`

	TgUserId   int64  `json:"tgUserId" db:"tg_user_id"`
	TgUsername string `json:"tgUsername" db:"tg_username"`
}

func (*User) TableName

func (m *User) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL