Documentation ¶
Index ¶
- Constants
- func AddRectionWithFallback(b *gotgbot.Bot, message *gotgbot.Message, emoji string, ...) error
- func ContainsMedia(message *gotgbot.Message) bool
- func FromGroup(message gotgbot.MaybeInaccessibleMessage) bool
- func GetBestResolution(photo []gotgbot.PhotoSize) *gotgbot.PhotoSize
- func IsAdmin(user *gotgbot.User) bool
- func IsPrivate(message *gotgbot.Message) bool
- func IsReply(message *gotgbot.Message) bool
- func ParseAnyEntityTypes(message *gotgbot.Message, only []EntityType) []gotgbot.ParsedMessageEntity
- type EntityType
- type MessageTrigger
- type ReactionFallbackOpts
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 GetBestResolution ¶
func GetBestResolution(photo []gotgbot.PhotoSize) *gotgbot.PhotoSize
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 }
Click to show internal directories.
Click to hide internal directories.