Documentation ¶
Index ¶
- Variables
- type AdvancedBot
- func (bot *AdvancedBot) AAnswerCallbackQuery(callbackQueryId, text string, showAlert bool, url string, cacheTime int) (*objs.Result[bool], error)
- func (bot *AdvancedBot) AAnswerInlineQuery(id string, cacheTime int, isPersonal bool, ...) *InlineQueryResponder
- func (bot *AdvancedBot) ACopyMessage(messageId int, disableNotif bool, replyTo int, caption, parseMode string, ...) *MessageCopier
- func (bot *AdvancedBot) ACreateAlbum(replyTo, messageThreadId int, allowSendingWihtoutReply bool, keyboard MarkUps) *MediaGroup
- func (bot *AdvancedBot) ACreateInvoice(chatId int, title, description, payload, providerToken, currency string, ...) (*Invoice, error)
- func (bot *AdvancedBot) ACreateInvoiceUN(chatId string, title, description, payload, providerToken, currency string, ...) (*Invoice, error)
- func (bot *AdvancedBot) ACreateLiveLocation(latitude, longitude, accuracy float32, ...) *LiveLocation
- func (bot *AdvancedBot) ASendAnimation(chatId int, replyTo, messageThreadId int, caption, parseMode string, ...) *MediaSender
- func (bot *AdvancedBot) ASendAnimationUN(chatId string, replyTo, messageThreadId int, caption, parseMode string, ...) *MediaSender
- func (bot *AdvancedBot) ASendAudio(chatId, replyTo, messageThreadId int, caption, parseMode string, ...) *MediaSender
- func (bot *AdvancedBot) ASendAudioUN(chatId string, replyTo, messageThreadId int, caption, parseMode string, ...) *MediaSender
- func (bot *AdvancedBot) ASendContact(chatId, replyTo, messageThreadId int, ...) (*objs.Result[*objs.Message], error)
- func (bot *AdvancedBot) ASendContactUN(chatId string, replyTo, messageThreadId int, ...) (*objs.Result[*objs.Message], error)
- func (bot *AdvancedBot) ASendDice(chatId, replyTo, messageThreadId int, emoji string, ...) (*objs.Result[*objs.Message], error)
- func (bot *AdvancedBot) ASendDiceUN(chatId string, replyTo, messageThreadId int, emoji string, ...) (*objs.Result[*objs.Message], error)
- func (bot *AdvancedBot) ASendDocument(chatId, replyTo, messageThreadId int, caption, parseMode string, ...) *MediaSender
- func (bot *AdvancedBot) ASendDocumentUN(chatId string, replyTo, messageThreadId int, caption, parseMode string, ...) *MediaSender
- func (bot *AdvancedBot) ASendGame(chatId int, gameShortName string, silent bool, replyTo int, ...) (*objs.Result[*objs.Message], error)
- func (bot *AdvancedBot) ASendLocation(chatId int, silent, protectContent bool, latitude, longitude, accuracy float32, ...) (*objs.Result[*objs.Message], error)
- func (bot *AdvancedBot) ASendLocationUN(chatId string, silent, protectContent bool, ...) (*objs.Result[*objs.Message], error)
- func (bot *AdvancedBot) ASendMessage(chatId int, text, parseMode string, replyTo, messageThreadId int, ...) (*objs.Result[*objs.Message], error)
- func (bot *AdvancedBot) ASendMesssageUN(chatId, text, parseMode string, replyTo, messageThreadId int, ...) (*objs.Result[*objs.Message], error)
- func (bot *AdvancedBot) ASendPhoto(chatId, replyTo, messageThreadId int, caption, parseMode string, ...) *MediaSender
- func (bot *AdvancedBot) ASendPhotoUN(chatId string, replyTo, messageThreadId int, caption, parseMode string, ...) *MediaSender
- func (bot *AdvancedBot) ASendSticker(chatId, replyTo, messageThreadId int, emoji string, ...) *MediaSender
- func (bot *AdvancedBot) ASendStickerUN(chatId string, replyTo, messageThreadId int, emoji string, ...) *MediaSender
- func (bot *AdvancedBot) ASendVenue(chatId, replyTo, messageThreadId int, latitude, longitude float32, ...) (*objs.Result[*objs.Message], error)
- func (bot *AdvancedBot) ASendVenueUN(chatId string, replyTo, messageThreadId int, latitude, longitude float32, ...) (*objs.Result[*objs.Message], error)
- func (bot *AdvancedBot) ASendVideo(chatId int, replyTo, messageThreadId int, caption, parseMode string, ...) *MediaSender
- func (bot *AdvancedBot) ASendVideoNote(chatId int, replyTo, messageThreadId int, caption, parseMode string, ...) *MediaSender
- func (bot *AdvancedBot) ASendVideoNoteUN(chatId string, replyTo, messageThreadId int, caption, parseMode string, ...) *MediaSender
- func (bot *AdvancedBot) ASendVideoUN(chatId string, replyTo, messageThreadId int, caption, parseMode string, ...) *MediaSender
- func (bot *AdvancedBot) ASendVoice(chatId int, replyTo, messageThreadId int, caption, parseMode string, ...) *MediaSender
- func (bot *AdvancedBot) ASendVoiceUN(chatId string, replyTo, messageThreadId int, caption, parseMode string, ...) *MediaSender
- func (bot *AdvancedBot) ASetGameScore(userId, score, chatId, messageId int, force, disableEditMessage bool, ...) (*objs.Result[json.RawMessage], error)
- func (bot *AdvancedBot) AddMiddleware(md func(update *objs.Update, next func()))
- func (bot *AdvancedBot) GetMyDefaultAdministratorRights(forChannels bool) (*objs.Result[*objs.ChatAdministratorRights], error)
- func (bot *AdvancedBot) RegisterChannel(chatId, mediaType string) (*chan *objs.Update, error)
- func (bot *AdvancedBot) SetMyDefaultAdministratorRights(...) (*objs.Result[bool], error)
- func (bot *AdvancedBot) SetPassportDataErrors(userId int, errors []objs.PassportElementError) (*objs.Result[bool], error)
- func (bot *AdvancedBot) UnRegisterChannel(chatId, mediaType string)
- type AnimationEditor
- type AnimationInserter
- func (ai *AnimationInserter) AddByFile(file *os.File) error
- func (ai *AnimationInserter) AddByFileIdOrURL(fileIdOrUrl string)
- func (ai *AnimationInserter) EditThumbnail(fileIdOrURL string)
- func (ai *AnimationInserter) EditThumbnailFile(file *os.File) error
- func (ai *AnimationInserter) SetThumbnail(fileIdOrURL string)
- func (ai *AnimationInserter) SetThumbnailFile(file *os.File) error
- type AudioEditor
- func (ai *AudioEditor) EditByFile(file *os.File) (*objs.Result[json.RawMessage], error)
- func (ai *AudioEditor) EditByFileIdOrURL(fileIdOrUrl string) (*objs.Result[json.RawMessage], error)
- func (ai *AudioEditor) EditThumbnail(fileIdOrURL string)
- func (ai *AudioEditor) EditThumbnailFile(file *os.File) error
- type AudioInserter
- type Bot
- func (bot *Bot) AddHandler(pattern string, handler func(*objs.Update), chatTypes ...string) error
- func (bot *Bot) AdvancedMode() *AdvancedBot
- func (bot *Bot) AnswerCallbackQuery(callbackQueryId, text string, showAlert bool) (*objs.Result[bool], error)
- func (bot *Bot) AnswerInlineQuery(id string, cacheTime int) *InlineQueryResponder
- func (bot *Bot) AnswerPreCheckoutQuery(shippingQueryId string, ok bool, errorMessage string) (*objs.Result[bool], error)
- func (bot *Bot) AnswerShippingQuery(shippingQueryId string, ok bool, shippingOptions []objs.ShippingOption, ...) (*objs.Result[bool], error)
- func (bot *Bot) AnswerWebAppQuery(webAppQueryId string) *InlineQueryResponder
- func (bot *Bot) BanChatMember(chatIdInt int, chatIdString string, userId, untilDate int, revokeMessages bool) (*objs.Result[bool], error)
- func (bot *Bot) BlockUser(user *objs.User)
- func (bot *Bot) CopyMessage(messageId int, disableNotif, protectContent bool) *MessageCopier
- func (bot *Bot) CreateAlbum(replyTo int) *MediaGroup
- func (bot *Bot) CreateChatInviteLink(chatIdInt int, chatIdString, name string, expireDate, memberLimit int, ...) (*objs.Result[*objs.ChatInviteLink], error)
- func (bot *Bot) CreateForumTopic(chatId int, name string, iconColor int, iconCustomEmojiId string) (*objs.Result[*objs.ForumTopic], error)
- func (bot *Bot) CreateForumTopicUN(username, name string, iconColor int, iconCustomEmojiId string) (*objs.Result[*objs.ForumTopic], error)
- func (bot *Bot) CreateInlineKeyboard() *InlineKeyboard
- func (bot *Bot) CreateInvoice(chatId int, title, description, payload, providerToken, currency string) *Invoice
- func (bot *Bot) CreateInvoiceUN(chatId, title, description, payload, providerToken, currency string) *Invoice
- func (bot *Bot) CreateKeyboard(resizeKeyboard, isPersistent, oneTimeKeyboard, selective bool, ...) *Keyboard
- func (bot *Bot) CreateNewStickerSet(userId int, name, title, pngStickerFileIdOrUrl string, pngStickerFile *os.File, ...) (*StickerSet, error)
- func (bot *Bot) CreatePoll(chatId int, question, pollType string) (*Poll, error)
- func (bot *Bot) CreatePollForChannel(chatId, question, pollType string) (*Poll, error)
- func (bot *Bot) CreateStickerSet(userId int, name, title, stickerFormat, stickerType string, ...) *StickerSet
- func (bot *Bot) ForwardMessage(messageId int, disableNotif, protectContent bool) *MessageForwarder
- func (bot *Bot) GetBotManager() *BotManager
- func (bot *Bot) GetChatManagerById(chatId int) *ChatManager
- func (bot *Bot) GetChatManagerByUsrename(userName string) *ChatManager
- func (bot *Bot) GetChatMember(chatIdInt int, chatIdString string, userId int) (*objs.Result[json.RawMessage], error)
- func (bot *Bot) GetChatMenuButton(chatId int64) (*objs.Result[*objs.MenuButton], error)
- func (bot *Bot) GetCommandManager() *CommandsManager
- func (bot *Bot) GetCustomEmojiStickers(IDs []string) (*objs.Result[[]*objs.Sticker], error)
- func (bot *Bot) GetFile(fileId string, download bool, file *os.File) (*objs.File, error)
- func (bot *Bot) GetForumTopicIconStickers() (*objs.Result[[]*objs.Sticker], error)
- func (bot *Bot) GetForumTopicManager(chatId, messageThreadId int) *ForumTopicManager
- func (bot *Bot) GetForumTopicManagerUN(username string, messageThreadId int) *ForumTopicManager
- func (bot *Bot) GetGameHighScores(userId, chatId, messageId int, inlineMessageId string) (*objs.Result[[]*objs.GameHighScore], error)
- func (bot *Bot) GetGeneralForumTopicManager(chatId, messageThreadId int) *GeneralForumTopicManager
- func (bot *Bot) GetGeneralForumTopicManagerUN(username string, messageThreadId int) *GeneralForumTopicManager
- func (bot *Bot) GetMe() (*objs.Result[*objs.User], error)
- func (bot *Bot) GetMsgEditor(chatId int) *MessageEditor
- func (bot *Bot) GetMsgEditorWithUN(chatId string) *MessageEditor
- func (bot *Bot) GetStickerEditor(stickerFileId string) *StickerEditor
- func (bot *Bot) GetStickerSet(name string) (*StickerSet, error)
- func (bot *Bot) GetTextFormatter() *TextFormatter
- func (bot *Bot) GetUpdateChannel() *chan *objs.Update
- func (bot *Bot) GetUserProfilePhotos(userId, offset, limit int) (*objs.Result[*objs.UserProfilePhotos], error)
- func (bot *Bot) PinChatMessage(chatIdInt int, chatIdString string, messageId int, disableNotification bool) (*objs.Result[bool], error)
- func (bot *Bot) Run(autoPause bool) error
- func (bot *Bot) SendAnimation(chatId int, replyTo int, caption, parseMode string, hasSpoiler bool) *MediaSender
- func (bot *Bot) SendAnimationUN(chatId string, replyTo int, caption, parseMode string, hasSpoiler bool) *MediaSender
- func (bot *Bot) SendAudio(chatId, replyTo int, caption, parseMode string) *MediaSender
- func (bot *Bot) SendAudioUN(chatId string, replyTo int, caption, parseMode string) *MediaSender
- func (bot *Bot) SendChatAction(chatId, messageThreadId int, action string) (*objs.Result[*objs.Message], error)
- func (bot *Bot) SendChatActionUN(chatId, action string, messageThreadId int) (*objs.Result[*objs.Message], error)
- func (bot *Bot) SendContact(chatId, replyTo int, phoneNumber, firstName, lastName string, ...) (*objs.Result[*objs.Message], error)
- func (bot *Bot) SendContactUN(chatId string, replyTo int, phoneNumber, firstName, lastName string, ...) (*objs.Result[*objs.Message], error)
- func (bot *Bot) SendDice(chatId, replyTo int, emoji string, silent, protectContent bool) (*objs.Result[*objs.Message], error)
- func (bot *Bot) SendDiceUN(chatId string, replyTo int, emoji string, silent, protectContent bool) (*objs.Result[*objs.Message], error)
- func (bot *Bot) SendDocument(chatId, replyTo int, caption, parseMode string) *MediaSender
- func (bot *Bot) SendDocumentUN(chatId string, replyTo int, caption, parseMode string) *MediaSender
- func (bot *Bot) SendGame(chatId int, gameShortName string, silent bool, replyTo int) (*objs.Result[*objs.Message], error)
- func (bot *Bot) SendLocation(chatId int, silent, protectContent bool, latitude, longitude, accuracy float32, ...) (*objs.Result[*objs.Message], error)
- func (bot *Bot) SendLocationUN(chatId string, silent, protectContent bool, ...) (*objs.Result[*objs.Message], error)
- func (bot *Bot) SendMessage(chatId int, text, parseMode string, replyTo int, silent, protectContent bool) (*objs.Result[*objs.Message], error)
- func (bot *Bot) SendMessageUN(chatId, text, parseMode string, replyTo int, silent, protectContent bool) (*objs.Result[*objs.Message], error)
- func (bot *Bot) SendPhoto(chatId, replyTo int, caption, parseMode string, hasSpoiler bool) *MediaSender
- func (bot *Bot) SendPhotoUN(chatId string, replyTo int, caption, parseMode string, hasSpoiler bool) *MediaSender
- func (bot *Bot) SendSticker(chatId, replyTo int, eomji string) *MediaSender
- func (bot *Bot) SendStickerWithUn(chatId string, replyTo int, eomji string) *MediaSender
- func (bot *Bot) SendVenue(chatId, replyTo int, latitude, longitude float32, title, address string, ...) (*objs.Result[*objs.Message], error)
- func (bot *Bot) SendVenueUN(chatId string, replyTo int, latitude, longitude float32, title, address string, ...) (*objs.Result[*objs.Message], error)
- func (bot *Bot) SendVideo(chatId int, replyTo int, caption, parseMode string, hasSpoiler bool) *MediaSender
- func (bot *Bot) SendVideoNote(chatId int, replyTo int, caption, parseMode string) *MediaSender
- func (bot *Bot) SendVideoNoteUN(chatId string, replyTo int, caption, parseMode string) *MediaSender
- func (bot *Bot) SendVideoUN(chatId string, replyTo int, caption, parseMode string, hasSpoiler bool) *MediaSender
- func (bot *Bot) SendVoice(chatId int, replyTo int, caption, parseMode string) *MediaSender
- func (bot *Bot) SendVoiceUN(chatId string, replyTo int, caption, parseMode string) *MediaSender
- func (bot *Bot) SetCommandChatMenuButton(chatId int64) (*objs.Result[bool], error)
- func (bot *Bot) SetDefaultChatMenuButton(chatId int64) (*objs.Result[bool], error)
- func (bot *Bot) SetGameScore(userId, score, chatId, messageId int) (*objs.Result[json.RawMessage], error)
- func (bot *Bot) SetMyCommands(commands []objs.BotCommand, scope objs.BotCommandScope, languageCode string) (*objs.Result[bool], error)
- func (bot *Bot) SetWebAppChatMenuButton(chatId int64, text, url string) (*objs.Result[bool], error)
- func (bot *Bot) Stop()
- func (bot *Bot) UnbanChatMember(chatIdInt int, chatIdString string, userId int, onlyIfBanned bool) (*objs.Result[bool], error)
- func (bot *Bot) UnpinAllChatMessages(chatIdInt int, chatIdString string) (*objs.Result[bool], error)
- func (bot *Bot) UnpinChatMessage(chatIdInt int, chatIdString string, messageId int) (*objs.Result[bool], error)
- func (bot *Bot) UploadStickerFile(userId int, stickerFormat string, eomjis, keywords []string, ...) (*objs.Result[*objs.File], error)
- func (bot *Bot) VerifyJoin(userID int, UserName string) bool
- type BotManager
- func (bm *BotManager) GetDescription(languageCode string) (*objs.Result[*objs.BotDescription], error)
- func (bm *BotManager) GetMe() (*objs.Result[*objs.User], error)
- func (bm *BotManager) GetName(languageCode string) (*objs.Result[*objs.BotName], error)
- func (bm *BotManager) GetShortDescription(languageCode string) (*objs.Result[*objs.BotDescription], error)
- func (bm *BotManager) SetDescription(description, languageCode string) (*objs.Result[bool], error)
- func (bm *BotManager) SetName(name, languageCode string) (*objs.Result[bool], error)
- func (bm *BotManager) SetShortDescription(shortDescription, languageCode string) (*objs.Result[bool], error)
- type ChatManager
- func (cm *ChatManager) ApproveJoinRequest(userId int) (*objs.Result[bool], error)
- func (cm *ChatManager) BanChatSender(senderChatId int) (*objs.Result[bool], error)
- func (cm *ChatManager) BanMember(userId, untilDate int, revokeMessages bool) (*objs.Result[bool], error)
- func (cm *ChatManager) CreateInviteLink(name string, expireDate, memberLimit int, createsJoinRequest bool) (*objs.Result[*objs.ChatInviteLink], error)
- func (cm *ChatManager) DeclineJoinRequest(userId int) (*objs.Result[bool], error)
- func (cm *ChatManager) DeletePhoto() (*objs.Result[bool], error)
- func (cm *ChatManager) DeleteStickerSet() (*objs.Result[bool], error)
- func (cm *ChatManager) EditInviteLink(inviteLink, name string, expireDate, memberLimit int, createsJoinRequest bool) (*objs.Result[*objs.ChatInviteLink], error)
- func (cm *ChatManager) ExportInviteLink() (*objs.Result[string], error)
- func (cm *ChatManager) GetAdmins() (*objs.Result[[]objs.ChatMemberOwner], error)
- func (cm *ChatManager) GetChatInfo() (*objs.Result[*objs.Chat], error)
- func (cm *ChatManager) GetMember(userid int) (string, error)
- func (cm *ChatManager) GetMembersCount() (*objs.Result[int], error)
- func (cm *ChatManager) Leave() (*objs.Result[bool], error)
- func (cm *ChatManager) PinMessage(messageId int, disableNotif bool) (*objs.Result[bool], error)
- func (cm *ChatManager) PromoteChatMember(userId int, ...) (*objs.Result[bool], error)
- func (cm *ChatManager) RestrictMember(userId int, untilDate int, useIndependentChatPermissions bool, ...) (*objs.Result[bool], error)
- func (cm *ChatManager) RevokeInviteLink(inviteLink string) (*objs.Result[*objs.ChatInviteLink], error)
- func (cm *ChatManager) SetCustomTitle(userId int, customTitle string) (*objs.Result[bool], error)
- func (cm *ChatManager) SetDescription(description string) (*objs.Result[bool], error)
- func (cm *ChatManager) SetGeneralPermissions(useIndependentChatPermissions, canSendMessages, canSendMediaMessages, ... bool) (*objs.Result[bool], error)
- func (cm *ChatManager) SetPhoto(photoFile *os.File) (*objs.Result[bool], error)
- func (cm *ChatManager) SetStickerSet(stickerSetName string) (*objs.Result[bool], error)
- func (cm *ChatManager) SetTitle(title string) (*objs.Result[bool], error)
- func (cm *ChatManager) UnbanChatSender(senderChatId int) (*objs.Result[bool], error)
- func (cm *ChatManager) UnbanMember(userId int, onlyIfBanned bool) (*objs.Result[bool], error)
- func (cm *ChatManager) UnpinAllMessages() (*objs.Result[bool], error)
- func (cm *ChatManager) UnpinMessage(messageId int) (*objs.Result[bool], error)
- type CommandsManager
- func (cm *CommandsManager) AddCommand(command, description string) error
- func (cm *CommandsManager) DeleteCommands(languageCode string) (*objs.Result[bool], error)
- func (cm *CommandsManager) GetCommands(languageCode string) ([]objs.BotCommand, error)
- func (cm *CommandsManager) SetCommands(languageCode string) (*objs.Result[bool], error)
- func (cm *CommandsManager) SetScope(scope string, chatId []byte, userId int) error
- type DocumentEditor
- func (di *DocumentEditor) EditByFile(file *os.File) (*objs.Result[json.RawMessage], error)
- func (di *DocumentEditor) EditByFileIdOrURL(fileIdOrUrl string) (*objs.Result[json.RawMessage], error)
- func (di *DocumentEditor) EditThumbnail(fileIdOrURL string)
- func (di *DocumentEditor) EditThumbnailFile(file *os.File) error
- type DocumentInserter
- type ForumTopicManager
- func (f *ForumTopicManager) Close() (*objs.Result[bool], error)
- func (f *ForumTopicManager) Delete() (*objs.Result[bool], error)
- func (f *ForumTopicManager) Edit(name, iconCustomEmojiId string) (*objs.Result[bool], error)
- func (f *ForumTopicManager) Reopen() (*objs.Result[bool], error)
- func (f *ForumTopicManager) UnpinAllMesages() (*objs.Result[bool], error)
- type GeneralForumTopicManager
- func (f *GeneralForumTopicManager) Close() (*objs.Result[bool], error)
- func (f *GeneralForumTopicManager) Edit(name string) (*objs.Result[bool], error)
- func (f *GeneralForumTopicManager) Hide() (*objs.Result[bool], error)
- func (f *GeneralForumTopicManager) Reopen() (*objs.Result[bool], error)
- func (f *GeneralForumTopicManager) Unhide() (*objs.Result[bool], error)
- func (f *GeneralForumTopicManager) UnpinAllMesages() (*objs.Result[bool], error)
- type InlineKeyboard
- func (in *InlineKeyboard) AddCallbackButton(text, callbackData string, row int)
- func (in *InlineKeyboard) AddCallbackButtonHandler(text, callbackData string, row int, handler func(*objs.Update))
- func (in *InlineKeyboard) AddGameButton(text string, row int)
- func (in *InlineKeyboard) AddLoginURLButton(text, url, forwardText, botUsername string, requestWriteAccess bool, row int)
- func (in *InlineKeyboard) AddPayButton(text string)
- func (in *InlineKeyboard) AddSwitchInlineQueryButton(text, inlineQuery string, row int, currenChat bool)
- func (in *InlineKeyboard) AddSwitchInlineQueryChoseChatButton(text, inlineQuery string, ...)
- func (in *InlineKeyboard) AddURLButton(text, url string, row int)
- func (in *InlineKeyboard) AddWebAppButton(text string, row int, url string)
- type InlineQueryResponder
- func (iqs *InlineQueryResponder) AddArticle(id, title, url, description, thumbUrl string, thumbWidth, thumbHeight int, ...) error
- func (iqs *InlineQueryResponder) AddAudio(id, title, audioURL, caption, parseMode, performer string, audioDuration int, ...) error
- func (iqs *InlineQueryResponder) AddCachedAudio(id, title, audioFileId, caption, parseMode string, ...) error
- func (iqs *InlineQueryResponder) AddCachedDocument(id, title, documentFileId, description, caption, parseMode string, ...) error
- func (iqs *InlineQueryResponder) AddCachedGif(id, title, gifFileId, caption, parseMode string, ...) error
- func (iqs *InlineQueryResponder) AddCachedMpeg4Gif(id, title, mpeg4FileId, caption, parseMode string, ...) error
- func (iqs *InlineQueryResponder) AddCachedPhoto(id, title, photoFileId, description, caption, parseMode string, ...) error
- func (iqs *InlineQueryResponder) AddCachedSticker(id, stickerFileId string, message objs.InputMessageContent, ...) error
- func (iqs *InlineQueryResponder) AddCachedVideo(id, title, videoFileId, caption, description, parseMode string, ...) error
- func (iqs *InlineQueryResponder) AddCachedVoice(id, title, voiceFileId, caption, parseMode string, ...) error
- func (iqs *InlineQueryResponder) AddContact(id, title, thumbUrl, phoneNumber, firstName, lastName, vCard string, ...) error
- func (iqs *InlineQueryResponder) AddDocument(...) error
- func (iqs *InlineQueryResponder) AddGame(id, gameShortName string, keyboard *InlineKeyboard) error
- func (iqs *InlineQueryResponder) AddGif(id, title, gifURL, caption, parseMode, thumbUrl, thumbMIMEType string, ...) error
- func (iqs *InlineQueryResponder) AddLocation(id, title, thumbUrl string, latitude, longitude, horizontalAccuracy float32, ...) error
- func (iqs *InlineQueryResponder) AddMpeg4Gif(id, title, mpeg4URL, caption, parseMode, thumbUrl, thumbMIMEType string, ...) error
- func (iqs *InlineQueryResponder) AddPhoto(id, title, photoURL, description, caption, parseMode, thumbUrl string, ...) error
- func (iqs *InlineQueryResponder) AddVenue(id, title, thumbUrl string, latitude, longitude float32, ...) error
- func (iqs *InlineQueryResponder) AddVideo(...) error
- func (iqs *InlineQueryResponder) AddVoice(id, title, voiceURL, caption, parseMode string, voiceDuration int, ...) error
- func (iqs *InlineQueryResponder) CreateContactMessage(phoneNumber, firstName, lastName, vCard string) objs.InputMessageContent
- func (iqs *InlineQueryResponder) CreateInvoiceMessage(invoice *Invoice) objs.InputMessageContent
- func (iqs *InlineQueryResponder) CreateLocationMessage(latitude, longitude, accuracy float32, ...) objs.InputMessageContent
- func (iqs *InlineQueryResponder) CreateTextMessage(text, parseMode string, entities []objs.MessageEntity, ...) objs.InputMessageContent
- func (iqs *InlineQueryResponder) CreateVenueMessage(latitude, longitude float32, ...) objs.InputMessageContent
- func (iqs *InlineQueryResponder) Send() (interface{}, error)
- func (iqs *InlineQueryResponder) SetButton(text, startParameter, webAppURL string)
- type Invoice
- type Keyboard
- func (kb *Keyboard) AddButton(text string, row int)
- func (kb *Keyboard) AddButtonHandler(text string, row int, handler func(*objs.Update), chatTypes ...string)
- func (kb *Keyboard) AddContactButton(text string, row int)
- func (kb *Keyboard) AddLocationButton(text string, row int)
- func (kb *Keyboard) AddPollButton(text string, row int, pollType string)
- func (kb *Keyboard) AddRequestChatButton(text string, row, requestId int, ...)
- func (kb *Keyboard) AddRequestUserButton(text string, row, requestId int, userIsBot, userIsPremium bool, ...)
- func (kb *Keyboard) AddWebAppButton(text string, row int, url string)
- type LiveLocation
- func (ll *LiveLocation) Edit(latitude, langitude, horizontalAccuracy float32, ...) (*objs.Result[json.RawMessage], error)
- func (ll *LiveLocation) Send(chatId int, silent, protectContent bool) (*objs.Result[*objs.Message], error)
- func (ll *LiveLocation) SendToChannel(chatId string, silent, protectContent bool) (*objs.Result[*objs.Message], error)
- func (ll *LiveLocation) Stop(replyMarkrup objs.InlineKeyboardMarkup) (*objs.Result[json.RawMessage], error)
- type MarkUps
- type MediaGroup
- func (mg *MediaGroup) AddAnimation(caption, parseMode string, width, height, duration int, hasSpoiler bool, ...) (*AnimationInserter, error)
- func (mg *MediaGroup) AddAudio(caption, parseMode, performer, title string, duration int, ...) (*AudioInserter, error)
- func (mg *MediaGroup) AddDocument(caption, parseMode string, disableContentTypeDetection bool, ...) (*DocumentInserter, error)
- func (mg *MediaGroup) AddPhoto(caption, parseMode string, hasSpoiler bool, ...) (*PhotoInserter, error)
- func (mg *MediaGroup) AddVideo(caption, parseMode string, width, height, duration int, ...) (*VideoInserter, error)
- func (mg *MediaGroup) Send(chatId int, silent, protectContent bool) (*objs.Result[[]objs.Message], error)
- func (mg *MediaGroup) SendToChannel(chatId string, silent, protectContent bool) (*objs.Result[[]objs.Message], error)
- type MediaSender
- func (ms *MediaSender) SendByFile(file *os.File, silent, protectContent bool) (*objs.Result[*objs.Message], error)
- func (ms *MediaSender) SendByFileIdOrUrl(fileIdOrUrl string, silent, protectContent bool) (*objs.Result[*objs.Message], error)
- func (ms *MediaSender) SetThumbnail(fileIdOrURL string)
- func (ms *MediaSender) SetThumbnailFile(file *os.File) error
- type MediaType
- type MessageCopier
- func (mf *MessageCopier) CopyFromChannelToChannel(chatId, fromChatId string) (*objs.Result[*objs.Message], error)
- func (mf *MessageCopier) CopyFromChannelToUser(chatId int, fromChatId string) (*objs.Result[*objs.Message], error)
- func (mf *MessageCopier) CopyFromUserToChannel(chatId string, fromChatId int) (*objs.Result[*objs.Message], error)
- func (mf *MessageCopier) CopyFromUserToUser(chatId, fromChatId int) (*objs.Result[*objs.Message], error)
- type MessageEditor
- func (me *MessageEditor) DeletIn(messageId int, delay time.Duration)
- func (me *MessageEditor) DeleteMessage(messageId int) (*objs.Result[bool], error)
- func (me *MessageEditor) EditCaption(messageId int, caption, inlineMessageId, parseMode string, ...) (*objs.Result[json.RawMessage], error)
- func (mg *MessageEditor) EditMediaAnimation(messageId int, caption, parseMode string, width, height, duration int, ...) *AnimationEditor
- func (mg *MessageEditor) EditMediaAudio(messageId int, caption, parseMode, performer, title string, duration int, ...) *AudioEditor
- func (mg *MessageEditor) EditMediaDocument(messageId int, caption, parseMode string, disableContentTypeDetection bool, ...) *DocumentEditor
- func (mg *MessageEditor) EditMediaPhoto(messageId int, caption, parseMode string, captionEntitie []objs.MessageEntity, ...) *PhotoEditor
- func (mg *MessageEditor) EditMediaVideo(messageId int, caption, parseMode string, width, height, duration int, ...) *VideoEditor
- func (me *MessageEditor) EditReplyMarkup(messageId int, inlineMessageId string, keyboard *InlineKeyboard) (*objs.Result[json.RawMessage], error)
- func (me *MessageEditor) EditText(messageId int, text, inlineMessageId, parseMode string, ...) (*objs.Result[json.RawMessage], error)
- type MessageForwarder
- func (mf *MessageForwarder) ForwardFromChannelToChannel(chatId, fromChatId string) (*objs.Result[*objs.Message], error)
- func (mf *MessageForwarder) ForwardFromChannelToUser(chatId int, fromChatId string) (*objs.Result[*objs.Message], error)
- func (mf *MessageForwarder) ForwardFromUserToChannel(chatId string, fromChatId int) (*objs.Result[*objs.Message], error)
- func (mf *MessageForwarder) ForwardFromUserToUser(chatId, fromChatId int) (*objs.Result[*objs.Message], error)
- type PhotoEditor
- type PhotoInserter
- type Poll
- func (p *Poll) AddOption(option string)
- func (p *Poll) GetCorrectOption() int
- func (p *Poll) GetExplanation() string
- func (p *Poll) GetId() string
- func (p *Poll) GetOptions() []string
- func (p *Poll) GetQuestion() string
- func (p *Poll) GetResult() []objs.PollOption
- func (p *Poll) GetTotalVoters() int
- func (p *Poll) GetType() string
- func (p *Poll) GetUpdateChannel() *chan bool
- func (p *Poll) Send(silent, protectContent bool, replyTo int) error
- func (p *Poll) SendAdvanced(replyTo, messageThreadId int, ...) error
- func (p *Poll) SetCloseDate(cd int)
- func (p *Poll) SetCorrectOption(co int)
- func (p *Poll) SetExplanation(explanation, explanationParseMode string, ...)
- func (p *Poll) SetFlags(isClosed, isAnonymous, allowMA bool)
- func (p *Poll) SetOpenPeriod(op int)
- func (p *Poll) Stop() error
- func (p *Poll) Update(poll *objs.Poll) error
- type StickerEditor
- func (se *StickerEditor) Delete() (*objs.Result[bool], error)
- func (se *StickerEditor) SetEmojiList(emojiList []string) (*objs.Result[bool], error)
- func (se *StickerEditor) SetKeywords(keywords []string) (*objs.Result[bool], error)
- func (se *StickerEditor) SetMaskPosition(maskPosition *objs.MaskPosition) (*objs.Result[bool], error)
- type StickerSet
- func (ss *StickerSet) AddAnimatedSticker(tgsFile *os.File, emojies string, maskPosition *objs.MaskPosition) (*objs.Result[bool], error)deprecated
- func (ss *StickerSet) AddNewSticker(fileIdOrURL string, userId int, emojiList, keywords []string, ...) (bool, error)
- func (ss *StickerSet) AddNewStickerByFile(file *os.File, userId int, emojiList, keywords []string, ...) (bool, error)
- func (ss *StickerSet) AddPngSticker(pngPicFileIdOrUrl, emojies string, maskPosition *objs.MaskPosition) (*objs.Result[bool], error)deprecated
- func (ss *StickerSet) AddPngStickerByFile(pngPicFile *os.File, emojies string, maskPosition *objs.MaskPosition) (*objs.Result[bool], error)deprecated
- func (ss *StickerSet) AddSticker(pngStickerFileIdOrUrl string, pngStickerFile *os.File, tgsSticker *os.File, ...) (*objs.Result[bool], error)deprecated
- func (ss *StickerSet) AddVideoSticker(webmFile *os.File, emojies string, maskPosition *objs.MaskPosition) (*objs.Result[bool], error)deprecated
- func (ss *StickerSet) Create() (bool, error)
- func (ss *StickerSet) Delete() (*objs.Result[bool], error)
- func (ss *StickerSet) DeleteStickerFromSet(sticker string) (*objs.Result[bool], error)
- func (ss *StickerSet) GetName() string
- func (ss *StickerSet) GetStickers() []objs.Sticker
- func (ss *StickerSet) GetThumb() *objs.PhotoSize
- func (ss *StickerSet) GetTitle() string
- func (ss *StickerSet) SetStickerPosition(sticker string, position int) (*objs.Result[bool], error)
- func (ss *StickerSet) SetThumb(userId int, thumb string) (*objs.Result[bool], error)
- func (ss *StickerSet) SetThumbByFile(userId int, thumb *os.File) (*objs.Result[bool], error)
- func (ss *StickerSet) SetTitle(title string) (*objs.Result[bool], error)
- type TextFormatter
- func (mf *TextFormatter) AddBold(text string)
- func (mf *TextFormatter) AddBotCommand(text string)
- func (mf *TextFormatter) AddCashtag(text string)
- func (mf *TextFormatter) AddCode(text, language string)
- func (mf *TextFormatter) AddEmail(text string)
- func (mf *TextFormatter) AddHashtag(text string)
- func (mf *TextFormatter) AddItalic(text string)
- func (mf *TextFormatter) AddMention(text string)
- func (mf *TextFormatter) AddNormal(text string)
- func (mf *TextFormatter) AddPhoneNumber(text string)
- func (mf *TextFormatter) AddSpoiler(text string)
- func (mf *TextFormatter) AddStrike(text string)
- func (mf *TextFormatter) AddTextLink(text, url string)
- func (mf *TextFormatter) AddTextMention(text string, user *objs.User)
- func (mf *TextFormatter) AddURL(text string)
- func (mf *TextFormatter) AddUnderline(text string)
- func (mf *TextFormatter) GetEntities() []objs.MessageEntity
- func (mf *TextFormatter) GetText() string
- type VideoEditor
- func (vi *VideoEditor) EditByFile(file *os.File) (*objs.Result[json.RawMessage], error)
- func (vi *VideoEditor) EditByFileIdOrURL(fileIdOrUrl string) (*objs.Result[json.RawMessage], error)
- func (vi *VideoEditor) EditThumbnail(fileIdOrURL string)
- func (vi *VideoEditor) EditThumbnailFile(file *os.File) error
- type VideoInserter
Constants ¶
This section is empty.
Variables ¶
var Polls = make(map[string]*Poll)
Polls contains the pointers to all of the created maps.
Functions ¶
This section is empty.
Types ¶
type AdvancedBot ¶
type AdvancedBot struct {
// contains filtered or unexported fields
}
AdvancedBot is an advanced type of bot which will give you alot more customization for the bot. Methods which are uniquely for advanced bot start with 'A' .
func (*AdvancedBot) AAnswerCallbackQuery ¶
func (bot *AdvancedBot) AAnswerCallbackQuery(callbackQueryId, text string, showAlert bool, url string, cacheTime int) (*objs.Result[bool], error)
AAnswerCallbackQuery can be used to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @Botfather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
func (*AdvancedBot) AAnswerInlineQuery ¶
func (bot *AdvancedBot) AAnswerInlineQuery(id string, cacheTime int, isPersonal bool, nextOffset, switchPmText, switchPmParameter string) *InlineQueryResponder
AAnswerInlineQuery returns an InlineQueryResponder which has several methods for answering an inline query.
--------------------------
Official telegram doc :
Use this method to send answers to an inline query. On success, True is returned. No more than 50 results per query are allowed.
func (*AdvancedBot) ACopyMessage ¶
func (bot *AdvancedBot) ACopyMessage(messageId int, disableNotif bool, replyTo int, caption, parseMode string, captionEntites []objs.MessageEntity, allowSendingWithoutReply bool, keyboard MarkUps) *MessageCopier
ACopyMessage returns a MessageCopier which has several methods for copying a message
func (*AdvancedBot) ACreateAlbum ¶
func (bot *AdvancedBot) ACreateAlbum(replyTo, messageThreadId int, allowSendingWihtoutReply bool, keyboard MarkUps) *MediaGroup
ACreateAlbum creates a MediaGroup for grouping media messages. To ignore replyTo argument, pass 0.
func (*AdvancedBot) ACreateInvoice ¶
func (bot *AdvancedBot) ACreateInvoice(chatId int, title, description, payload, providerToken, currency string, prices []objs.LabeledPrice, maxTipAmount int, suggestedTipAmounts []int, startParameter, providerData, photoURL string, photoSize, photoWidth, photoHeight int, needName, needPhoneNumber, needEmail, needSippingAddress, sendPhoneNumberToProvider, sendEmailToProvider, isFlexible, bool, allowSendingWithoutReply bool, keyboard *InlineKeyboard) (*Invoice, error)
ACreateInvoice returns an InvoiceSender which has several methods for creating and sending an invoice.
This method is suitable for sending this invoice to a chat that has an id, to send the invoice to channels use "ACreateInvoiceUN" method.
func (*AdvancedBot) ACreateInvoiceUN ¶
func (bot *AdvancedBot) ACreateInvoiceUN(chatId string, title, description, payload, providerToken, currency string, prices []objs.LabeledPrice, maxTipAmount int, suggestedTipAmounts []int, startParameter, providerData, photoURL string, photoSize, photoWidth, photoHeight int, needName, needPhoneNumber, needEmail, needSippingAddress, sendPhoneNumberToProvider, sendEmailToProvider, isFlexible, bool, allowSendingWithoutReply bool, keyboard *InlineKeyboard) (*Invoice, error)
ACreateInvoiceUN returns an InvoiceSender which has several methods for creating and sending an invoice.
func (*AdvancedBot) ACreateLiveLocation ¶
func (bot *AdvancedBot) ACreateLiveLocation(latitude, longitude, accuracy float32, livePeriod, heading, proximtyAlertRadius, replyTo, messageThreadId int, allowSendingWihtoutReply bool, keyboard MarkUps) *LiveLocation
ACreateLiveLocation creates a live location which has several methods for managing it.
func (*AdvancedBot) ASendAnimation ¶
func (bot *AdvancedBot) ASendAnimation(chatId int, replyTo, messageThreadId int, caption, parseMode string, captionEntities []objs.MessageEntity, width, height, duration int, allowSendingWihtoutReply, hasSpoiler bool, keyboard MarkUps) *MediaSender
ASendAnimation returns a MediaSender which has several methods for sending an animation. This method is only used for sending an animation to all types of chat except channels. To send a audio to a channel use "SendAnimationUN" method. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
func (*AdvancedBot) ASendAnimationUN ¶
func (bot *AdvancedBot) ASendAnimationUN(chatId string, replyTo, messageThreadId int, caption, parseMode string, captionEntities []objs.MessageEntity, width, height, duration int, allowSendingWihtoutReply, hasSpoiler bool, keyboard MarkUps) *MediaSender
ASendAnimationUN returns a MediaSender which has several methods for sending an animation. This method is only used for sending an animation to channels To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
func (*AdvancedBot) ASendAudio ¶
func (bot *AdvancedBot) ASendAudio(chatId, replyTo, messageThreadId int, caption, parseMode string, captionEntities []objs.MessageEntity, duration int, performer, title string, allowSendingWithoutReply bool, keyboard MarkUps) *MediaSender
ASendAudio returns a MediaSender which has several methods for sending a audio. This method is only used for sending a audio to all types of chat except channels. To send a audio to a channel use "SendAudioUN" method. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
For sending voice messages, use the sendVoice method instead.
func (*AdvancedBot) ASendAudioUN ¶
func (bot *AdvancedBot) ASendAudioUN(chatId string, replyTo, messageThreadId int, caption, parseMode string, captionEntities []objs.MessageEntity, duration int, performer, title string, allowSendingWithoutReply bool, keyboard MarkUps) *MediaSender
ASendAudioUN returns a MediaSender which has several methods for sending a audio. This method is only used for sending a audio to a channels. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
For sending voice messages, use the sendVoice method instead.
func (*AdvancedBot) ASendContact ¶
func (bot *AdvancedBot) ASendContact(chatId, replyTo, messageThreadId int, phoneNumber, firstName, lastName, vCard string, silent, protectContent bool, allowSendingWihtoutReply bool, keyboard MarkUps) (*objs.Result[*objs.Message], error)
ASendContact sends a contact to all types of chat but channels. To send it to channels use "SendContactUN" method.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
---------------------------------
Official telegram doc :
Use this method to send phone contacts. On success, the sent Message is returned.
func (*AdvancedBot) ASendContactUN ¶
func (bot *AdvancedBot) ASendContactUN(chatId string, replyTo, messageThreadId int, phoneNumber, firstName, lastName, vCard string, silent, protectContent bool, allowSendingWihtoutReply bool, keyboard MarkUps) (*objs.Result[*objs.Message], error)
ASendContactUN sends a contact to a channel.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
---------------------------------
Official telegram doc :
Use this method to send phone contacts. On success, the sent Message is returned.
func (*AdvancedBot) ASendDice ¶
func (bot *AdvancedBot) ASendDice(chatId, replyTo, messageThreadId int, emoji string, silent, protectContent bool, allowSendingWihtoutReply bool, keyboard MarkUps) (*objs.Result[*objs.Message], error)
ASendDice sends a dice message to all types of chat but channels. To send it to channels use "SendDiceUN" method.
Available emojies : “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
---------------------------------
Official telegram doc :
Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned
func (*AdvancedBot) ASendDiceUN ¶
func (bot *AdvancedBot) ASendDiceUN(chatId string, replyTo, messageThreadId int, emoji string, silent, protectContent bool, allowSendingWihtoutReply bool, keyboard MarkUps) (*objs.Result[*objs.Message], error)
ASendDiceUN sends a dice message to a channel.
Available emojies : “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
---------------------------------
Official telegram doc :
Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned
func (*AdvancedBot) ASendDocument ¶
func (bot *AdvancedBot) ASendDocument(chatId, replyTo, messageThreadId int, caption, parseMode string, captionEntities []objs.MessageEntity, disableContentTypeDetection, allowSendingWithoutReply bool, keyboard MarkUps) *MediaSender
ASendDocument returns a MediaSender which has several methods for sending a document. This method is only used for sending a document to all types of chat except channels. To send a audio to a channel use "SendDocumentUN" method. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
func (*AdvancedBot) ASendDocumentUN ¶
func (bot *AdvancedBot) ASendDocumentUN(chatId string, replyTo, messageThreadId int, caption, parseMode string, captionEntities []objs.MessageEntity, disableContentTypeDetection, allowSendingWithoutReply bool, keyboard MarkUps) *MediaSender
ASendDocumentUN returns a MediaSender which has several methods for sending a document. This method is only used for sending a document to a channels. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
func (*AdvancedBot) ASendGame ¶
func (bot *AdvancedBot) ASendGame(chatId int, gameShortName string, silent bool, replyTo int, allowSendingWithoutReply bool, keyboard MarkUps) (*objs.Result[*objs.Message], error)
ASendGame sends a game to the chat.
-----------------------
Official telegram doc :
Use this method to send a game. On success, the sent Message is returned.
func (*AdvancedBot) ASendLocation ¶
func (bot *AdvancedBot) ASendLocation(chatId int, silent, protectContent bool, latitude, longitude, accuracy float32, replyTo, messageThreadId int, allowSendingWihtoutReply bool, keyboard MarkUps) (*objs.Result[*objs.Message], error)
ASendLocation sends a location (not live) to all types of chats but channels. To send it to channel use "SendLocationUN" method.
You can not use this methods to send a live location. To send a live location use "ACreateLiveLocation" method.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
---------------------------------
Official telegram doc :
Use this method to send point on the map. On success, the sent Message is returned.
func (*AdvancedBot) ASendLocationUN ¶
func (bot *AdvancedBot) ASendLocationUN(chatId string, silent, protectContent bool, latitude, longitude, accuracy float32, replyTo, messageThreadId int, allowSendingWihtoutReply bool, keyboard MarkUps) (*objs.Result[*objs.Message], error)
ASendLocationUN sends a location (not live) to a channel.
You can not use this methods to send a live location. To send a live location use "ACreateLiveLocation" method.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
---------------------------------
Official telegram doc :
Use this method to send point on the map. On success, the sent Message is returned.
func (*AdvancedBot) ASendMessage ¶
func (bot *AdvancedBot) ASendMessage(chatId int, text, parseMode string, replyTo, messageThreadId int, silent, protectContent bool, entites []objs.MessageEntity, disabelWebPagePreview, allowSendingWithoutReply bool, keyboard MarkUps) (*objs.Result[*objs.Message], error)
ASendMessage sends a text message to a chat (not channel, use SendMessageUN method for sending messages to channles) and returns the sent message on success If you want to ignore "parseMode" pass empty string. To ignore replyTo pass 0.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*AdvancedBot) ASendMesssageUN ¶
func (bot *AdvancedBot) ASendMesssageUN(chatId, text, parseMode string, replyTo, messageThreadId int, silent, protectContent bool, entites []objs.MessageEntity, disabelWebPagePreview, allowSendingWithoutReply bool, keyboard MarkUps) (*objs.Result[*objs.Message], error)
ASendMesssageUN sends a text message to a channel and returns the sent message on success If you want to ignore "parseMode" pass empty string. To ignore replyTo pass 0.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*AdvancedBot) ASendPhoto ¶
func (bot *AdvancedBot) ASendPhoto(chatId, replyTo, messageThreadId int, caption, parseMode string, captionEntites []objs.MessageEntity, allowSendingWithoutReply, hasSpoiler bool, keyboard MarkUps) *MediaSender
ASendPhoto returns a MediaSender which has several methods for sending a photo. This method is only used for sending a photo to all types of chat except channels. To send a photo to a channel use "SendPhotoUN" method. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
func (*AdvancedBot) ASendPhotoUN ¶
func (bot *AdvancedBot) ASendPhotoUN(chatId string, replyTo, messageThreadId int, caption, parseMode string, captionEntites []objs.MessageEntity, allowSendingWithoutReply, hasSpoiler bool, keyboard MarkUps) *MediaSender
ASendPhotoUN returns a MediaSender which has several methods for sending a photo. This method is only used for sending a photo to a channels. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
func (*AdvancedBot) ASendSticker ¶
func (bot *AdvancedBot) ASendSticker(chatId, replyTo, messageThreadId int, emoji string, captionEntites []objs.MessageEntity, allowSendingWithoutReply, hasSpoiler bool, keyboard MarkUps) *MediaSender
ASendSticker returns a MediaSender which has several methods for sending a sticker. This method is only used for sending a sticker to all types of chat except channels. To send a sticker to a channel use "SendStickerUN" method. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
func (*AdvancedBot) ASendStickerUN ¶
func (bot *AdvancedBot) ASendStickerUN(chatId string, replyTo, messageThreadId int, emoji string, captionEntites []objs.MessageEntity, allowSendingWithoutReply, hasSpoiler bool, keyboard MarkUps) *MediaSender
ASendStickerUN returns a MediaSender which has several methods for sending a sticker. This method is only used for sending a sticker to a channels. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
func (*AdvancedBot) ASendVenue ¶
func (bot *AdvancedBot) ASendVenue(chatId, replyTo, messageThreadId int, latitude, longitude float32, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType string, silent bool, allowSendingWihtoutReply, protectContent bool, keyboard MarkUps) (*objs.Result[*objs.Message], error)
ASendVenue sends a venue to all types of chat but channels. To send it to channels use "SendVenueUN" method.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
---------------------------------
Official telegram doc :
Use this method to send information about a venue. On success, the sent Message is returned.
func (*AdvancedBot) ASendVenueUN ¶
func (bot *AdvancedBot) ASendVenueUN(chatId string, replyTo, messageThreadId int, latitude, longitude float32, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType string, silent, protectContent bool, allowSendingWihtoutReply bool, keyboard MarkUps) (*objs.Result[*objs.Message], error)
ASendVenueUN sends a venue to a channel.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
---------------------------------
Official telegram doc :
Use this method to send information about a venue. On success, the sent Message is returned.
func (*AdvancedBot) ASendVideo ¶
func (bot *AdvancedBot) ASendVideo(chatId int, replyTo, messageThreadId int, caption, parseMode string, captionEntites []objs.MessageEntity, duration int, supportsStreaming, allowSendingWithoutReply, hasSpoiler bool, keyboard MarkUps) *MediaSender
ASendVideo returns a MediaSender which has several methods for sending a video. This method is only used for sending a video to all types of chat except channels. To send a video to a channel use "SendVideoUN" method. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
func (*AdvancedBot) ASendVideoNote ¶
func (bot *AdvancedBot) ASendVideoNote(chatId int, replyTo, messageThreadId int, caption, parseMode string, captionEntities []objs.MessageEntity, length, duration int, allowSendingWihtoutReply bool, keyboard MarkUps) *MediaSender
ASendVideoNote returns a MediaSender which has several methods for sending a video note. This method is only used for sending a video note to all types of chat except channels. To send a video note to a channel use "SendVideoNoteUN" method. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
func (*AdvancedBot) ASendVideoNoteUN ¶
func (bot *AdvancedBot) ASendVideoNoteUN(chatId string, replyTo, messageThreadId int, caption, parseMode string, captionEntities []objs.MessageEntity, length, duration int, allowSendingWihtoutReply bool, keyboard MarkUps) *MediaSender
ASendVideoNoteUN returns an MediaSender which has several methods for sending a video note. This method is only used for sending a video note to channels. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
func (*AdvancedBot) ASendVideoUN ¶
func (bot *AdvancedBot) ASendVideoUN(chatId string, replyTo, messageThreadId int, caption, parseMode string, captionEntites []objs.MessageEntity, duration int, supportsStreaming, allowSendingWithoutReply, hasSpoiler bool, keyboard MarkUps) *MediaSender
ASendVideoUN returns a MediaSender which has several methods for sending a video. This method is only used for sending a video to a channels. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
func (*AdvancedBot) ASendVoice ¶
func (bot *AdvancedBot) ASendVoice(chatId int, replyTo, messageThreadId int, caption, parseMode string, captionEntities []objs.MessageEntity, duration int, allowSendingWihtoutReply bool, keyboard MarkUps) *MediaSender
ASendVoice returns a MediaSender which has several methods for sending a voice. This method is only used for sending a voice to all types of chat except channels. To send a voice to a channel use "SendVoiceUN" method. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
func (*AdvancedBot) ASendVoiceUN ¶
func (bot *AdvancedBot) ASendVoiceUN(chatId string, replyTo, messageThreadId int, caption, parseMode string, captionEntities []objs.MessageEntity, duration int, allowSendingWihtoutReply bool, keyboard MarkUps) *MediaSender
ASendVoiceUN returns a MediaSender which has several methods for sending a voice. This method is only used for sending a voice to channels. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
func (*AdvancedBot) ASetGameScore ¶
func (bot *AdvancedBot) ASetGameScore(userId, score, chatId, messageId int, force, disableEditMessage bool, inlineMessageId string) (*objs.Result[json.RawMessage], error)
ASetGameScore sets the score of the given user.
-----------------------
Official telegram doc :
Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
"score" is new score, must be non-negative.
"force" : Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters.
"disableEditMessage" : Pass True, if the game message should not be automatically edited to include the current scoreboard.
"inlineMessageId" : Required if chat_id and message_id are not specified. Identifier of the inline message.
func (*AdvancedBot) AddMiddleware ¶
func (bot *AdvancedBot) AddMiddleware(md func(update *objs.Update, next func()))
AddMiddleware adds a new middleware to middleware chain.
Arguemnts :
1. update : The received update
2. next : next is a function that invokes the next middleware in chain. If it is not called in you middleware function, then the middleare chain execution will stop.
func (*AdvancedBot) GetMyDefaultAdministratorRights ¶
func (bot *AdvancedBot) GetMyDefaultAdministratorRights(forChannels bool) (*objs.Result[*objs.ChatAdministratorRights], error)
GetMyDefaultAdministratorRights as describe by telegram official doc : Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
func (*AdvancedBot) RegisterChannel ¶
func (bot *AdvancedBot) RegisterChannel(chatId, mediaType string) (*chan *objs.Update, error)
RegisterChannel can be used to register special channels. Sepcial channels can be used to get only certain types of updates through them. For example you can register a channel to only receive messages or register a channel to only receive edited messages in a certain chat.
"chatId" argument specifies a chat which this channel will be dedicated to. If an empty string is passed it means that no chat is specified and channel will work for all chats. chatIds that are integer should be converted to string.
"mediaType" argument specifies a media type that channel will be dedicated to. If an empty string is passed it means no media type is in mind and channel will work for all media types. mediaType can have the following values :
1. Empty string
2. message
3. edited_message
4. channel_post
5. edited_channel_post
6. inline_query
7. chosen_inline_query
8. callback_query
9. shipping_query
10. pre_checkout_query
11. poll_answer
12. my_chat_member
13. chat_member
14. chat_join_request
bot "chatId" and "mediaType" arguments can be used together to create a channel that will be updated only if a certain type of update is received for a ceratin chat.
Examples :
1. RegisterChannel("123456","message") : The returned channel will be updated when a message (text,photo,video ...) is received from a chat with "123456" as it's chat id.
2. RegiterChannel("","message") : The returned channel will be updated everytime a message is received from any chat.
3. RegisterChannel("123456","") : The returned channel will be updated everytime an update of anykind is received for the specified chat.
4. RegisterChannel("","") : The returned is the global update channel which will be updated everytime an update is received. You can get this channel by calling `getUpdateChannel()` method too.
func (*AdvancedBot) SetMyDefaultAdministratorRights ¶
func (bot *AdvancedBot) SetMyDefaultAdministratorRights(forChannels, isAnonymous, canManageChat, canPostmessages, canEditMessages, canDeleteMessages, canManageVideoChats, canRestrictMembers, canPromoteMembers, canChangeInfo, canInviteUsers, canPinMessages bool) (*objs.Result[bool], error)
SetMyDefaultAdministratorRights as describe by telegram official doc : Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot. Returns True on success.
func (*AdvancedBot) SetPassportDataErrors ¶
func (bot *AdvancedBot) SetPassportDataErrors(userId int, errors []objs.PassportElementError) (*objs.Result[bool], error)
SetPassportDataErrors informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
func (*AdvancedBot) UnRegisterChannel ¶
func (bot *AdvancedBot) UnRegisterChannel(chatId, mediaType string)
UnRegisterChannel can be used to unregister a channel for the given arguments
type AnimationEditor ¶
type AnimationEditor struct {
// contains filtered or unexported fields
}
AnimationEditor is a tool for editing animations.
func (*AnimationEditor) EditByFile ¶
func (ai *AnimationEditor) EditByFile(file *os.File) (*objs.Result[json.RawMessage], error)
EditByFile edits this animation by file in the device
func (*AnimationEditor) EditByFileIdOrURL ¶
func (ai *AnimationEditor) EditByFileIdOrURL(fileIdOrUrl string) (*objs.Result[json.RawMessage], error)
EditByFileIdOrURL edits this animation file by file id or url
type AnimationInserter ¶
type AnimationInserter struct {
// contains filtered or unexported fields
}
AnimationInserter is a tool for inserting animations into the MediaGroup.
func (*AnimationInserter) AddByFile ¶
func (ai *AnimationInserter) AddByFile(file *os.File) error
AddByFile adds an existing file in the device
func (*AnimationInserter) AddByFileIdOrURL ¶
func (ai *AnimationInserter) AddByFileIdOrURL(fileIdOrUrl string)
AddByFileIdOrURL adds this file by file id or url
func (*AnimationInserter) EditThumbnail ¶
func (ai *AnimationInserter) EditThumbnail(fileIdOrURL string)
EditThumbnail edits the tumbnail of the file. It takes a fileId or a url. If you want to send a file use "setThumbnailFile" instead.
func (*AnimationInserter) EditThumbnailFile ¶
func (ai *AnimationInserter) EditThumbnailFile(file *os.File) error
EditThumbnailFile edits the thumbnail of the file. It takes a file existing on the device
func (*AnimationInserter) SetThumbnail ¶
func (ai *AnimationInserter) SetThumbnail(fileIdOrURL string)
SetThumbnail sets the tumbnail of the file. It takes a fileId or a url. If you want to send a file use "setThumbnailFile" instead.
func (*AnimationInserter) SetThumbnailFile ¶
func (ai *AnimationInserter) SetThumbnailFile(file *os.File) error
SetThumbnailFile sets the tumbnail of the file. It takes a file existing on the device
type AudioEditor ¶
type AudioEditor struct {
// contains filtered or unexported fields
}
AudioEditor is a tool for editing audios.
func (*AudioEditor) EditByFile ¶
func (ai *AudioEditor) EditByFile(file *os.File) (*objs.Result[json.RawMessage], error)
EditByFile edits this audio by file in the device
func (*AudioEditor) EditByFileIdOrURL ¶
func (ai *AudioEditor) EditByFileIdOrURL(fileIdOrUrl string) (*objs.Result[json.RawMessage], error)
EditByFileIdOrURL edits this file by file id or url
func (*AudioEditor) EditThumbnail ¶
func (ai *AudioEditor) EditThumbnail(fileIdOrURL string)
EditThumbnail edits the tumbnail of the file. It takes a fileId or a url. If you want to send a file use "setThumbnailFile" instead.
func (*AudioEditor) EditThumbnailFile ¶
func (ai *AudioEditor) EditThumbnailFile(file *os.File) error
EditThumbnailFile edits the thumbnail of the file. It takes a file existing on the device
type AudioInserter ¶
type AudioInserter struct {
// contains filtered or unexported fields
}
AudioInserter is a tool for inserting audios into the MediaGroup.
func (*AudioInserter) AddByFile ¶
func (ai *AudioInserter) AddByFile(file *os.File) error
AddByFile adds an existing file in the device
func (*AudioInserter) AddByFileIdOrURL ¶
func (ai *AudioInserter) AddByFileIdOrURL(fileIdOrUrl string)
AddByFileIdOrURL adds this file by file id or url
func (*AudioInserter) SetThumbnail ¶
func (ai *AudioInserter) SetThumbnail(fileIdOrURL string)
SetThumbnail sets the tumbnail of the file. It takes a fileId or a url. If you want to send a file use "setThumbnailFile" instead.
func (*AudioInserter) SetThumbnailFile ¶
func (ai *AudioInserter) SetThumbnailFile(file *os.File) error
SetThumbnailFile sets the tumbnail of the file. It takes a file existing on the device
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
func NewBot ¶
func NewBot(cfg *cfg.BotConfigs) (*Bot, error)
NewBot returns a new bot instance with the specified configs
func (*Bot) AddHandler ¶
AddHandler adds a handler for a text message that matches the given regex pattern and chatType.
"pattern" is a regex pattern.
"chatType" must be "private","group","supergroup","channel" or "all". Any other value will cause the function to return an error.
func (*Bot) AdvancedMode ¶
func (bot *Bot) AdvancedMode() *AdvancedBot
AdvancedMode returns and advanced version of the bot which gives more customized functions to iteract with the bot
func (*Bot) AnswerCallbackQuery ¶
func (bot *Bot) AnswerCallbackQuery(callbackQueryId, text string, showAlert bool) (*objs.Result[bool], error)
AnswerCallbackQuery can be used to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @Botfather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
func (*Bot) AnswerInlineQuery ¶
func (bot *Bot) AnswerInlineQuery(id string, cacheTime int) *InlineQueryResponder
AnswerInlineQuery returns an InlineQueryResponder which has several methods for answering an inline query or web app query. To access more options use "AAsnwerInlineQuery" method in advanced bot.
--------------------------
Official telegram doc :
Use this method to send answers to an inline query. On success, True is returned. No more than 50 results per query are allowed.
func (*Bot) AnswerPreCheckoutQuery ¶
func (bot *Bot) AnswerPreCheckoutQuery(shippingQueryId string, ok bool, errorMessage string) (*objs.Result[bool], error)
AnswerPreCheckoutQuery answers a pre checkout query.
-----------------------
Official telegram doc :
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
"ok" : Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.
"errorMessage" : Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.
func (*Bot) AnswerShippingQuery ¶
func (bot *Bot) AnswerShippingQuery(shippingQueryId string, ok bool, shippingOptions []objs.ShippingOption, errorMessage string) (*objs.Result[bool], error)
AnswerShippingQuery answers an incoming shipping query.
-----------------------
Official telegram doc :
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
"ok" : Specify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible).
"shippingOptions" : Required if ok is True. A JSON-serialized array of available shipping options.
"errorMessage" : Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.
func (*Bot) AnswerWebAppQuery ¶
func (bot *Bot) AnswerWebAppQuery(webAppQueryId string) *InlineQueryResponder
AnswerWebAppQuery returns an InlineQueryResponder which has several methods for answering an inline query or web app query.
--------------------------
Official telegram doc :
Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned.
func (*Bot) BanChatMember ¶
func (*Bot) CopyMessage ¶
func (bot *Bot) CopyMessage(messageId int, disableNotif, protectContent bool) *MessageCopier
CopyMessage returns a MessageCopier which has several methods for copying a message
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*Bot) CreateAlbum ¶
func (bot *Bot) CreateAlbum(replyTo int) *MediaGroup
CreateAlbum returns a MediaGroup for grouping media messages. To ignore replyTo argument, pass 0.
func (*Bot) CreateChatInviteLink ¶
func (*Bot) CreateForumTopic ¶
func (bot *Bot) CreateForumTopic(chatId int, name string, iconColor int, iconCustomEmojiId string) (*objs.Result[*objs.ForumTopic], error)
CreateForumTopic creates a forum topic. To create forum topic by username, use CreateForumTopicUN.
-------------------------
Official telegram doc :
Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object.
Arguments (as described in telegram bot api):
1. chatId : Unique identifier for the target chat
2. name : Topic name, 1-128 characters
3. iconColor : Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F)
4. iconCustomEmojiId : Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers.
func (*Bot) CreateForumTopicUN ¶
func (bot *Bot) CreateForumTopicUN(username, name string, iconColor int, iconCustomEmojiId string) (*objs.Result[*objs.ForumTopic], error)
CreateForumTopicUN creates a forum topic by username. username should start with @.
-------------------------
Official telegram doc :
Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object.
Arguments (as described in telegram bot api):
1. username : username of the target supergroup (in the format @supergroupusername)
2. name : Topic name, 1-128 characters
3. iconColor : Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F)
4. iconCustomEmojiId : Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers.
func (*Bot) CreateInlineKeyboard ¶
func (bot *Bot) CreateInlineKeyboard() *InlineKeyboard
CreateInlineKeyboard creates a keyboard an returns it. The created keyboard has some methods for adding buttons to it.
You can send the keyboard along with messages by passing the keyboard as the "keyboard" argument of a method. The methods that supoort keyboard are mostly located in the advanced mode.
func (*Bot) CreateInvoice ¶
func (bot *Bot) CreateInvoice(chatId int, title, description, payload, providerToken, currency string) *Invoice
CreateInvoice returns an InvoiceSender which has several methods for creating and sending an invoice.
This method is suitable for sending this invoice to a chat that has an id, to send the invoice to channels use "CreateInvoiceUN" method.
To access more options, use "ACreateInvoice" method in advanced mode.
func (*Bot) CreateInvoiceUN ¶
func (bot *Bot) CreateInvoiceUN(chatId, title, description, payload, providerToken, currency string) *Invoice
CreateInvoiceUN returns an InvoiceSender which has several methods for creating and sending an invoice.
To access more options, use "ACreateInvoiceUN" method in advanced mode.
func (*Bot) CreateKeyboard ¶
func (bot *Bot) CreateKeyboard(resizeKeyboard, isPersistent, oneTimeKeyboard, selective bool, inputFieldPlaceholder string) *Keyboard
CreateKeyboard creates a keyboard an returns it. The created keyboard has some methods for adding buttons to it.
You can send the keyboard along with messages by passing the keyboard as the "keyboard" argument of the method. The methods that supoort keyboard are mostly located in the advanced mode.
Arguments (as described in telegram bot api):
1. resizeKeyboard : Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.
2. oneTimeKeyboard : Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to false
3. inputFieldPlaceholder : The placeholder to be shown in the input field when the keyboard is active; 1-64 characters.
4. selective : Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
5. isPersistent : Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon.
Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard.
func (*Bot) CreateNewStickerSet ¶
func (bot *Bot) CreateNewStickerSet(userId int, name, title, pngStickerFileIdOrUrl string, pngStickerFile *os.File, tgsSticker *os.File, webmSticker *os.File, emojies string, containsMask bool, maskPosition *objs.MaskPosition) (*StickerSet, error)
Deprecated : This method has been completely deprecated. Use CreateStickerSet instead.
func (*Bot) CreatePoll ¶
CreatePoll creates a poll for all types of chat but channels. To create a poll for channels use "CreatePollForChannel" method.
The poll type can be "regular" or "quiz"
func (*Bot) CreatePollForChannel ¶
CreatePollForChannel creates a poll for a channel.
The poll type can be "regular" or "quiz"
func (*Bot) CreateStickerSet ¶
func (bot *Bot) CreateStickerSet(userId int, name, title, stickerFormat, stickerType string, needsRepainting bool) *StickerSet
CreateStickerSet returns an sticker set which can be used for creation and managing sticker sets. In this case, sticker set is locked and can be only used for creating the sticker set.
Arguments :
1. userId : User identifier of created sticker set owner
2. name : Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in "_by_<bot_username>". <bot_username> is case insensitive. 1-64 characters.
3. title : Sticker set title, 1-64 characters.
4. stickerFormat : Format of stickers in the set, must be one of “static”, “animated”, “video”
5. stickerType : Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”. By default, a regular sticker set is created.
6. needsRepainting : Pass True if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only
func (*Bot) ForwardMessage ¶
func (bot *Bot) ForwardMessage(messageId int, disableNotif, protectContent bool) *MessageForwarder
ForwardMessage returns a MessageForwarder which has several methods for forwarding a message
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*Bot) GetBotManager ¶
func (bot *Bot) GetBotManager() *BotManager
GetBotManager returns a bot manager, a tool for manging personal information of the bot such as name and description.
func (*Bot) GetChatManagerById ¶
func (bot *Bot) GetChatManagerById(chatId int) *ChatManager
GetChatManagerById creates and returns a ChatManager for groups and other chats witch an integer id.
To manage supergroups and channels which have usernames use "GetChatManagerByUsername".
func (*Bot) GetChatManagerByUsrename ¶
func (bot *Bot) GetChatManagerByUsrename(userName string) *ChatManager
GetChatManagerByUsrename creates and returns a ChatManager for supergroups and channels which have usernames
To manage groups and other chats witch an integer id use "GetChatManagerById".
func (*Bot) GetChatMember ¶
func (*Bot) GetChatMenuButton ¶
GetChatMenuButton gets the current menu button of given chat.
-------------------------
Official telegram doc :
Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.
func (*Bot) GetCommandManager ¶
func (bot *Bot) GetCommandManager() *CommandsManager
GetCommandManager returns a command manager which has several method for manaing bot commands.
func (*Bot) GetCustomEmojiStickers ¶
GetCustomEmojiStickers returns info about custom stickers.
-------------------------
Official telegram doc :
Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.
func (*Bot) GetFile ¶
GetFile gets a file from telegram server. If it is successful the File object is returned.
If "download option is true, the file will be saved into the given file and if the given file is nil file will be saved in the same name as it has been saved in telegram servers.
func (*Bot) GetForumTopicIconStickers ¶
GetForumTopicIconStickers returns a list of stickers to be used in forum topics.
-------------------------
Official telegram doc :
Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of Sticker objects.
func (*Bot) GetForumTopicManager ¶
func (bot *Bot) GetForumTopicManager(chatId, messageThreadId int) *ForumTopicManager
GetForumTopicManager returns a forum topic manager which can be used for managing forum topics.
func (*Bot) GetForumTopicManagerUN ¶
func (bot *Bot) GetForumTopicManagerUN(username string, messageThreadId int) *ForumTopicManager
GetForumTopicManager returns a forum topic manager which can be used for managing forum topics.
func (*Bot) GetGameHighScores ¶
func (bot *Bot) GetGameHighScores(userId, chatId, messageId int, inlineMessageId string) (*objs.Result[[]*objs.GameHighScore], error)
GetGameHighScores returns the high scores of the user.
-------------------------
Official telegram doc :
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects.
This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change.
"chatId" : Required if inline_message_id is not specified. Unique identifier for the target chat.
"messageId" : Required if inline_message_id is not specified. Identifier of the sent message.
"inlineMessageId" : Required if chat_id and message_id are not specified. Identifier of the inline message.
func (*Bot) GetGeneralForumTopicManager ¶
func (bot *Bot) GetGeneralForumTopicManager(chatId, messageThreadId int) *GeneralForumTopicManager
GetGeneralForumTopicManager returns a general forum topic manager which can be used for managing general forum topics.
func (*Bot) GetGeneralForumTopicManagerUN ¶
func (bot *Bot) GetGeneralForumTopicManagerUN(username string, messageThreadId int) *GeneralForumTopicManager
GetGeneralForumTopicManagerUN returns a general forum topic manager which can be used for managing general forum topics.
func (*Bot) GetMe ¶
GetMe returns the received informations about the bot from api server.
---------------------
Official telegarm doc :
A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object.
func (*Bot) GetMsgEditor ¶
func (bot *Bot) GetMsgEditor(chatId int) *MessageEditor
GetMsgEditor returns a MessageEditor for a chat with id which has several methods for editing messages.
To edit messages in a channel or a chat with username, use "GetMsgEditorWithUN"
func (*Bot) GetMsgEditorWithUN ¶
func (bot *Bot) GetMsgEditorWithUN(chatId string) *MessageEditor
GetMsgEditorWithUN returns a MessageEditor for a chat with username which has several methods for editing messages.
func (*Bot) GetStickerEditor ¶
func (bot *Bot) GetStickerEditor(stickerFileId string) *StickerEditor
GetStickerEditor returns a special object for editing stickers. Setting emoji list, keywords,mask postion and deleting the sticker.
stickerFileId : File identifier of the sticker
func (*Bot) GetStickerSet ¶
func (bot *Bot) GetStickerSet(name string) (*StickerSet, error)
GetStickerSet returns an sticker set with the given name
func (*Bot) GetTextFormatter ¶
func (bot *Bot) GetTextFormatter() *TextFormatter
GetTextFormatter returns a MessageFormatter that can be used for formatting a text message. You can add bold,italic,underline,spoiler,mention,url,link and some other texts with this tool.
func (*Bot) GetUpdateChannel ¶
GetUpdateChannel returns the channel which new updates received from api server are pushed into.
func (*Bot) GetUserProfilePhotos ¶
func (bot *Bot) GetUserProfilePhotos(userId, offset, limit int) (*objs.Result[*objs.UserProfilePhotos], error)
GetUserProfilePhotos gets the given user profile photos.
"userId" argument is required. Other arguments are optinoal and to ignore them pass 0.
---------------------------------
Official telegram doc :
Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
func (*Bot) PinChatMessage ¶
func (*Bot) SendAnimation ¶
func (bot *Bot) SendAnimation(chatId int, replyTo int, caption, parseMode string, hasSpoiler bool) *MediaSender
SendAnimation returns a MediaSender which has several methods for sending an animation. This method is only used for sending an animation to all types of chat except channels. To send a audio to a channel use "SendAnimationUN" method. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
func (*Bot) SendAnimationUN ¶
func (bot *Bot) SendAnimationUN(chatId string, replyTo int, caption, parseMode string, hasSpoiler bool) *MediaSender
SendAnimationUN returns a MediaSender which has several methods for sending an animation. This method is only used for sending an animation to channels To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
func (*Bot) SendAudio ¶
func (bot *Bot) SendAudio(chatId, replyTo int, caption, parseMode string) *MediaSender
SendAudio returns a MediaSender which has several methods for sending a audio. This method is only used for sending a audio to all types of chat except channels. To send a audio to a channel use "SendAudioUN" method. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
For sending voice messages, use the sendVoice method instead.
func (*Bot) SendAudioUN ¶
func (bot *Bot) SendAudioUN(chatId string, replyTo int, caption, parseMode string) *MediaSender
SendAudioUN returns a MediaSender which has several methods for sending a audio. This method is only used for sending a audio to a channels. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
For sending voice messages, use the sendVoice method instead.
func (*Bot) SendChatAction ¶
func (bot *Bot) SendChatAction(chatId, messageThreadId int, action string) (*objs.Result[*objs.Message], error)
SendChatAction sends a chat action message to all types of chat but channels. To send it to channels use "SendChatActionUN" method. Note : messageThreadId is unique identifier for the target message thread (supergroups only) which can be used for sending chat actions to a specific message thread or a forum topic.
---------------------------------
Official telegram doc :
Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.
Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo. The user will see a “sending photo” status for the bot.
We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
action is the type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.
func (*Bot) SendChatActionUN ¶
func (bot *Bot) SendChatActionUN(chatId, action string, messageThreadId int) (*objs.Result[*objs.Message], error)
SendChatActionUN sends a chat action message to a channel. Note : messageThreadId is unique identifier for the target message thread (supergroups only) which can be used for sending chat actions to a specific message thread or a forum topic.
---------------------------------
Official telegram doc :
Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.
Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo. The user will see a “sending photo” status for the bot.
We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
action is the type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.
func (*Bot) SendContact ¶
func (bot *Bot) SendContact(chatId, replyTo int, phoneNumber, firstName, lastName string, silent, protectContent bool) (*objs.Result[*objs.Message], error)
SendContact sends a contact to all types of chat but channels. To send it to channels use "SendContactUN" method.
---------------------------------
Official telegram doc :
Use this method to send phone contacts. On success, the sent Message is returned.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*Bot) SendContactUN ¶
func (bot *Bot) SendContactUN(chatId string, replyTo int, phoneNumber, firstName, lastName string, silent, protectContent bool) (*objs.Result[*objs.Message], error)
SendContactUN sends a contact to a channel.
---------------------------------
Official telegram doc :
Use this method to send phone contacts. On success, the sent Message is returned.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*Bot) SendDice ¶
func (bot *Bot) SendDice(chatId, replyTo int, emoji string, silent, protectContent bool) (*objs.Result[*objs.Message], error)
SendDice sends a dice message to all types of chat but channels. To send it to channels use "SendDiceUN" method.
Available emojies : “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”.
---------------------------------
Official telegram doc :
Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*Bot) SendDiceUN ¶
func (bot *Bot) SendDiceUN(chatId string, replyTo int, emoji string, silent, protectContent bool) (*objs.Result[*objs.Message], error)
SendDiceUN sends a dice message to a channel.
Available emojies : “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”.
---------------------------------
Official telegram doc :
Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*Bot) SendDocument ¶
func (bot *Bot) SendDocument(chatId, replyTo int, caption, parseMode string) *MediaSender
SendDocument returns a MediaSender which has several methods for sending a document. This method is only used for sending a document to all types of chat except channels. To send a audio to a channel use "SendDocumentUN" method. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
func (*Bot) SendDocumentUN ¶
func (bot *Bot) SendDocumentUN(chatId string, replyTo int, caption, parseMode string) *MediaSender
SendDocumentUN returns a MediaSender which has several methods for sending a document. This method is only used for sending a document to a channels. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
func (*Bot) SendGame ¶
func (bot *Bot) SendGame(chatId int, gameShortName string, silent bool, replyTo int) (*objs.Result[*objs.Message], error)
SendGame sends a game to the chat.
**To access more options use "ASendGame" method in advanced mode.
-----------------------
Official telegram doc :
Use this method to send a game. On success, the sent Message is returned.
func (*Bot) SendLocation ¶
func (bot *Bot) SendLocation(chatId int, silent, protectContent bool, latitude, longitude, accuracy float32, replyTo int) (*objs.Result[*objs.Message], error)
SendLocation sends a location (not live) to all types of chats but channels. To send it to channel use "SendLocationUN" method.
You can not use this methods to send a live location. To send a live location use AdvancedBot.
---------------------------------
Official telegram doc :
Use this method to send point on the map. On success, the sent Message is returned.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*Bot) SendLocationUN ¶
func (bot *Bot) SendLocationUN(chatId string, silent, protectContent bool, latitude, longitude, accuracy float32, replyTo int) (*objs.Result[*objs.Message], error)
SendLocationUN sends a location (not live) to a channel.
You can not use this methods to send a live location. To send a live location use AdvancedBot.
---------------------------------
Official telegram doc :
Use this method to send point on the map. On success, the sent Message is returned.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*Bot) SendMessage ¶
func (bot *Bot) SendMessage(chatId int, text, parseMode string, replyTo int, silent, protectContent bool) (*objs.Result[*objs.Message], error)
SendMessage sens a text message to a chat (not channel, use SendMessageUN method for sending messages to channles) and returns the sent message on success If you want to ignore "parseMode" pass empty string. To ignore replyTo pass 0.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*Bot) SendMessageUN ¶
func (bot *Bot) SendMessageUN(chatId, text, parseMode string, replyTo int, silent, protectContent bool) (*objs.Result[*objs.Message], error)
SendMesssageUN sens a text message to a channel and returns the sent message on success If you want to ignore "parseMode" pass empty string. To ignore replyTo pass 0.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*Bot) SendPhoto ¶
func (bot *Bot) SendPhoto(chatId, replyTo int, caption, parseMode string, hasSpoiler bool) *MediaSender
SendPhoto returns a MediaSender which has several methods for sending a photo. This method is only used for sending a photo to all types of chat except channels. To send a photo to a channel use "SendPhotoUN" method. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
func (*Bot) SendPhotoUN ¶
func (bot *Bot) SendPhotoUN(chatId string, replyTo int, caption, parseMode string, hasSpoiler bool) *MediaSender
SendPhotoUN returns a MediaSender which has several methods for sending a photo. This method is only used for sending a photo to a channels. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
func (*Bot) SendSticker ¶
func (bot *Bot) SendSticker(chatId, replyTo int, eomji string) *MediaSender
SendSticker returns a MediaSender which has several methods for sending an sticker to all types of chats but channels. To send it to a channel use "SendStickerWithUN".
--------------------
Official telegram doc :
Use this method to send static .WEBP or animated .TGS stickers. On success, the sent Message is returned
func (*Bot) SendStickerWithUn ¶
func (bot *Bot) SendStickerWithUn(chatId string, replyTo int, eomji string) *MediaSender
SendStickerWithUn returns a MediaSender which has several methods for sending an sticker to channels.
--------------------
Official telegram doc :
Use this method to send static .WEBP or animated .TGS stickers. On success, the sent Message is returned
func (*Bot) SendVenue ¶
func (bot *Bot) SendVenue(chatId, replyTo int, latitude, longitude float32, title, address string, silent, protectContent bool) (*objs.Result[*objs.Message], error)
SendVenue sends a venue to all types of chat but channels. To send it to channels use "SendVenueUN" method.
---------------------------------
Official telegram doc :
Use this method to send information about a venue. On success, the sent Message is returned.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*Bot) SendVenueUN ¶
func (bot *Bot) SendVenueUN(chatId string, replyTo int, latitude, longitude float32, title, address string, silent, protectContent bool) (*objs.Result[*objs.Message], error)
SendVenueUN sends a venue to a channel.
---------------------------------
Official telegram doc :
Use this method to send information about a venue. On success, the sent Message is returned.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*Bot) SendVideo ¶
func (bot *Bot) SendVideo(chatId int, replyTo int, caption, parseMode string, hasSpoiler bool) *MediaSender
SendVideo returns a MediaSender which has several methods for sending a video. This method is only used for sending a video to all types of chat except channels. To send a video to a channel use "SendVideoUN" method. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
func (*Bot) SendVideoNote ¶
func (bot *Bot) SendVideoNote(chatId int, replyTo int, caption, parseMode string) *MediaSender
SendVideoNote returns a MediaSender which has several methods for sending a video note. This method is only used for sending a video note to all types of chat except channels. To send a video note to a channel use "SendVideoNoteUN" method. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
func (*Bot) SendVideoNoteUN ¶
func (bot *Bot) SendVideoNoteUN(chatId string, replyTo int, caption, parseMode string) *MediaSender
SendVideoNoteUN returns an MediaSender which has several methods for sending a video note. This method is only used for sending a video note to channels. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
func (*Bot) SendVideoUN ¶
func (bot *Bot) SendVideoUN(chatId string, replyTo int, caption, parseMode string, hasSpoiler bool) *MediaSender
SendVideoUN returns a MediaSender which has several methods for sending a video. This method is only used for sending a video to a channels. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
func (*Bot) SendVoice ¶
func (bot *Bot) SendVoice(chatId int, replyTo int, caption, parseMode string) *MediaSender
SendVoice returns a MediaSender which has several methods for sending a voice. This method is only used for sending a voice to all types of chat except channels. To send a voice to a channel use "SendVoiceUN" method. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
func (*Bot) SendVoiceUN ¶
func (bot *Bot) SendVoiceUN(chatId string, replyTo int, caption, parseMode string) *MediaSender
SendVoiceUN returns an MediaSender which has several methods for sending a voice. This method is only used for sending a voice to channels. To ignore int arguments pass 0 and to ignore string arguments pass empty string ("")
---------------------------------
Official telegram doc :
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
func (*Bot) SetCommandChatMenuButton ¶
SetCommandChatMenuButton sets the current menu button of given chat to command meaning that it opens the bot's list of commands.
-------------------------
Official telegram doc :
Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
func (*Bot) SetDefaultChatMenuButton ¶
SetDefaultChatMenuButton sets the current menu button of given chat to command meaning that it describes that no specific value for the menu button was set.
-------------------------
Official telegram doc :
Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
func (*Bot) SetGameScore ¶
func (bot *Bot) SetGameScore(userId, score, chatId, messageId int) (*objs.Result[json.RawMessage], error)
SetGameScore sets the score of the given user.
**To access more option use "ASetGameScoe" in advanced mode. -----------------------
Official telegram doc :
Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
"score" is new score, must be non-negative.
func (*Bot) SetMyCommands ¶
func (bot *Bot) SetMyCommands(commands []objs.BotCommand, scope objs.BotCommandScope, languageCode string) (*objs.Result[bool], error)
func (*Bot) SetWebAppChatMenuButton ¶
SetWebAppChatMenuButton sets the current menu button of given chat to web_app meaning that it launches a Web App.
-------------------------
Official telegram doc :
Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
func (*Bot) UnbanChatMember ¶
func (*Bot) UnpinAllChatMessages ¶
func (*Bot) UnpinChatMessage ¶
func (*Bot) UploadStickerFile ¶
func (bot *Bot) UploadStickerFile(userId int, stickerFormat string, eomjis, keywords []string, stickerFile *os.File) (*objs.Result[*objs.File], error)
UploadStickerFile can be used to upload a .PNG file with a sticker for later use in CreateNewStickerSet and AddStickerToSet methods (can be used multiple times). Returns the uploaded File on success.
type BotManager ¶
type BotManager struct {
// contains filtered or unexported fields
}
BotManager is a tool for manaing personal info of the bot.
func (*BotManager) GetDescription ¶
func (bm *BotManager) GetDescription(languageCode string) (*objs.Result[*objs.BotDescription], error)
GetDescription returns description of the bot based on the specified language.
func (*BotManager) GetMe ¶
GetMe returns the received informations about the bot from api server.
---------------------
Official telegarm doc :
A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object.
func (*BotManager) GetShortDescription ¶
func (bm *BotManager) GetShortDescription(languageCode string) (*objs.Result[*objs.BotDescription], error)
GetShortDescription returns short description of the bot based on the specified language.
func (*BotManager) SetDescription ¶
SetDescription sets the description of the bot for the specified langauge. Description is shown in the chat with the bot if the chat is empty.
Arguments :
1. description : New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.
2. languageCode : A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description.
func (*BotManager) SetName ¶
SetName sets bot's name in the specified language
Arguments :
1. name : bot's new name
2. languageCode : A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name.
func (*BotManager) SetShortDescription ¶
func (bm *BotManager) SetShortDescription(shortDescription, languageCode string) (*objs.Result[bool], error)
SetShortDescription sets the short description of the bot for the specified langauge. Short description is shown on the bot's profile page and is sent together with the link when users share the bot.
Arguments :
1. shortDescription : New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language.
2. languageCode : A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description.
type ChatManager ¶
type ChatManager struct {
// contains filtered or unexported fields
}
ChatManager is a tool for managing chats via the bot.
func (*ChatManager) ApproveJoinRequest ¶
ApproveJoinRequest approves a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.
func (*ChatManager) BanChatSender ¶
BanChatSender bans a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.
func (*ChatManager) BanMember ¶
func (cm *ChatManager) BanMember(userId, untilDate int, revokeMessages bool) (*objs.Result[bool], error)
BanMember bans a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
func (*ChatManager) CreateInviteLink ¶
func (cm *ChatManager) CreateInviteLink(name string, expireDate, memberLimit int, createsJoinRequest bool) (*objs.Result[*objs.ChatInviteLink], error)
CreateInviteLink creates an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method RevokeInviteLink. Returns the new invite link as ChatInviteLink object.
func (*ChatManager) DeclineJoinRequest ¶
DeclineJoinRequest can be used to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.
func (*ChatManager) DeletePhoto ¶
func (cm *ChatManager) DeletePhoto() (*objs.Result[bool], error)
DeletePhoto can be used to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
func (*ChatManager) DeleteStickerSet ¶
func (cm *ChatManager) DeleteStickerSet() (*objs.Result[bool], error)
DeleteStickerSet deletes a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in "GetChatInfo" to check if the bot can use this method. Returns True on success.
func (*ChatManager) EditInviteLink ¶
func (cm *ChatManager) EditInviteLink(inviteLink, name string, expireDate, memberLimit int, createsJoinRequest bool) (*objs.Result[*objs.ChatInviteLink], error)
EditInviteLink edits a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a ChatInviteLink object.
func (*ChatManager) ExportInviteLink ¶
func (cm *ChatManager) ExportInviteLink() (*objs.Result[string], error)
ExportInviteLink generates a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.
Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using this method or by calling the getChat method. If your bot needs to generate a new primary invite link replacing its previous one, use this method again.
func (*ChatManager) GetAdmins ¶
func (cm *ChatManager) GetAdmins() (*objs.Result[[]objs.ChatMemberOwner], error)
GetAdmins gets a list of administrators in a chat. On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.
func (*ChatManager) GetChatInfo ¶
GetChatInfo gets up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
func (*ChatManager) GetMember ¶
func (cm *ChatManager) GetMember(userid int) (string, error)
GetMember gets information about a member of a chat. Returns a json serialized object of the member in string form on success.
func (*ChatManager) GetMembersCount ¶
func (cm *ChatManager) GetMembersCount() (*objs.Result[int], error)
GetMembersCount gets the number of members in a chat. Returns Int on success.
func (*ChatManager) Leave ¶
func (cm *ChatManager) Leave() (*objs.Result[bool], error)
Leave can be used for your bot to leave a group, supergroup or channel. Returns True on success.
func (*ChatManager) PinMessage ¶
PinMessage adds a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
func (*ChatManager) PromoteChatMember ¶
func (cm *ChatManager) PromoteChatMember(userId int, isAnonymous, canManageChat, canPostmessages, canEditMessages, canDeleteMessages, canPostStories, canEditStories, canDeleteStoreis, canManageVideoChats, canRestrictMembers, canPromoteMembers, canChangeInfo, canInviteUsers, canPinMessages, canManageTopics bool) (*objs.Result[bool], error)
PromoteChatMember promotes or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success.
func (*ChatManager) RestrictMember ¶
func (cm *ChatManager) RestrictMember(userId int, untilDate int, useIndependentChatPermissions bool, canSendMessages, canSendMediaMessages, canSendPolls, canSendOtherMessages, canAddWebPagePreviews, canChangeInfo, canInviteUsers, canPinMessages bool) (*objs.Result[bool], error)
Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.
useIndependentChatPermissions : Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.
func (*ChatManager) RevokeInviteLink ¶
func (cm *ChatManager) RevokeInviteLink(inviteLink string) (*objs.Result[*objs.ChatInviteLink], error)
RevokeInviteLink revokes an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object.
func (*ChatManager) SetCustomTitle ¶
SetCustomTitle sets a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
func (*ChatManager) SetDescription ¶
SetDescription changes the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
func (*ChatManager) SetGeneralPermissions ¶
func (cm *ChatManager) SetGeneralPermissions(useIndependentChatPermissions, canSendMessages, canSendMediaMessages, canSendPolls, canSendOtherMessages, canAddWebPagePreviews, canChangeInfo, canInviteUsers, canPinMessages bool) (*objs.Result[bool], error)
SetGeneralPermissions sets default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success.
useIndependentChatPermissions : Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.
func (*ChatManager) SetPhoto ¶
SetPhoto can be used to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
func (*ChatManager) SetStickerSet ¶
SetStickerSet sets a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in "GetChatInfo" to check if the bot can use this method. Returns True on success.
func (*ChatManager) SetTitle ¶
SetTitle changes the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
func (*ChatManager) UnbanChatSender ¶
UnbanChatSender unbans a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success.
func (*ChatManager) UnbanMember ¶
UnbanMember ubans a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success.
func (*ChatManager) UnpinAllMessages ¶
func (cm *ChatManager) UnpinAllMessages() (*objs.Result[bool], error)
UnpinAllMessages clears the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
func (*ChatManager) UnpinMessage ¶
UnpinMessage removes a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
type CommandsManager ¶
type CommandsManager struct {
// contains filtered or unexported fields
}
CommandsManager is a tool for managing bot commands
func (*CommandsManager) AddCommand ¶
func (cm *CommandsManager) AddCommand(command, description string) error
AddCommand adds a new command to the commands list.
At most 100 commands can be added.
func (*CommandsManager) DeleteCommands ¶
DeleteCommands can be used to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success.
func (*CommandsManager) GetCommands ¶
func (cm *CommandsManager) GetCommands(languageCode string) ([]objs.BotCommand, error)
GetCommands returns the commands of this bot.
func (*CommandsManager) SetCommands ¶
SetCommands calls the realted method on the api server and sets the added commansd with their specified scopes.
"languageCode" is a two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
-------------------------
Official telegram doc :
Use this method to change the list of the bot's commands. See https://core.telegram.org/bots#commands for more details about bot commands. Returns True on success.
func (*CommandsManager) SetScope ¶
func (cm *CommandsManager) SetScope(scope string, chatId []byte, userId int) error
SetScope sets the scope of this command manager.
Scope can have these values : "defaut","all_group_chats","all_private_chats","all_chat_administrators","chat","chat_administrator","chat_member". If scope is not valid error is returned.
type DocumentEditor ¶
type DocumentEditor struct {
// contains filtered or unexported fields
}
DocumentEditor is a tool for editing documents.
func (*DocumentEditor) EditByFile ¶
func (di *DocumentEditor) EditByFile(file *os.File) (*objs.Result[json.RawMessage], error)
EditByFile edits this document by file in the device
func (*DocumentEditor) EditByFileIdOrURL ¶
func (di *DocumentEditor) EditByFileIdOrURL(fileIdOrUrl string) (*objs.Result[json.RawMessage], error)
EditByFileIdOrURL edits this file by file id or url
func (*DocumentEditor) EditThumbnail ¶
func (di *DocumentEditor) EditThumbnail(fileIdOrURL string)
EditThumbnail edits the tumbnail of the file. It takes a fileId or a url. If you want to send a file use "setThumbnailFile" instead.
func (*DocumentEditor) EditThumbnailFile ¶
func (di *DocumentEditor) EditThumbnailFile(file *os.File) error
EditThumbnailFile edits the thumbnail of the file. It takes a file existing on the device
type DocumentInserter ¶
type DocumentInserter struct {
// contains filtered or unexported fields
}
DocumentInserter is a tool for inserting documents into the MediaGroup.
func (*DocumentInserter) AddByFile ¶
func (di *DocumentInserter) AddByFile(file *os.File) error
AddByFile adds an existing file in the device
func (*DocumentInserter) AddByFileIdOrURL ¶
func (di *DocumentInserter) AddByFileIdOrURL(fileIdOrUrl string)
AddByFileIdOrURL adds this file by file id or url
func (*DocumentInserter) SetThumbnail ¶
func (di *DocumentInserter) SetThumbnail(fileIdOrURL string)
SetThumbnail sets the tumbnail of the file. It takes a fileId or a url. If you want to send a file use "setThumbnailFile" instead.
func (*DocumentInserter) SetThumbnailFile ¶
func (di *DocumentInserter) SetThumbnailFile(file *os.File) error
SetThumbnailFile sets the tumbnail of the file. It takes a file existing on the device
type ForumTopicManager ¶
type ForumTopicManager struct {
// contains filtered or unexported fields
}
ForumTopicManager is a special object for managing forum topics
func (*ForumTopicManager) Close ¶
func (f *ForumTopicManager) Close() (*objs.Result[bool], error)
Close closes an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
func (*ForumTopicManager) Delete ¶
func (f *ForumTopicManager) Delete() (*objs.Result[bool], error)
Delete deletes a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.
func (*ForumTopicManager) Edit ¶
Edit edits name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
func (*ForumTopicManager) Reopen ¶
func (f *ForumTopicManager) Reopen() (*objs.Result[bool], error)
Reopen reopens a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
func (*ForumTopicManager) UnpinAllMesages ¶
func (f *ForumTopicManager) UnpinAllMesages() (*objs.Result[bool], error)
UnpinAllMesages clears the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
type GeneralForumTopicManager ¶
type GeneralForumTopicManager struct {
// contains filtered or unexported fields
}
GeneralForumTopicManager is a special object for managing genreal forum topics
func (*GeneralForumTopicManager) Close ¶
func (f *GeneralForumTopicManager) Close() (*objs.Result[bool], error)
Close closes an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
func (*GeneralForumTopicManager) Edit ¶
Edit edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success.
func (*GeneralForumTopicManager) Hide ¶
func (f *GeneralForumTopicManager) Hide() (*objs.Result[bool], error)
Hide hides the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success.
func (*GeneralForumTopicManager) Reopen ¶
func (f *GeneralForumTopicManager) Reopen() (*objs.Result[bool], error)
Reopen reopens a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success.
func (*GeneralForumTopicManager) Unhide ¶
func (f *GeneralForumTopicManager) Unhide() (*objs.Result[bool], error)
Unhide unhides the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
func (*GeneralForumTopicManager) UnpinAllMesages ¶
func (f *GeneralForumTopicManager) UnpinAllMesages() (*objs.Result[bool], error)
UnpinAllMesages clears the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
type InlineKeyboard ¶
type InlineKeyboard struct {
// contains filtered or unexported fields
}
func (*InlineKeyboard) AddCallbackButton ¶
func (in *InlineKeyboard) AddCallbackButton(text, callbackData string, row int)
AddCallbackButton adds a button that when its pressed, a call back query with the given data is sen to the bot
Note : row number starts from 1. (it's not zero based). If any number lower than 1 is passed, no button will be added.
func (*InlineKeyboard) AddCallbackButtonHandler ¶
func (in *InlineKeyboard) AddCallbackButtonHandler(text, callbackData string, row int, handler func(*objs.Update))
AddCallbackButtonHandler adds a button that when its pressed, a call back query with the given data is sen to the bot. A handler is also added which will be called everytime a call back query is received for this button.
Note : row number starts from 1. (it's not zero based). If any number lower than 1 is passed, no button will be added.
func (*InlineKeyboard) AddGameButton ¶
func (in *InlineKeyboard) AddGameButton(text string, row int)
AddGameButton adds a game button. Everytime a user presses this button a game will be launched. Use botfather to set up a game. NOTE: This type of button must always be the first button in the first row.
func (*InlineKeyboard) AddLoginURLButton ¶
func (in *InlineKeyboard) AddLoginURLButton(text, url, forwardText, botUsername string, requestWriteAccess bool, row int)
AddLoginURLButton adds a button that will be used for automatic authorization. According to telegram bot api, login url is an HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
Note : row number starts from 1. (it's not zero based). If any number lower than 1 is passed, no button will be added.
Arguments :
1. url : An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data. NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.
2. forwardText : New text of the button in forwarded messages.
3. botUsername : Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details.
4. requestWriteAccess : Pass True to request the permission for your bot to send messages to the user.
func (*InlineKeyboard) AddPayButton ¶
func (in *InlineKeyboard) AddPayButton(text string)
AddPayButton adds a pay button.
NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.
Note : This method does not accept row number. This button is automatically added to row 1.
func (*InlineKeyboard) AddSwitchInlineQueryButton ¶
func (in *InlineKeyboard) AddSwitchInlineQueryButton(text, inlineQuery string, row int, currenChat bool)
AddSwitchInlineQueryButton adds a switch inline query button. According to tlegram bot api, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted. Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm… actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.
Note : If "currentChat" option is true, the inline query will be inserted in the current chat's input field.
Note : row number starts from 1. (it's not zero based). If any number lower than 1 is passed, no button will be added.
func (*InlineKeyboard) AddSwitchInlineQueryChoseChatButton ¶
func (in *InlineKeyboard) AddSwitchInlineQueryChoseChatButton(text, inlineQuery string, allowUserChats, allowBotChats, allowGroupChats, allowChannelChats bool, row int)
AddSwitchInlineQueryChoseChatButton adds a switch inline query button. According to tlegram bot api, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field
Note : row number starts from 1. (it's not zero based). If any number lower than 1 is passed, no button will be added.
Arguemtns :
allowUserChats : True, if private chats with users can be chosen
allowBotChats : True, if private chats with bots can be chosen
allowGroupChats : True, if group and supergroup chats can be chosen
allowChannelChats : True, if channel chats can be chosen
func (*InlineKeyboard) AddURLButton ¶
func (in *InlineKeyboard) AddURLButton(text, url string, row int)
AddURLButton adds a button that will open an url when pressed.
Note : row number starts from 1. (it's not zero based). If any number lower than 1 is passed, no button will be added
func (*InlineKeyboard) AddWebAppButton ¶
func (in *InlineKeyboard) AddWebAppButton(text string, row int, url string)
AddWebAppButton adds a button which opens a web app when it's pressed.
Note : row number starts from 1. (it's not zero based). If any number lower than 1 is passed, no button will be added.
type InlineQueryResponder ¶
type InlineQueryResponder struct {
// contains filtered or unexported fields
}
func (*InlineQueryResponder) AddArticle ¶
func (iqs *InlineQueryResponder) AddArticle(id, title, url, description, thumbUrl string, thumbWidth, thumbHeight int, hideUrl bool, message objs.InputMessageContent, keyboard *InlineKeyboard) error
Adds an article to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing".You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddAudio ¶
func (iqs *InlineQueryResponder) AddAudio(id, title, audioURL, caption, parseMode, performer string, audioDuration int, message objs.InputMessageContent, keyboard *InlineKeyboard, captionEntities []objs.MessageEntity) error
Adds an audio to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use message field to send a message with the specified content instead of the audio.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing".You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddCachedAudio ¶
func (iqs *InlineQueryResponder) AddCachedAudio(id, title, audioFileId, caption, parseMode string, message objs.InputMessageContent, keyboard *InlineKeyboard, captionEntities []objs.MessageEntity) error
Adds an audio to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use message field to send a message with the specified content instead of the audio.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing". You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddCachedDocument ¶
func (iqs *InlineQueryResponder) AddCachedDocument(id, title, documentFileId, description, caption, parseMode string, messsage objs.InputMessageContent, keyboard *InlineKeyboard, captionEntities []objs.MessageEntity) error
Adds a cached document to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use message field to send a message with the specified content instead of the file.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing". You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddCachedGif ¶
func (iqs *InlineQueryResponder) AddCachedGif(id, title, gifFileId, caption, parseMode string, message objs.InputMessageContent, keyboard *InlineKeyboard, captionEntities []objs.MessageEntity) error
Adds a cached gif to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use message field to send a message with specified content instead of the animation.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing". You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddCachedMpeg4Gif ¶
func (iqs *InlineQueryResponder) AddCachedMpeg4Gif(id, title, mpeg4FileId, caption, parseMode string, message objs.InputMessageContent, keyboard *InlineKeyboard, captionEntities []objs.MessageEntity) error
Adds a cached mpeg4 to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use message field to send a message with the specified content instead of the animation.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing". You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddCachedPhoto ¶
func (iqs *InlineQueryResponder) AddCachedPhoto(id, title, photoFileId, description, caption, parseMode string, message objs.InputMessageContent, keyboard *InlineKeyboard, captionEntities []objs.MessageEntity) error
Adds a cached photo to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use message field to send a message with the specified content instead of the photo.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing". You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddCachedSticker ¶
func (iqs *InlineQueryResponder) AddCachedSticker(id, stickerFileId string, message objs.InputMessageContent, keyboard *InlineKeyboard) error
Adds a cached mpeg4 to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use message field to send a message with the specified content instead of the sticker.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing". You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddCachedVideo ¶
func (iqs *InlineQueryResponder) AddCachedVideo(id, title, videoFileId, caption, description, parseMode string, message objs.InputMessageContent, keyboard *InlineKeyboard, captionEntities []objs.MessageEntity) error
Adds a cached video to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use message field to send a message with the specified content instead of the video.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing". You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddCachedVoice ¶
func (iqs *InlineQueryResponder) AddCachedVoice(id, title, voiceFileId, caption, parseMode string, message objs.InputMessageContent, keyboard *InlineKeyboard, captionEntities []objs.MessageEntity) error
Adds a voice to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use message field to send a message with the specified content instead of the voice message.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing". You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddContact ¶
func (iqs *InlineQueryResponder) AddContact(id, title, thumbUrl, phoneNumber, firstName, lastName, vCard string, thumbWidth, thumbHeight int, message objs.InputMessageContent, keyboard *InlineKeyboard) error
Adds a contact to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use message field to send a message with the specified content instead of the contact.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing". You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddDocument ¶
func (iqs *InlineQueryResponder) AddDocument(id, title, documentURL, mimeType, description, thumbUrl, caption, parseMode string, thumbWidth, thumbHeight int, message objs.InputMessageContent, keyboard *InlineKeyboard, captionEntities []objs.MessageEntity) error
Adds a document to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use message field to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing". You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddGame ¶
func (iqs *InlineQueryResponder) AddGame(id, gameShortName string, keyboard *InlineKeyboard) error
Adds a game to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a game
func (*InlineQueryResponder) AddGif ¶
func (iqs *InlineQueryResponder) AddGif(id, title, gifURL, caption, parseMode, thumbUrl, thumbMIMEType string, gifWidth, gifHeight, gifDuration int, message objs.InputMessageContent, keyboard *InlineKeyboard, captionEntities []objs.MessageEntity) error
Adds a gif to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing".You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddLocation ¶
func (iqs *InlineQueryResponder) AddLocation(id, title, thumbUrl string, latitude, longitude, horizontalAccuracy float32, livePeriod, heading, proximityAlertRadius, thumbWidth, thumbHeight int, message objs.InputMessageContent, keyboard *InlineKeyboard) error
Adds a location to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use message field to send a message with the specified content instead of the location.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing". You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddMpeg4Gif ¶
func (iqs *InlineQueryResponder) AddMpeg4Gif(id, title, mpeg4URL, caption, parseMode, thumbUrl, thumbMIMEType string, mpeg4Width, mpeg4Height, mpeg4Duration int, message objs.InputMessageContent, keyboard *InlineKeyboard, captionEntities []objs.MessageEntity) error
Adds a mpeg4 to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing".You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddPhoto ¶
func (iqs *InlineQueryResponder) AddPhoto(id, title, photoURL, description, caption, parseMode, thumbUrl string, photoWidth, photoHeight int, message objs.InputMessageContent, keyboard *InlineKeyboard, captionEntities []objs.MessageEntity) error
Adds a photo to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing".You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddVenue ¶
func (iqs *InlineQueryResponder) AddVenue(id, title, thumbUrl string, latitude, longitude float32, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType string, thumbWidth, thumbHeight int, message objs.InputMessageContent, keyboard *InlineKeyboard) error
Adds a venue to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use message field to send a message with the specified content instead of the venue.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing". You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddVideo ¶
func (iqs *InlineQueryResponder) AddVideo(id, title, videoURL, mimeType, caption, description, parseMode, thumbUrl string, videoWidth, videoHeight, videoDuration int, message objs.InputMessageContent, keyboard *InlineKeyboard, captionEntities []objs.MessageEntity) error
Adds a video to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.
If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you must replace its content using message field.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing".You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) AddVoice ¶
func (iqs *InlineQueryResponder) AddVoice(id, title, voiceURL, caption, parseMode string, voiceDuration int, message objs.InputMessageContent, keyboard *InlineKeyboard, captionEntities []objs.MessageEntity) error
Adds a voice to the result. No more than 50 results are allowed. Also only one result is allowed for web app response.
Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use message field to send a message with the specified content instead of the the voice message.
"message" argument is the message that will be sent if this result is pressed. It is necessary and if it's not passed the API server will return "400 bad request, message_text is missing".You can use "Create***Message" method to create this messages.
func (*InlineQueryResponder) CreateContactMessage ¶
func (iqs *InlineQueryResponder) CreateContactMessage(phoneNumber, firstName, lastName, vCard string) objs.InputMessageContent
Use this function to create a contact message to be passed as "message" argument in "Add" methods.
func (*InlineQueryResponder) CreateInvoiceMessage ¶
func (iqs *InlineQueryResponder) CreateInvoiceMessage(invoice *Invoice) objs.InputMessageContent
Use this function to create an invoice message to be passed as "message" argument in "Add" methods.
func (*InlineQueryResponder) CreateLocationMessage ¶
func (iqs *InlineQueryResponder) CreateLocationMessage(latitude, longitude, accuracy float32, liveperiod, heading, proximityAlertRadius int) objs.InputMessageContent
Use this function to create a location message to be passed as "message" argument in "Add" methods.
func (*InlineQueryResponder) CreateTextMessage ¶
func (iqs *InlineQueryResponder) CreateTextMessage(text, parseMode string, entities []objs.MessageEntity, disabelWebPagePreview bool) objs.InputMessageContent
Use this function to create a text message to be passed as "message" argument in "Add" methods.
func (*InlineQueryResponder) CreateVenueMessage ¶
func (iqs *InlineQueryResponder) CreateVenueMessage(latitude, longitude float32, title, address, foursquareId, foursquareType, googlePlaceId, googlePlaceType string) objs.InputMessageContent
Use this function to create a venue message to be passed as "message" argument in "Add" methods.
func (*InlineQueryResponder) Send ¶
func (iqs *InlineQueryResponder) Send() (interface{}, error)
Sends this answer to the user. The returned result can have two types : Result[bool] or SentWebAppMessage.
func (*InlineQueryResponder) SetButton ¶
func (iqs *InlineQueryResponder) SetButton(text, startParameter, webAppURL string)
SetButton adds a button that will be shown above inline query results.
Arguments :
1. text : Label text on the button
2. webAppURL : Description of the Web App that will be launched when the user presses the button. The Web App will be able to switch back to the inline mode using the method switchInlineQuery inside the Web App.
3. startParameter : Deep-linking parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed. Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.
type Invoice ¶
type Invoice struct {
// contains filtered or unexported fields
}
Invoice is an invoice that can be modified and sent to the user.
func (*Invoice) AddPrice ¶
AddPrice adds a new price label to this invoice.
"amount" is the price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145.
func (*Invoice) CreateLink ¶
CreateLink creates a link for the invoice and returnes the link.
-------------------------------
Official telegram doc :
Use this method to create a link for an invoice. Returns the created invoice link as String on success.
type Keyboard ¶
type Keyboard struct {
// contains filtered or unexported fields
}
Keyboard is a normal Keyboard.
func (*Keyboard) AddButton ¶
AddButton adds a new button holding the given text to the specified row. According to telegram bot api if this button is pressed the text inside the button will be sent to the bot as a message.
Note : row number starts from 1. (it's not zero based). If any number lower than 1 is passed, no button will be added
func (*Keyboard) AddButtonHandler ¶
func (kb *Keyboard) AddButtonHandler(text string, row int, handler func(*objs.Update), chatTypes ...string)
AddButtonHandler adds a new button holding the given text to the specified row. This method also adds a handler for that button so everytime this button is pressed the handler will be called. You can read the documentation of "AddHandler" for better understanding on handlers.
Note : row number starts from 1. (it's not zero based). If any number lower than 1 is passed, no button will be added
func (*Keyboard) AddContactButton ¶
AddContactButton adds a new contact button. According to telegram bot api when this button is pressed,the user's phone number will be sent as a contact. Available in private chats only.
Note: ContactButtons and LocationButtons will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.
Note : row number starts from 1. (it's not zero based). If any number lower than 1 is passed, no button will be added
func (*Keyboard) AddLocationButton ¶
AddLocationButton adds a new location button. According to telegram bot api when this button is pressed,the user's location will be sent. Available in private chats only.
Note: ContactButtons and LocationButtons will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.
Note : row number starts from 1. (it's not zero based). If any number lower than 1 is passed, no button will be added
func (*Keyboard) AddPollButton ¶
AddPollButton adds a new poll button. According to telegram bot api, the user will be asked to create a poll and send it to the bot when this button is pressed. Available in private chats only.
Note: PollButton will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.
Note : row number starts from 1. (it's not zero based). If any number lower than 1 is passed, no button will be added.
Note : poll type can be "regular" or "quiz". Any other value will cause the button not to be added.
func (*Keyboard) AddRequestChatButton ¶
func (kb *Keyboard) AddRequestChatButton(text string, row, requestId int, chatIsChannel, chatIsForum, chatHasUsername, chatIsCreated, botIsMember bool, userAdminRights, botAdminRights *objs.ChatAdministratorRights, handler func(*objs.Update))
AddRequestChatButton adds a button that asks for a chat to be selected when its pressed.
The identifier of the selected chat will be shared with the bot in the ChatShared object of Message object when the corresponding button is pressed.
Arguments :
1. requestId : Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message.
2. chatIsChannel : Pass True to request a channel chat, pass False to request a group or a supergroup chat.
3. chatIsForum : Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied.
4. chatHasUsername : Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied.
5. chatIsCreated : Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied.
6. botIsMemeber : Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.
7. userAdminRights : A ChatAdministratorRights object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied.
8. botAdminRights : A ChatAdministratorRights object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied.
9. handler : A handler that will be executed when the user presses this button. If handler is not nil, bot automatically parses the incoming updates on this request id. Pass nil if you don't want any handler.
func (*Keyboard) AddRequestUserButton ¶
func (kb *Keyboard) AddRequestUserButton(text string, row, requestId int, userIsBot, userIsPremium bool, handler func(*objs.Update))
AddRequestUserButton adds a buuton which asks for a users chat when its pressed.
The identifier of the selected user will be shared with the bot in the UserShared object of Message object when the corresponding button is pressed.
Arguments :
1. requestId : Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message.
2. userIsBot : Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied.
3. userIsPremimum : True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied.
4. handler : A handler that will be executed when the user presses this button. If handler is not nil, bot automatically parses the incoming updates on this request id. Pass nil if you don't want any handler.
type LiveLocation ¶
type LiveLocation struct {
// contains filtered or unexported fields
}
LiveLocation is a live location that can be sent to a user.
func (*LiveLocation) Edit ¶
func (ll *LiveLocation) Edit(latitude, langitude, horizontalAccuracy float32, heading, proximtyAlertRadius int, replyMarkUp *objs.InlineKeyboardMarkup) (*objs.Result[json.RawMessage], error)
Edit edits the live location.
------------------------
Official telegram doc :
Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
func (*LiveLocation) Send ¶
func (ll *LiveLocation) Send(chatId int, silent, protectContent bool) (*objs.Result[*objs.Message], error)
Send sends this live location to all types of chats but channels. To send it to a channel use "SendToChannelMethod".
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
------------------------
Official telegram doc :
Use this method to send point on the map. On success, the sent Message is returned.
func (*LiveLocation) SendToChannel ¶
func (ll *LiveLocation) SendToChannel(chatId string, silent, protectContent bool) (*objs.Result[*objs.Message], error)
SendToChannel sends this live location to a channel. Chat id should be the username of the channel.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
------------------------
Official telegram doc :
Use this method to send point on the map. On success, the sent Message is returned.
func (*LiveLocation) Stop ¶
func (ll *LiveLocation) Stop(replyMarkrup objs.InlineKeyboardMarkup) (*objs.Result[json.RawMessage], error)
Stop stops the live location.
------------------------
Official telegram doc :
Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.
type MarkUps ¶
type MarkUps interface {
// contains filtered or unexported methods
}
MarkUps is the interface used for creating normal keyboards and inline keyboards.
type MediaGroup ¶
type MediaGroup struct {
// contains filtered or unexported fields
}
MediaGroup is a media group that can be sent
func (*MediaGroup) AddAnimation ¶
func (mg *MediaGroup) AddAnimation(caption, parseMode string, width, height, duration int, hasSpoiler bool, captionEntitie []objs.MessageEntity) (*AnimationInserter, error)
AddAnimation returns an AnimationInserter to add an animation to the album
func (*MediaGroup) AddAudio ¶
func (mg *MediaGroup) AddAudio(caption, parseMode, performer, title string, duration int, captionEntitie []objs.MessageEntity) (*AudioInserter, error)
AddAudio returns an AudioInserter to add an audio to the album
func (*MediaGroup) AddDocument ¶
func (mg *MediaGroup) AddDocument(caption, parseMode string, disableContentTypeDetection bool, captionEntitie []objs.MessageEntity) (*DocumentInserter, error)
AddDocument returns a DocumentInserter to add a document to the album
func (*MediaGroup) AddPhoto ¶
func (mg *MediaGroup) AddPhoto(caption, parseMode string, hasSpoiler bool, captionEntitie []objs.MessageEntity) (*PhotoInserter, error)
AddPhoto returns a PhotoInserter to add a photo to the album
func (*MediaGroup) AddVideo ¶
func (mg *MediaGroup) AddVideo(caption, parseMode string, width, height, duration int, supportsStreaming, hasSpoiler bool, captionEntitie []objs.MessageEntity) (*VideoInserter, error)
AddVideo returns a VideoInserter to add a video to the album
func (*MediaGroup) Send ¶
func (mg *MediaGroup) Send(chatId int, silent, protectContent bool) (*objs.Result[[]objs.Message], error)
Send sends this album (to all types of chat but channels, to send to channels use "SendToChannel" method)
--------------------
Official telegram doc :
Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*MediaGroup) SendToChannel ¶
func (mg *MediaGroup) SendToChannel(chatId string, silent, protectContent bool) (*objs.Result[[]objs.Message], error)
Send sends this album to a channel.
--------------------
Official telegram doc :
Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
type MediaSender ¶
type MediaSender struct {
// contains filtered or unexported fields
}
MediaSender is a tool for sending media messages.
func (*MediaSender) SendByFile ¶
func (ms *MediaSender) SendByFile(file *os.File, silent, protectContent bool) (*objs.Result[*objs.Message], error)
SendByFile sends a file that is located in this device.
func (*MediaSender) SendByFileIdOrUrl ¶
func (ms *MediaSender) SendByFileIdOrUrl(fileIdOrUrl string, silent, protectContent bool) (*objs.Result[*objs.Message], error)
SendByFileIdOrUrl sends a file that already exists on telegram servers (file id) or a url on the web.
func (*MediaSender) SetThumbnail ¶
func (ms *MediaSender) SetThumbnail(fileIdOrURL string)
SetThumbnail sets the tumbnail of the file. It takes a file id or a url. If you want to send a file use "setThumbnailFile" instead. If this media does not support thumbnail, the thumbnail will be ignored.
func (*MediaSender) SetThumbnailFile ¶
func (ms *MediaSender) SetThumbnailFile(file *os.File) error
SetThumbnailFile sets the thumbnail of the file. It takes a file existing on the device. If this media does not support thumbnail, the thumbnail will be ignored.
type MessageCopier ¶
type MessageCopier struct {
// contains filtered or unexported fields
}
MessageCopier is tool for copying messages.
func (*MessageCopier) CopyFromChannelToChannel ¶
func (mf *MessageCopier) CopyFromChannelToChannel(chatId, fromChatId string) (*objs.Result[*objs.Message], error)
CopyFromChannelToChannel copies the given message from a channel to another channel. chatId is the channel that message is being copied to and fromChatId is the channel that message is being copied to.
func (*MessageCopier) CopyFromChannelToUser ¶
func (mf *MessageCopier) CopyFromChannelToUser(chatId int, fromChatId string) (*objs.Result[*objs.Message], error)
CopyFromChannelToUser copies the given message from a channel to a user. chatId is the user that message is being copied to and fromChatId is the channel that message is being copied to.
func (*MessageCopier) CopyFromUserToChannel ¶
func (mf *MessageCopier) CopyFromUserToChannel(chatId string, fromChatId int) (*objs.Result[*objs.Message], error)
CopyFromUserToChannel copies the given message from a user to a channel. chatId is the channel that message is being copied to and fromChatId is the user that message is being copied to.
func (*MessageCopier) CopyFromUserToUser ¶
func (mf *MessageCopier) CopyFromUserToUser(chatId, fromChatId int) (*objs.Result[*objs.Message], error)
CopyFromUserToUser copies the given message from a user to another user. chatId is the user that message is being copied to and fromChatId is the user that message is being copied to.
type MessageEditor ¶
type MessageEditor struct {
// contains filtered or unexported fields
}
MessageEditor is a tool for editing messsages.
func (*MessageEditor) DeletIn ¶
func (me *MessageEditor) DeletIn(messageId int, delay time.Duration)
DeletIn deletes the message with a delay. Delay should be in time.Duration format. Once this method is called it cannot be canceled. All the rules of DeleteMessage method apply to this method too.
func (*MessageEditor) DeleteMessage ¶
DeleteMessage can be used to delete a message, including service messages, with the following limitations:
- A message can only be deleted if it was sent less than 48 hours ago.
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
- Bots can delete outgoing messages in private chats, groups, and supergroups.
- Bots can delete incoming messages in private chats.
- Bots granted can_post_messages permissions can delete outgoing messages in channels.
- If the bot is an administrator of a group, it can delete any message there.
- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
- Note that service messages about forum topic creation can't be deleted with the deleteMessage method.
Returns True on success.
func (*MessageEditor) EditCaption ¶
func (me *MessageEditor) EditCaption(messageId int, caption, inlineMessageId, parseMode string, captionEntities []objs.MessageEntity, keyboard *InlineKeyboard) (*objs.Result[json.RawMessage], error)
EditCaption can be used to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
func (*MessageEditor) EditMediaAnimation ¶
func (mg *MessageEditor) EditMediaAnimation(messageId int, caption, parseMode string, width, height, duration int, captionEntitie []objs.MessageEntity, keyboard *InlineKeyboard) *AnimationEditor
EditMediaAnimation returns an AnimationEditor to edit an animation
func (*MessageEditor) EditMediaAudio ¶
func (mg *MessageEditor) EditMediaAudio(messageId int, caption, parseMode, performer, title string, duration int, captionEntitie []objs.MessageEntity, keyboard *InlineKeyboard) *AudioEditor
EditMediaAudio returns an AudioEditor to edit an audio
func (*MessageEditor) EditMediaDocument ¶
func (mg *MessageEditor) EditMediaDocument(messageId int, caption, parseMode string, disableContentTypeDetection bool, captionEntitie []objs.MessageEntity, keyboard *InlineKeyboard) *DocumentEditor
EditMediaDocument returns a DocumentEditor to edit a document
func (*MessageEditor) EditMediaPhoto ¶
func (mg *MessageEditor) EditMediaPhoto(messageId int, caption, parseMode string, captionEntitie []objs.MessageEntity, keyboard *InlineKeyboard) *PhotoEditor
EditMediaPhoto returns a PhotoEditor to edit a photo
func (*MessageEditor) EditMediaVideo ¶
func (mg *MessageEditor) EditMediaVideo(messageId int, caption, parseMode string, width, height, duration int, supportsStreaming bool, captionEntitie []objs.MessageEntity, keyboard *InlineKeyboard) *VideoEditor
EditMediaVideo returns a VideoEditor to edit a video
func (*MessageEditor) EditReplyMarkup ¶
func (me *MessageEditor) EditReplyMarkup(messageId int, inlineMessageId string, keyboard *InlineKeyboard) (*objs.Result[json.RawMessage], error)
EditReplyMarkup can be used to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
func (*MessageEditor) EditText ¶
func (me *MessageEditor) EditText(messageId int, text, inlineMessageId, parseMode string, entities []objs.MessageEntity, disableWebPagePreview bool, keyboard *InlineKeyboard) (*objs.Result[json.RawMessage], error)
EditText can be used to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
type MessageForwarder ¶
type MessageForwarder struct {
// contains filtered or unexported fields
}
MessageForwarder is a tool for forwarding messages.
func (*MessageForwarder) ForwardFromChannelToChannel ¶
func (mf *MessageForwarder) ForwardFromChannelToChannel(chatId, fromChatId string) (*objs.Result[*objs.Message], error)
ForwardFromChannelToChannel forwards the given message from a channel to another channel. chatId is the channel that message is being forwarded to and fromChatId is the channel that message is being forwarded to.
func (*MessageForwarder) ForwardFromChannelToUser ¶
func (mf *MessageForwarder) ForwardFromChannelToUser(chatId int, fromChatId string) (*objs.Result[*objs.Message], error)
ForwardFromChannelToUser forwards the given message from a channel to a user. chatId is the user that message is being forwarded to and fromChatId is the channel that message is being forwarded to.
func (*MessageForwarder) ForwardFromUserToChannel ¶
func (mf *MessageForwarder) ForwardFromUserToChannel(chatId string, fromChatId int) (*objs.Result[*objs.Message], error)
ForwardFromUserToChannel forwards the given message from a user to a channel. chatId is the channel that message is being forwarded to and fromChatId is the user that message is being forwarded to.
func (*MessageForwarder) ForwardFromUserToUser ¶
func (mf *MessageForwarder) ForwardFromUserToUser(chatId, fromChatId int) (*objs.Result[*objs.Message], error)
ForwardFromUserToUser forwards the given message from a user to another user. chatId is the user that message is being forwarded to and fromChatId is the user that message is being forwarded to.
type PhotoEditor ¶
type PhotoEditor struct {
// contains filtered or unexported fields
}
PhotoEditor is a tool for editing photos.
func (*PhotoEditor) EditByFile ¶
func (pi *PhotoEditor) EditByFile(file *os.File) (*objs.Result[json.RawMessage], error)
EditByFile edits this photo with an existing file in the device
func (*PhotoEditor) EditByFileIdOrURL ¶
func (pi *PhotoEditor) EditByFileIdOrURL(fileIdOrUrl string) (*objs.Result[json.RawMessage], error)
EditByFileIdOrURL edits this photo by file id or url
type PhotoInserter ¶
type PhotoInserter struct {
// contains filtered or unexported fields
}
PhotoInserter is a tool for inserting photos into the MediaGroup.
func (*PhotoInserter) AddByFile ¶
func (pi *PhotoInserter) AddByFile(file *os.File) error
AddByFile adds an existing file in the device
func (*PhotoInserter) AddByFileIdOrURL ¶
func (pi *PhotoInserter) AddByFileIdOrURL(fileIdOrUrl string)
AddByFileIdOrURL adds this file by file id or url
type Poll ¶
type Poll struct {
// contains filtered or unexported fields
}
Poll is an automatic poll.
func (*Poll) AddOption ¶
AddOption adds an option to poll.
-If the poll has been sent this method will do nothing.
func (*Poll) GetCorrectOption ¶
GetCorrectOption returns the correct option id. returnes 0 if type of the poll is "regular"
func (*Poll) GetExplanation ¶
GetExplanation returns the explanation of this poll
func (*Poll) GetOptions ¶
GetOptions returns the options of this poll
func (*Poll) GetQuestion ¶
GetQuestion returns the question of this poll
func (*Poll) GetResult ¶
func (p *Poll) GetResult() []objs.PollOption
GetResult returns the up to date result of the poll
func (*Poll) GetTotalVoters ¶
GetTotalVoters returns the up to date total number of voters for this poll
func (*Poll) GetUpdateChannel ¶
GetUpdateChannel returns the update channel for this poll. Everytime an update is received which contains update for this poll, true is passed into the channel.
func (*Poll) Send ¶
Send sends the poll. If you want more options foe sending the bot, use "SendAdvanced" method.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*Poll) SendAdvanced ¶
func (p *Poll) SendAdvanced(replyTo, messageThreadId int, silent, allowSendingWithOutReply, protectContent bool, replyMarkup objs.ReplyMarkup) error
SendAdvanced sends the poll. This method has more options than "Send" method.
If "silent" argument is true, the message will be sent without notification.
If "protectContent" argument is true, the message can't be forwarded or saved.
func (*Poll) SetCloseDate ¶
SetCloseDate sets the close date of this poll.
-If open period has been specified, this method wont set close date for the poll.
-If the poll has been sent this method will do nothing.
func (*Poll) SetCorrectOption ¶
SetCorrectOption sets the correct option id for the poll. The correct option is the index of the the true option in the options array.(0 based)
-If the type of this bot is "regular" this method will do nothing.
-If the poll has been sent this method will do nothing.
func (*Poll) SetExplanation ¶
func (p *Poll) SetExplanation(explanation, explanationParseMode string, explanationEntities []objs.MessageEntity)
SetExplanation sets explanation if this poll.
If the poll has been sent this method will do nothing.
func (*Poll) SetFlags ¶
SetFlags sets the flags of this poll. Flags are "isClosed","isAnonymous" and "allowMultipleAnswers".
-If the poll has been sent this method will do nothing.
func (*Poll) SetOpenPeriod ¶
SetOpenPeriod sets open period of this poll. According to official telegram doc, open period is amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.
-If close date has been specified, this method wont set open period.
-If the poll has been sent this method will do nothing.
type StickerEditor ¶
type StickerEditor struct {
// contains filtered or unexported fields
}
func (*StickerEditor) Delete ¶
func (se *StickerEditor) Delete() (*objs.Result[bool], error)
Delete deletes this sticker from the set it belongs to.
func (*StickerEditor) SetEmojiList ¶
SetEmojiList sets a new emoji list for this sticker.
func (*StickerEditor) SetKeywords ¶
SetKeyword sets a new keyword list for this sticker. Maximum length is 20.
func (*StickerEditor) SetMaskPosition ¶
func (se *StickerEditor) SetMaskPosition(maskPosition *objs.MaskPosition) (*objs.Result[bool], error)
SetMaskPosition sets a new mask position for this sticker.
type StickerSet ¶
type StickerSet struct {
// contains filtered or unexported fields
}
StickerSet is a set of stickers.
func (*StickerSet) AddAnimatedSticker
deprecated
func (ss *StickerSet) AddAnimatedSticker(tgsFile *os.File, emojies string, maskPosition *objs.MaskPosition) (*objs.Result[bool], error)
Deprecated: This function should no longer be used for adding stickers to a sticker set. Use "AddNewSticker" method instead.
func (*StickerSet) AddNewSticker ¶
func (ss *StickerSet) AddNewSticker(fileIdOrURL string, userId int, emojiList, keywords []string, maskPosition *objs.MaskPosition) (bool, error)
AddNewSticker adds a new sticker to this set. If the set has been created before then the sticker will be added to sticker set on telegram servers.
If not created yet, then the sticker is added to an internal array. The "Create" function should be called after all stickers have been added.
userId is the user id of the owner.
func (*StickerSet) AddNewStickerByFile ¶
func (ss *StickerSet) AddNewStickerByFile(file *os.File, userId int, emojiList, keywords []string, maskPosition *objs.MaskPosition) (bool, error)
AddNewStickerByFile adds a new sticker to this set. If the set has been created before then the sticker will be added to sticker set on telegram servers.
If not created yet, then the sticker is added to an internal array. The "Create" function should be called after all stickers have been added.
userId is the user id of the owner.
func (*StickerSet) AddPngSticker
deprecated
func (ss *StickerSet) AddPngSticker(pngPicFileIdOrUrl, emojies string, maskPosition *objs.MaskPosition) (*objs.Result[bool], error)
Deprecated: This function should no longer be used for adding stickers to a sticker set. Use "AddNewSticker" method instead.
func (*StickerSet) AddPngStickerByFile
deprecated
func (ss *StickerSet) AddPngStickerByFile(pngPicFile *os.File, emojies string, maskPosition *objs.MaskPosition) (*objs.Result[bool], error)
Deprecated: This function should no longer be used for adding stickers to a sticker set. Use "AddNewSticker" method instead.
func (*StickerSet) AddSticker
deprecated
func (ss *StickerSet) AddSticker(pngStickerFileIdOrUrl string, pngStickerFile *os.File, tgsSticker *os.File, emojies string, maskPosition *objs.MaskPosition) (*objs.Result[bool], error)
Deprecated: This function should no longer be used for adding stickers to a sticker set. Use "AddNewSticker" method instead.
func (*StickerSet) AddVideoSticker
deprecated
func (ss *StickerSet) AddVideoSticker(webmFile *os.File, emojies string, maskPosition *objs.MaskPosition) (*objs.Result[bool], error)
Deprecated: This function should no longer be used for adding stickers to a sticker set. Use "AddNewSticker" method instead.
func (*StickerSet) Create ¶
func (ss *StickerSet) Create() (bool, error)
Create is used for creating this sticker set if it has not been created before.
func (*StickerSet) Delete ¶
func (ss *StickerSet) Delete() (*objs.Result[bool], error)
Delete deletes a sticker set that was created by this bot.
func (*StickerSet) DeleteStickerFromSet ¶
DeleteStickerFromSet can be used to delete a sticker from a set created by the bot. Returns True on success.
"sticker" is file identifier of the sticker.
func (*StickerSet) GetName ¶
func (ss *StickerSet) GetName() string
GetName returnes the name of this sticker set
func (*StickerSet) GetStickers ¶
func (ss *StickerSet) GetStickers() []objs.Sticker
GetStickers returns the sticker in this sticker set.
func (*StickerSet) GetThumb ¶
func (ss *StickerSet) GetThumb() *objs.PhotoSize
GetThumb returns the thumbnail of this sticker set
func (*StickerSet) GetTitle ¶
func (ss *StickerSet) GetTitle() string
GetTitle returns the title of this sticker set
func (*StickerSet) SetStickerPosition ¶
SetStickerPosition can be used to move a sticker in a set created by the bot to a specific position. Returns True on success.
"sticker" is file identifier of the sticker and "position" is new sticker position in the set, zero-based
func (*StickerSet) SetThumb ¶
SetThumb can be used to set the thumbnail of a sticker set using url or file id. Animated thumbnails can be set for animated sticker sets only. Returns True on success.
func (*StickerSet) SetThumbByFile ¶
SetThumbByFile can be used to set the thumbnail of a sticker set using a file on the computer. Animated thumbnails can be set for animated sticker sets only. Returns True on success.
type TextFormatter ¶
type TextFormatter struct {
// contains filtered or unexported fields
}
TextFormatter is tool for creating formatted texts.
func (*TextFormatter) AddBold ¶
func (mf *TextFormatter) AddBold(text string)
AddBold adds a bold text to the original text.
func (*TextFormatter) AddBotCommand ¶
func (mf *TextFormatter) AddBotCommand(text string)
AddBotCommand adds a bot command to the original text. example : /start@jobs_bot
func (*TextFormatter) AddCashtag ¶
func (mf *TextFormatter) AddCashtag(text string)
AddCashtag adds a cashtag to the original text. exzmple : $USD
func (*TextFormatter) AddCode ¶
func (mf *TextFormatter) AddCode(text, language string)
AddCode adds a piece of code (programming code) to the original text.
func (*TextFormatter) AddEmail ¶
func (mf *TextFormatter) AddEmail(text string)
AddEmail adds an email to the original text. example : do-not-reply@telegram.org
func (*TextFormatter) AddHashtag ¶
func (mf *TextFormatter) AddHashtag(text string)
AddHashtag adds a hashtag to the original text. example : #hashtag
func (*TextFormatter) AddItalic ¶
func (mf *TextFormatter) AddItalic(text string)
AddItalic adds an italic text to the original text.
func (*TextFormatter) AddMention ¶
func (mf *TextFormatter) AddMention(text string)
AddMention adds a mention to the original text. example : @username
func (*TextFormatter) AddNormal ¶
func (mf *TextFormatter) AddNormal(text string)
AddNormal adds a normal text to the original text
func (*TextFormatter) AddPhoneNumber ¶
func (mf *TextFormatter) AddPhoneNumber(text string)
AddPhoneNumber adds a phone number to the original text. example : +1-212-555-0123
func (*TextFormatter) AddSpoiler ¶
func (mf *TextFormatter) AddSpoiler(text string)
AddSpoiler adds a spoiler text to the original text. This text is hidden until user clicks on it.
func (*TextFormatter) AddStrike ¶
func (mf *TextFormatter) AddStrike(text string)
AddStrike adds a strikethrough text to the original text.
func (*TextFormatter) AddTextLink ¶
func (mf *TextFormatter) AddTextLink(text, url string)
AddTextLink adds a text link (clickable text which opens a URL) to the original text.
func (*TextFormatter) AddTextMention ¶
func (mf *TextFormatter) AddTextMention(text string, user *objs.User)
AddTextMention adds a mention (for users without username) to the original text.
func (*TextFormatter) AddURL ¶
func (mf *TextFormatter) AddURL(text string)
AddURL adds a url (not a clickable text url) to the original text. example : https://telegram.org
func (*TextFormatter) AddUnderline ¶
func (mf *TextFormatter) AddUnderline(text string)
AddUnderline adds an underlined text to the original text.
func (*TextFormatter) GetEntities ¶
func (mf *TextFormatter) GetEntities() []objs.MessageEntity
GetEntities returnss the entities array
func (*TextFormatter) GetText ¶
func (mf *TextFormatter) GetText() string
GetText returns the original text
type VideoEditor ¶
type VideoEditor struct {
// contains filtered or unexported fields
}
VideoEditor is a tool for editing videos.
func (*VideoEditor) EditByFile ¶
func (vi *VideoEditor) EditByFile(file *os.File) (*objs.Result[json.RawMessage], error)
EditByFile edits this video by file in the device
func (*VideoEditor) EditByFileIdOrURL ¶
func (vi *VideoEditor) EditByFileIdOrURL(fileIdOrUrl string) (*objs.Result[json.RawMessage], error)
EditByFileIdOrURL edits this video by file id or url
func (*VideoEditor) EditThumbnail ¶
func (vi *VideoEditor) EditThumbnail(fileIdOrURL string)
EditThumbnail edits the tumbnail of the file. It takes a fileId or a url. If you want to send a file use "setThumbnailFile" instead.
func (*VideoEditor) EditThumbnailFile ¶
func (vi *VideoEditor) EditThumbnailFile(file *os.File) error
EditThumbnailFile edits the thumbnail of the file. It takes a file existing on the device
type VideoInserter ¶
type VideoInserter struct {
// contains filtered or unexported fields
}
VideoInserter is a tool for inserting videos into the MediaGroup.
func (*VideoInserter) AddByFile ¶
func (vi *VideoInserter) AddByFile(file *os.File) error
AddByFile adds an existing file in the device
func (*VideoInserter) AddByFileIdOrURL ¶
func (vi *VideoInserter) AddByFileIdOrURL(fileIdOrUrl string)
AddByFileIdOrURL adds this file by file id or url
func (*VideoInserter) SetThumbnail ¶
func (vi *VideoInserter) SetThumbnail(fileIdOrURL string)
SetThumbnail sets the tumbnail of the file. It takes a fileId or a url. If you want to send a file use "setThumbnailFile" instead.
func (*VideoInserter) SetThumbnailFile ¶
func (vi *VideoInserter) SetThumbnailFile(file *os.File) error
SetThumbnailFile sets the tumbnail of the file. It takes a file existing on the device
Source Files ¶
- advancedBot.go
- bot.go
- botmanager.go
- chatManager.go
- commandsManager.go
- forumTopicManager.go
- generalForumTopicManager.go
- inlineQueryResponder.go
- invoiceSender.go
- keyboard.go
- liveLocation.go
- mediaGroup.go
- mediaSender.go
- messageCopier.go
- messageEditor.go
- messageFormatter.go
- messageForwarder.go
- poll.go
- stickerEditor.go
- stickerSet.go