telegram

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntityTypeMention     = "mention"
	EntityTypeTextMention = "text_mention"
	EntityTypeHashtag     = "hashtag"
)
View Source
const (
	CommandReported = "dijo"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HashtagEntities

type HashtagEntities []HashtagEntity

func (HashtagEntities) StrHashtags

func (hes HashtagEntities) StrHashtags() []string

type HashtagEntity

type HashtagEntity struct {
	tgbotapi.MessageEntity
	// contains filtered or unexported fields
}

func NewHashtagEntity

func NewHashtagEntity(entity tgbotapi.MessageEntity, text []uint16) (HashtagEntity, error)

func (HashtagEntity) Hashtag

func (me HashtagEntity) Hashtag() []uint16

func (HashtagEntity) HashtagStr

func (me HashtagEntity) HashtagStr() string

type MentionEntity

type MentionEntity struct {
	tgbotapi.MessageEntity
	// contains filtered or unexported fields
}

func NewMentionEntity

func NewMentionEntity(entity tgbotapi.MessageEntity, utf16Text []uint16) (MentionEntity, error)

func (MentionEntity) Username

func (me MentionEntity) Username() []uint16

func (MentionEntity) UsernameStr

func (me MentionEntity) UsernameStr() string

type Message

type Message struct {
	tgbotapi.Message
}

func MessageFromTgbotApiMessage

func MessageFromTgbotApiMessage(message *tgbotapi.Message) (Message, error)

func (Message) Entities

func (m Message) Entities() []tgbotapi.MessageEntity

func (Message) HasHashtag

func (m Message) HasHashtag() bool

func (Message) Hashtags

func (m Message) Hashtags() HashtagEntities

Hashtags returns the list of entities of 'hashtag' type. This solution was taked from https://github.com/go-telegram-bot-api/telegram-bot-api/issues/231

func (Message) IsCaption

func (m Message) IsCaption() bool

IsCaption returns if Message is a "Caption Message"

func (Message) Mentions

func (m Message) Mentions() []MentionEntity

func (Message) PhotoID

func (m Message) PhotoID() string

PhotoID return the message photo ID. If message doesn't have photo return an empty string

func (Message) Utf16Text

func (m Message) Utf16Text() []uint16

Utf16Text returns the message text in Utf-16 (Format using by telegram)

type TelegramBotUpdateHandler

type TelegramBotUpdateHandler struct {
	// contains filtered or unexported fields
}

func NewTelegramBotUpdateHandler

func NewTelegramBotUpdateHandler(
	updateChan tgbotapi.UpdatesChannel,
	forwardToChannels command.ForwardToChannelsHandler,
) TelegramBotUpdateHandler

func (*TelegramBotUpdateHandler) Run

func (t *TelegramBotUpdateHandler) Run()

Jump to

Keyboard shortcuts

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