types

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToStr

func ToStr(v interface{}) string

Types

type Chat

type Chat struct {
	ChatID   ChatID
	ChatType ChatType
}

func (Chat) IsSuperGroup

func (c Chat) IsSuperGroup() bool

type ChatID

type ChatID = int64

type ChatType

type ChatType string
const SuperGroupType ChatType = "supergroup"

func (ChatType) IsSuperGroup

func (ct ChatType) IsSuperGroup() bool

func (ChatType) String

func (ct ChatType) String() string

type MessageID

type MessageID = int64

type ParseMode

type ParseMode uint8

Four Types: ParseModeNone, ParseModeHTML, ParseModeMarkdown, ParseModeMarkdownV2 Use zero if not need to use escape text

const (
	ParseModeNone ParseMode = iota
	ParseModeHTML
	ParseModeMarkdown
	ParseModeMarkdownV2
)

func (ParseMode) EscapeText

func (m ParseMode) EscapeText(message string) string

Code from https://github.com/go-telegram-bot-api/telegram-bot-api/blob/master/bot.go (Line 729)

type Topic

type Topic struct {
	ChatID   int64         `json:"chatID"`
	ThreadID TopicThreadID `json:"threadID"`
	Name     TopicName     `json:"name"`
}

func NewTopic

func NewTopic(chatID ChatID, topicName TopicName, id TopicThreadID) *Topic

type TopicName

type TopicName = string

type TopicThreadID

type TopicThreadID = uint
const EmptyTopicID TopicThreadID = 0

type Topics

type Topics map[TopicName]*Topic

func (*Topics) GetID

func (t *Topics) GetID(name TopicName) TopicThreadID

func (*Topics) Len

func (t *Topics) Len() int

func (*Topics) Safe

func (t *Topics) Safe(topic *Topic)

Jump to

Keyboard shortcuts

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