tba

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartWebHook

func StartWebHook(cfg *cfg.BotConfigs, iuc *chan *objs.Update, cuc *chan *objs.ChatUpdate) error

StartWebHook starts the webhook.

Types

type BotAPIInterface

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

BotAPIInterface is the interface which connects the telegram bot API to the bot.

func CreateInterface

func CreateInterface(botCfg *cfgs.BotConfigs) (*BotAPIInterface, error)

CreateInterface returns an iterface to communicate with the bot api. If the updateFrequency argument is not nil, the update routine begins automtically

func (*BotAPIInterface) AddStickerToSet

func (bai *BotAPIInterface) AddStickerToSet(userId int, name, pngSticker, tgsSticker, webmSticker, emojies string, maskPosition *objs.MaskPosition, file *os.File) (*objs.LogicalResult, error)

AddStickerToSet adds a new sticker to the given set.

func (*BotAPIInterface) AnswerCallbackQuery

func (bai *BotAPIInterface) AnswerCallbackQuery(callbackQueryId, text, url string, showAlert bool, CacheTime int) (*objs.LogicalResult, error)

AnswerCallbackQuery answers a callback query

func (*BotAPIInterface) AnswerInlineQuery

func (bai *BotAPIInterface) AnswerInlineQuery(inlineQueryId string, results []objs.InlineQueryResult, cacheTime int, isPersonal bool, nextOffset, switchPmText, switchPmParameter string) (*objs.LogicalResult, error)

AnswerInlineQuery answers an inline query with the given parameters

func (*BotAPIInterface) AnswerPreCheckoutQuery

func (bai *BotAPIInterface) AnswerPreCheckoutQuery(preCheckoutQueryId string, ok bool, errorMessage string) (*objs.LogicalResult, error)

AnswerPreCheckoutQuery answers a pre checkout query

func (*BotAPIInterface) AnswerShippingQuery

func (bai *BotAPIInterface) AnswerShippingQuery(shippingQueryId string, ok bool, shippingOptions []objs.ShippingOption, errorMessage string) (*objs.LogicalResult, error)

AnswerShippingQuery answers a shipping query

func (*BotAPIInterface) AnswerWebAppQuery added in v1.8.0

func (bai *BotAPIInterface) AnswerWebAppQuery(webAppQueryId string, result objs.InlineQueryResult) (*objs.SentWebAppMessage, error)

AnswerWebAppQuery answers a web app query

func (*BotAPIInterface) ApproveChatJoinRequest

func (bai *BotAPIInterface) ApproveChatJoinRequest(chatIdInt int, chatIdString string, userId int) (*objs.LogicalResult, error)

ApproveChatJoinRequest approves a request from the given user to join the chat.

func (*BotAPIInterface) BanChatMember

func (bai *BotAPIInterface) BanChatMember(chatIdInt int, chatIdString string, userId, untilDate int, revokeMessages bool) (*objs.LogicalResult, error)

BanChatMember bans a chat member

func (*BotAPIInterface) BanOrUnbanChatSenderChat

func (bai *BotAPIInterface) BanOrUnbanChatSenderChat(chatIdInt int, chatIdString string, senderChatId int, ban bool) (*objs.LogicalResult, error)

BanOrUnbanChatSenderChat bans or unbans a channel in the group..

func (*BotAPIInterface) CopyMessage

func (bai *BotAPIInterface) CopyMessage(chatIdInt, fromChatIdInt int, chatIdString, fromChatIdString string, messageId int, disableNotif bool, caption, parseMode string, replyTo int, allowSendingWihtoutReply, ProtectContent bool, replyMarkUp objs.ReplyMarkup, captionEntities []objs.MessageEntity) (*objs.SendMethodsResult, error)

CopyMessage copies a message from a user or channel and sends it to a user or channel. If the source or destination (or both) of the forwarded message is a channel, only string chat ids should be given to the function, and if it is user only int chat ids should be given. "chatId", "fromChatId" and "messageId" arguments are required. other arguments are optional for bot api.

