tgUtils

package
v0.0.0-...-3c1c031 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnyMedia    MessageTrigger = "\agobot_media"
	AnyMsg      MessageTrigger = "\agobot_msg"
	DocumentMsg MessageTrigger = "\agobot_document"
	LocationMsg MessageTrigger = "\agobot_location"
	PhotoMsg    MessageTrigger = "\agobot_photo"
	VenueMsg    MessageTrigger = "\agobot_venue"
	VoiceMsg    MessageTrigger = "\agobot_voice"

	MaxCaptionLength            = 1024
	MaxMessageLength            = 4096
	MaxFilesizeDownload         = 20000000 // Max filesize that can be downloaded from Telegram = 20MB
	MaxFilesizeUpload           = 50000000 // Max filesize that can be uploaded to Telegram = 50MB
	MaxPhotosizeUpload          = 10000000 // Max filesize of photos that can be uploaded to Telegram = 10 MB
	MaxPhotosizeThroughTelegram = 5000000  // Max filesize of photos that Telegram can send automatically = 5 MB

	ChatMemberStatusCreator       = "creator"
	ChatMemberStatusAdministrator = "administrator"

	EntityTextLink    EntityType = "text_link"
	EntityTypeMention EntityType = "mention"
	EntityTypeURL     EntityType = "url"

	ErrBlockedByUser     = "Forbidden: bot was blocked by the user"
	ErrReactionInvalid   = "Bad Request: REACTION_INVALID"
	ErrNotStartedByUser  = "Forbidden: bot can't initiate conversation with a user"
	ErrUserIsDeactivated = "Forbidden: user is deactivated"
)

Variables

This section is empty.

Functions

func AddRectionWithFallback

func AddRectionWithFallback(b *gotgbot.Bot, message *gotgbot.Message, emoji string, opts *ReactionFallbackOpts) error

AddRectionWithFallback adds a reaction to a message. If reactions are disabled, a Fallback message is sent instead

func ContainsMedia

func ContainsMedia(message *gotgbot.Message) bool

func FromGroup

func FromGroup(message gotgbot.MaybeInaccessibleMessage) bool

func GetBestResolution

func GetBestResolution(photo []gotgbot.PhotoSize) *gotgbot.PhotoSize

func IsAdmin

func IsAdmin(user *gotgbot.User) bool

func IsPrivate

func IsPrivate(message *gotgbot.Message) bool

func IsReply

func IsReply(message *gotgbot.Message) bool

func ParseAnyEntityTypes

func ParseAnyEntityTypes(message *gotgbot.Message, only []EntityType) []gotgbot.ParsedMessageEntity

ParseAnyEntityTypes is a simplied version of ParseEntityTypes that accepts a slice instead of a map for entites types that should be parsed. It also uses caption entites when they exist.

Types

type EntityType

type EntityType string

EntityType is one of https://core.telegram.org/bots/api#messageentity

type MessageTrigger

type MessageTrigger string

type ReactionFallbackOpts

type ReactionFallbackOpts struct {
	SendMessageOpts *gotgbot.SendMessageOpts
	Fallback        string
}

Jump to

Keyboard shortcuts

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