func (bai *BotAPIInterface) CreateChatInviteLink(chatIdInt int, chatIdString, name string, expireDate, memberLimit int, createsJoinRequest bool) (*objs.ChatInviteLinkResult, error)

CreateChatInviteLink creates a new invite link for the chat.

func (bai *BotAPIInterface) CreateInvoiceLink(title, description, payload, providerToken, currency string, prices []objs.LabeledPrice, maxTipAmount int, suggestedTipAmounts []int, providerData, photoURL string, photoSize, photoWidth, photoHeight int, needName, needPhoneNumber, needEmail, needSippingAddress, sendPhoneNumberToProvider, sendEmailToProvider, isFlexible bool) (*objs.StringResult, error)

CreateInvoiceLink sends an invoice

func (*BotAPIInterface) CreateNewStickerSet

func (bai *BotAPIInterface) CreateNewStickerSet(userId int, name, title, pngSticker, tgsSticker, webmSticker, emojies string, containsMasks bool, maskPosition *objs.MaskPosition, file *os.File) (*objs.LogicalResult, error)

CreateNewStickerSet creates a new sticker set with the given arguments

func (*BotAPIInterface) DeclineChatJoinRequest

func (bai *BotAPIInterface) DeclineChatJoinRequest(chatIdInt int, chatIdString string, userId int) (*objs.LogicalResult, error)

DeclineChatJoinRequest declines a request from the given user to join the chat.

func (*BotAPIInterface) DeleteChatPhoto

func (bai *BotAPIInterface) DeleteChatPhoto(chatIdInt int, chatIdString string) (*objs.LogicalResult, error)

DeleteChatPhoto deletes chat photo.

func (*BotAPIInterface) DeleteChatStickerSet

func (bai *BotAPIInterface) DeleteChatStickerSet(chatIdInt int, chatIdString string) (*objs.LogicalResult, error)

DeleteChatStickerSet deletes the sticker set of the chat..

func (*BotAPIInterface) DeleteMessage

func (bai *BotAPIInterface) DeleteMessage(chatIdInt int, chatIdString string, messageId int) (*objs.LogicalResult, error)

DeleteMessage deletes the given message int the given chat.

func (*BotAPIInterface) DeleteMyCommands

func (bai *BotAPIInterface) DeleteMyCommands(scope objs.BotCommandScope, languageCode string) (*objs.LogicalResult, error)

DeleteMyCommands deletes the commands of the bot

func (*BotAPIInterface) DeleteStickerFromSet

func (bai *BotAPIInterface) DeleteStickerFromSet(sticker string) (*objs.LogicalResult, error)

DeleteStickerFromSet deletes the given sticker from a set created by the bot

func (*BotAPIInterface) DeleteWebhook

func (bai *BotAPIInterface) DeleteWebhook(dropPendingUpdates bool) (*objs.LogicalResult, error)

DeleteWebhook deletes the webhook for this bot

func (*BotAPIInterface) DownloadFile

func (bai *BotAPIInterface) DownloadFile(fileObject *objs.File, file *os.File) error

DownloadFile downloads a file from telegram servers and saves it into the given file.

This method closes the given file. If the file is nil, this method will create a file based on the name of the file stored in telegram servers.

func (bai *BotAPIInterface) EditChatInviteLink(chatIdInt int, chatIdString, inviteLink, name string, expireDate, memberLimit int, createsJoinRequest bool) (*objs.ChatInviteLinkResult, error)

EditChatInviteLink edits an existing invite link for the chat.

func (*BotAPIInterface) EditMessageCaption

func (bai *BotAPIInterface) EditMessageCaption(chatIdInt int, chatIdString string, messageId int, inlineMessageId, caption, parseMode string, captionEntities []objs.MessageEntity, replyMakrup *objs.InlineKeyboardMarkup) (*objs.DefaultResult, error)

EditMessageCaption edits the caption of the given message in the given chat.

func (*BotAPIInterface) EditMessageLiveLocation

func (bai *BotAPIInterface) EditMessageLiveLocation(chatIdInt int, chatIdString, inlineMessageId string, messageId int, latitude, longitude, horizontalAccuracy float32, heading, proximityAlertRadius int, reply_markup *objs.InlineKeyboardMarkup) (*objs.DefaultResult, error)

EditMessageLiveLocation edits a live location sent to a channel (chatIdString) or a chat (chatIdInt) "chatId","latitude" and "longitude" arguments are required. other arguments are optional for bot api. (to ignore int arguments, pass 0)

func (*BotAPIInterface) EditMessageMedia

func (bai *BotAPIInterface) EditMessageMedia(chatIdInt int, chatIdString string, messageId int, inlineMessageId string, media objs.InputMedia, replyMakrup *objs.InlineKeyboardMarkup, file ...*os.File) (*objs.DefaultResult, error)

EditMessageMedia edits the media of the given message in the given chat.

func (*BotAPIInterface) EditMessageText

func (bai *BotAPIInterface) EditMessageText(chatIdInt int, chatIdString string, messageId int, inlineMessageId, text, parseMode string, entities []objs.MessageEntity, disableWebPagePreview bool, replyMakrup *objs.InlineKeyboardMarkup) (*objs.DefaultResult, error)

EditMessageText edits the text of the given message in the given chat.

func (*BotAPIInterface) EditMessagereplyMarkup

func (bai *BotAPIInterface) EditMessagereplyMarkup(chatIdInt int, chatIdString string, messageId int, inlineMessageId string, replyMakrup *objs.InlineKeyboardMarkup) (*objs.DefaultResult, error)

EditMessagereplyMarkup edits the reply makrup of the given message in the given chat.

func (bai *BotAPIInterface) ExportChatInviteLink(chatIdInt int, chatIdString string) (*objs.StringResult, error)

ExportChatInviteLink exports the chat invite link and returns the new invite link as string.

func (*BotAPIInterface) ForwardMessage

func (bai *BotAPIInterface) ForwardMessage(chatIdInt, fromChatIdInt int, chatIdString, fromChatIdString string, disableNotif, ProtectContent bool, messageId int) (*objs.SendMethodsResult, error)

ForwardMessage forwards a message from a user or channel to a user or channel. If the source or destination (or both) of the forwarded message is a channel, only string chat ids should be given to the function, and if it is user only int chat ids should be given. "chatId", "fromChatId" and "messageId" arguments are required. other arguments are optional for bot api.

func (*BotAPIInterface) GetChat

func (bai *BotAPIInterface) GetChat(chatIdInt int, chatIdString string) (*objs.ChatResult, error)

GetChat : a Chat object containing the information of the chat will be returned

func (*BotAPIInterface) GetChatAdministrators

func (bai *BotAPIInterface) GetChatAdministrators(chatIdInt int, chatIdString string) (*objs.ChatAdministratorsResult, error)

GetChatAdministrators returns an array of ChatMember containing the informations of the chat administrators.

func (*BotAPIInterface) GetChatMember

func (bai *BotAPIInterface) GetChatMember(chatIdInt int, chatIdString string, userId int) (*objs.DefaultResult, error)

GetChatMember returns the information of the member in a ChatMember object.

func (*BotAPIInterface) GetChatMemberCount

func (bai *BotAPIInterface) GetChatMemberCount(chatIdInt int, chatIdString string) (*objs.IntResult, error)

GetChatMemberCount returns the number of the memebrs of the chat.

func (*BotAPIInterface) GetChatMenuButton added in v1.8.0

func (bai *BotAPIInterface) GetChatMenuButton(chatId int64) (*objs.MenuButtonResult, error)

GetChatMenuButton gets the menu button for the given chat

func (*BotAPIInterface) GetChatUpdateChannel

func (bai *BotAPIInterface) GetChatUpdateChannel() *chan *objs.ChatUpdate

GetChatUpdateChannel returnes the chat update channel

func (*BotAPIInterface) GetFile

func (bai *BotAPIInterface) GetFile(fileId string) (*objs.GetFileResult, error)

GetFile gets the file based on the given file id and returns the file object.

func (*BotAPIInterface) GetGameHighScores

func (bai *BotAPIInterface) GetGameHighScores(userId, chatId, messageId int, inlineMessageId string) (*objs.GameHighScoresResult, error)

GetGameHighScores gets the high scores of the user

func (*BotAPIInterface) GetMe

func (bai *BotAPIInterface) GetMe() (*objs.UserResult, error)

GetMe gets the bot info

func (*BotAPIInterface) GetMyCommands

func (bai *BotAPIInterface) GetMyCommands(scope objs.BotCommandScope, languageCode string) (*objs.GetCommandsResult, error)

GetMyCommands gets the commands of the bot

func (*BotAPIInterface) GetMyDefaultAdministratorRights added in v1.8.0

func (bai *BotAPIInterface) GetMyDefaultAdministratorRights(forChannels bool) (*objs.ChatAdministratorRightsResult, error)

GetMyDefaultAdministratorRights gets the admin rights

func (*BotAPIInterface) GetStickerSet

func (bai *BotAPIInterface) GetStickerSet(name string) (*objs.StickerSetResult, error)

GetStickerSet gets the sticker set by the given name

func (*BotAPIInterface) GetUpdateChannel

func (bai *BotAPIInterface) GetUpdateChannel() *chan *objs.Update

GetUpdateChannel returns the update channel

func (*BotAPIInterface) GetUserProfilePhotos

func (bai *BotAPIInterface) GetUserProfilePhotos(userId, offset, limit int) (*objs.ProfilePhototsResult, error)

GetUserProfilePhotos gets the user profile photos

func (*BotAPIInterface) GetWebhookInfo

func (bai *BotAPIInterface) GetWebhookInfo() (*objs.WebhookInfoResult, error)

GetWebhookInfo returns the web hook info of the bot.

func (*BotAPIInterface) LeaveChat

func (bai *BotAPIInterface) LeaveChat(chatIdInt int, chatIdString string) (*objs.LogicalResult, error)

LeaveChat, the bot will leave the chat if this method is called.

func (*BotAPIInterface) PinChatMessage

func (bai *BotAPIInterface) PinChatMessage(chatIdInt int, chatIdString string, messageId int, disableNotification bool) (*objs.LogicalResult, error)

PinChatMessage pins the message in the chat.

func (*BotAPIInterface) PromoteChatMember

func (bai *BotAPIInterface) PromoteChatMember(chatIdInt int, chatIdString string, userId int, isAnonymous, canManageChat, canPostmessages, canEditMessages, canDeleteMessages, canManageVideoChats, canRestrictMembers, canPromoteMembers, canChangeInfo, canInviteUsers, canPinMessages bool) (*objs.LogicalResult, error)

PromoteChatMember promotes a chat member

func (*BotAPIInterface) RestrictChatMember

func (bai *BotAPIInterface) RestrictChatMember(chatIdInt int, chatIdString string, userId int, permissions objs.ChatPermissions, untilDate int) (*objs.LogicalResult, error)

RestrictChatMember restricts a chat member

func (bai *BotAPIInterface) RevokeChatInviteLink(chatIdInt int, chatIdString, inviteLink string) (*objs.ChatInviteLinkResult, error)

RevokeChatInviteLink revokes the given invite link.

func (*BotAPIInterface) SendAnimation

func (bai *BotAPIInterface) SendAnimation(chatIdInt int, chatIdString, animation string, animationFile *os.File, caption, parseMode string, width, height, duration int, reply_to_message_id int, thumb string, thumbFile *os.File, disable_notification, allow_sending_without_reply, ProtectContent bool, captionEntities []objs.MessageEntity, reply_markup objs.ReplyMarkup) (*objs.SendMethodsResult, error)

SendAnimation sends an animation (file,url,telegramId) to a channel (chatIdString) or a chat (chatIdInt) "chatId" and "animation" arguments are required. other arguments are optional for bot api. (to ignore int arguments, pass 0)

func (*BotAPIInterface) SendAudio

func (bai *BotAPIInterface) SendAudio(chatIdInt int, chatIdString, audio string, audioFile *os.File, caption, parseMode string, reply_to_message_id int, thumb string, thumbFile *os.File, disable_notification, allow_sending_without_reply, ProtectContent bool, captionEntities []objs.MessageEntity, duration int, performer, title string, reply_markup objs.ReplyMarkup) (*objs.SendMethodsResult, error)

SendAudio sends an audio (file,url,telegramId) to a channel (chatIdString) or a chat (chatIdInt) "chatId" and "audio" arguments are required. other arguments are optional for bot api. (to ignore int arguments, pass 0,to ignore string arguments pass "")

func (*BotAPIInterface) SendChatAction

func (bai *BotAPIInterface) SendChatAction(chatIdInt int, chatIdString, chatAction string) (*objs.SendMethodsResult, error)

SendChatAction sends a chat action message to a channel (chatIdString) or a chat (chatIdInt) "chatId" argument is required. other arguments are optional for bot api. (to ignore int arguments, pass 0)

func (*BotAPIInterface) SendContact

func (bai *BotAPIInterface) SendContact(chatIdInt int, chatIdString, phoneNumber, firstName, lastName, vCard string, reply_to_message_id int, disable_notification, allow_sending_without_reply, ProtectContent bool, reply_markup objs.ReplyMarkup) (*objs.SendMethodsResult, error)

SendContact sends a contact to a channel (chatIdString) or a chat (chatIdInt) "chatId","phoneNumber" and "firstName" arguments are required. other arguments are optional for bot api. (to ignore int arguments, pass 0)

func (*BotAPIInterface) SendCustom

func (bai *BotAPIInterface) SendCustom(methodName string, args objs.MethodArguments, MP bool, files ...*os.File) ([]byte, error)

SendCustom calls the given method on api server with the given arguments. "MP" options indicates that the request should be made in multipart/formdata form. If this method sends a file to the api server the "MP" option should be true

func (*BotAPIInterface) SendDice

func (bai *BotAPIInterface) SendDice(chatIdInt int, chatIdString, emoji string, reply_to_message_id int, disable_notification, allow_sending_without_reply, ProtectContent bool, reply_markup objs.ReplyMarkup) (*objs.SendMethodsResult, error)

SendDice sends a dice message to a channel (chatIdString) or a chat (chatIdInt) "chatId" argument is required. other arguments are optional for bot api. (to ignore int arguments, pass 0)

func (*BotAPIInterface) SendDocument

func (bai *BotAPIInterface) SendDocument(chatIdInt int, chatIdString, document string, documentFile *os.File, caption, parseMode string, reply_to_message_id int, thumb string, thumbFile *os.File, disable_notification, allow_sending_without_reply, ProtectContent bool, captionEntities []objs.MessageEntity, DisableContentTypeDetection bool, reply_markup objs.ReplyMarkup) (*objs.SendMethodsResult, error)

sSendDocument sends a document (file,url,telegramId) to a channel (chatIdString) or a chat (chatIdInt) "chatId" and "document" arguments are required. other arguments are optional for bot api. (to ignore int arguments, pass 0)

func (*BotAPIInterface) SendGame

func (bai *BotAPIInterface) SendGame(chatId int, gameShortName string, disableNotif bool, replyTo int, allowSendingWithoutReply bool, replyMarkup objs.ReplyMarkup) (*objs.SendMethodsResult, error)

SendGame sends a game

func (*BotAPIInterface) SendInvoice

func (bai *BotAPIInterface) SendInvoice(chatIdInt int, chatIdString, 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, disableNotif bool, replyToMessageId int, allowSendingWithoutReply bool, replyMarkup objs.InlineKeyboardMarkup) (*objs.SendMethodsResult, error)

SendInvoice sends an invoice

func (*BotAPIInterface) SendLocation

func (bai *BotAPIInterface) SendLocation(chatIdInt int, chatIdString string, latitude, longitude, horizontalAccuracy float32, livePeriod, heading, proximityAlertRadius, reply_to_message_id int, disable_notification, allow_sending_without_reply, ProtectContent bool, reply_markup objs.ReplyMarkup) (*objs.SendMethodsResult, error)

SendLocation sends a location to a channel (chatIdString) or a chat (chatIdInt) "chatId","latitude" and "longitude" arguments are required. other arguments are optional for bot api. (to ignore int arguments, pass 0)

func (*BotAPIInterface) SendMediaGroup

func (bai *BotAPIInterface) SendMediaGroup(chatIdInt int, chatIdString string, reply_to_message_id int, media []objs.InputMedia, disable_notification, allow_sending_without_reply, ProtectContent bool, reply_markup objs.ReplyMarkup, files ...*os.File) (*objs.SendMediaGroupMethodResult, error)

SendMediaGroup sends an album of media (file,url,telegramId) to a channel (chatIdString) or a chat (chatIdInt) "chatId" and "media" arguments are required. other arguments are optional for bot api. (to ignore int arguments, pass 0)

func (*BotAPIInterface) SendMessage

func (bai *BotAPIInterface) SendMessage(chatIdInt int, chatIdString, text, parseMode string, entities []objs.MessageEntity, disable_web_page_preview, disable_notification, allow_sending_without_reply, ProtectContent bool, reply_to_message_id int, reply_markup objs.ReplyMarkup) (*objs.SendMethodsResult, error)

SendMessage sends a message to the user. chatIdInt is used for all chats but channles and chatidString is used for channels (in form of @channleusername) and only of them has be populated, otherwise ChatIdProblem error will be returned. "chatId" and "text" arguments are required. other arguments are optional for bot api.

func (*BotAPIInterface) SendPhoto

func (bai *BotAPIInterface) SendPhoto(chatIdInt int, chatIdString, photo string, photoFile *os.File, caption, parseMode string, reply_to_message_id int, disable_notification, allow_sending_without_reply, ProtectContent bool, reply_markup objs.ReplyMarkup, captionEntities []objs.MessageEntity) (*objs.SendMethodsResult, error)

SendPhoto sends a photo (file,url,telegramId) to a channel (chatIdString) or a chat (chatIdInt) "chatId" and "photo" arguments are required. other arguments are optional for bot api.

func (*BotAPIInterface) SendPoll

func (bai *BotAPIInterface) SendPoll(chatIdInt int, chatIdString, question string, options []string, isClosed, isAnonymous bool, pollType string, allowMultipleAnswers bool, correctOptionIndex int, explanation, explanationParseMode string, explanationEntities []objs.MessageEntity, openPeriod, closeDate int, reply_to_message_id int, disable_notification, allow_sending_without_reply, ProtectContent bool, reply_markup objs.ReplyMarkup) (*objs.SendMethodsResult, error)

SendPoll sends a poll to a channel (chatIdString) or a chat (chatIdInt) "chatId","phoneNumber" and "firstName" arguments are required. other arguments are optional for bot api. (to ignore int arguments, pass 0)

func (*BotAPIInterface) SendSticker

func (bai *BotAPIInterface) SendSticker(chatIdInt int, chatIdString, sticker string, disableNotif, allowSendingWithoutreply, protectContent bool, replyTo int, replyMarkup objs.ReplyMarkup, file *os.File) (*objs.SendMethodsResult, error)

SendSticker sends an sticker to the given chat id.

func (*BotAPIInterface) SendVenue

func (bai *BotAPIInterface) SendVenue(chatIdInt int, chatIdString string, latitude, longitude float32, title, address, fourSquareId, fourSquareType, googlePlaceId, googlePlaceType string, reply_to_message_id int, disable_notification, allow_sending_without_reply, ProtectContent bool, reply_markup objs.ReplyMarkup) (*objs.SendMethodsResult, error)

SendVenue sends a venue to a channel (chatIdString) or a chat (chatIdInt) "chatId","latitude","longitude","title" and "address" arguments are required. other arguments are optional for bot api. (to ignore int arguments, pass 0)

func (*BotAPIInterface) SendVideo

func (bai *BotAPIInterface) SendVideo(chatIdInt int, chatIdString, video string, videoFile *os.File, caption, parseMode string, reply_to_message_id int, thumb string, thumbFile *os.File, disable_notification, allow_sending_without_reply, ProtectContent bool, captionEntities []objs.MessageEntity, duration int, supportsStreaming bool, reply_markup objs.ReplyMarkup) (*objs.SendMethodsResult, error)

SendVideo sends a video (file,url,telegramId) to a channel (chatIdString) or a chat (chatIdInt) "chatId" and "video" arguments are required. other arguments are optional for bot api. (to ignore int arguments, pass 0)

func (*BotAPIInterface) SendVideoNote

func (bai *BotAPIInterface) SendVideoNote(chatIdInt int, chatIdString, videoNote string, videoNoteFile *os.File, caption, parseMode string, length, duration int, reply_to_message_id int, thumb string, thumbFile *os.File, disable_notification, allow_sending_without_reply, ProtectContent bool, captionEntities []objs.MessageEntity, reply_markup objs.ReplyMarkup) (*objs.SendMethodsResult, error)

SendVideoNote sends a video note (file,url,telegramId) to a channel (chatIdString) or a chat (chatIdInt) "chatId" and "videoNote" arguments are required. other arguments are optional for bot api. (to ignore int arguments, pass 0) Note that sending video note by URL is not supported by telegram.

func (*BotAPIInterface) SendVoice

func (bai *BotAPIInterface) SendVoice(chatIdInt int, chatIdString, voice string, voiceFile *os.File, caption, parseMode string, duration int, reply_to_message_id int, disable_notification, allow_sending_without_reply, ProtectContent bool, captionEntities []objs.MessageEntity, reply_markup objs.ReplyMarkup) (*objs.SendMethodsResult, error)

sSendVoice sends a voice (file,url,telegramId) to a channel (chatIdString) or a chat (chatIdInt) "chatId" and "voice" arguments are required. other arguments are optional for bot api. (to ignore int arguments, pass 0)

func (*BotAPIInterface) SetChatAdministratorCustomTitle

func (bai *BotAPIInterface) SetChatAdministratorCustomTitle(chatIdInt int, chatIdString string, userId int, customTitle string) (*objs.LogicalResult, error)

SetChatAdministratorCustomTitle sets a custom title for the administrator.

func (*BotAPIInterface) SetChatDescription

func (bai *BotAPIInterface) SetChatDescription(chatIdInt int, chatIdString, descriptions string) (*objs.LogicalResult, error)

SetChatDescription sets the chat description.

func (*BotAPIInterface) SetChatMenuButton added in v1.8.0

func (bai *BotAPIInterface) SetChatMenuButton(chatId int64, menuButton *objs.MenuButton) (*objs.LogicalResult, error)

SetChatMenuButton sets the menu button for the given chat

func (*BotAPIInterface) SetChatPermissions

func (bai *BotAPIInterface) SetChatPermissions(chatIdInt int, chatIdString string, permissions objs.ChatPermissions) (*objs.LogicalResult, error)

SetChatPermissions sets default permissions for all users in the chat.

func (*BotAPIInterface) SetChatPhoto

func (bai *BotAPIInterface) SetChatPhoto(chatIdInt int, chatIdString string, file *os.File) (*objs.LogicalResult, error)

SetChatPhoto sets the chat photo to given file.

func (*BotAPIInterface) SetChatStickerSet

func (bai *BotAPIInterface) SetChatStickerSet(chatIdInt int, chatIdString, stickerSetName string) (*objs.LogicalResult, error)

SetChatStickerSet sets the sticker set of the chat.

func (*BotAPIInterface) SetChatTitle

func (bai *BotAPIInterface) SetChatTitle(chatIdInt int, chatIdString, title string) (*objs.LogicalResult, error)

SetChatTitle sets the chat title.

func (*BotAPIInterface) SetGameScore

func (bai *BotAPIInterface) SetGameScore(userId, score int, force, disableEditMessage bool, chatId, messageId int, inlineMessageId string) (*objs.DefaultResult, error)

SetGameScore sets the game high score

func (*BotAPIInterface) SetMyCommands

func (bai *BotAPIInterface) SetMyCommands(commands []objs.BotCommand, scope objs.BotCommandScope, languageCode string) (*objs.LogicalResult, error)

SetMyCommands sets the commands of the bot

func (*BotAPIInterface) SetMyDefaultAdministratorRights added in v1.8.0

func (bai *BotAPIInterface) SetMyDefaultAdministratorRights(forChannels, isAnonymous, canManageChat, canPostmessages, canEditMessages, canDeleteMessages, canManageVideoChats, canRestrictMembers, canPromoteMembers, canChangeInfo, canInviteUsers, canPinMessages bool) (*objs.LogicalResult, error)

SetMyDefaultAdministratorRights sets the admin rights

func (*BotAPIInterface) SetPassportDataErrors

func (bai *BotAPIInterface) SetPassportDataErrors(userId int, errors []objs.PassportElementError) (*objs.LogicalResult, error)

SetPassportDataErrors sets passport data errors

func (*BotAPIInterface) SetStickerPositionInSet

func (bai *BotAPIInterface) SetStickerPositionInSet(sticker string, position int) (*objs.LogicalResult, error)

SetStickerPositionInSet sets the position of a sticker in an sticker set

func (*BotAPIInterface) SetStickerSetThumb

func (bai *BotAPIInterface) SetStickerSetThumb(name, thumb string, userId int, file *os.File) (*objs.LogicalResult, error)

SetStickerSetThumb sets the thumbnail for the given sticker

func (*BotAPIInterface) SetWebhook

func (bai *BotAPIInterface) SetWebhook(url, ip string, maxCnc int, allowedUpdates []string, dropPendingUpdates bool, keyFile *os.File) (*objs.LogicalResult, error)

SetWebhook sets a webhook for the bot.

func (*BotAPIInterface) StartUpdateRoutine

func (bai *BotAPIInterface) StartUpdateRoutine() error

StartUpdateRoutine starts the update routine to receive updates from api sever

func (*BotAPIInterface) StopMessageLiveLocation

func (bai *BotAPIInterface) StopMessageLiveLocation(chatIdInt int, chatIdString, inlineMessageId string, messageId int, replyMarkup *objs.InlineKeyboardMarkup) (*objs.DefaultResult, error)

StopMessageLiveLocation stops a live location sent to a channel (chatIdString) or a chat (chatIdInt) "chatId" argument is required. other arguments are optional for bot api. (to ignore int arguments, pass 0)

func (*BotAPIInterface) StopPoll

func (bai *BotAPIInterface) StopPoll(chatIdInt int, chatIdString string, messageId int, replyMakrup *objs.InlineKeyboardMarkup) (*objs.PollResult, error)

StopPoll stops the poll.

func (*BotAPIInterface) StopUpdateRoutine

func (bai *BotAPIInterface) StopUpdateRoutine()

StopUpdateRoutine stops the update routine

func (*BotAPIInterface) UnbanChatMember

func (bai *BotAPIInterface) UnbanChatMember(chatIdInt int, chatIdString string, userId int, onlyIfBanned bool) (*objs.LogicalResult, error)

UnbanChatMember unbans a chat member

func (*BotAPIInterface) UnpinAllChatMessages

func (bai *BotAPIInterface) UnpinAllChatMessages(chatIdInt int, chatIdString string) (*objs.LogicalResult, error)

UnpinAllChatMessages unpins all the pinned messages in the chat.

func (*BotAPIInterface) UnpinChatMessage

func (bai *BotAPIInterface) UnpinChatMessage(chatIdInt int, chatIdString string, messageId int) (*objs.LogicalResult, error)

UnpinChatMessage unpins the pinned message in the chat.

func (*BotAPIInterface) UploadStickerFile

func (bai *BotAPIInterface) UploadStickerFile(userId int, pngSticker string, file *os.File) (*objs.GetFileResult, error)

UploadStickerFile uploads the given file as an sticker on the telegram servers.

Jump to

Keyboard shortcuts

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