Documentation ¶
Overview ¶
Package method implements all available telegram bot api methods.
Index ¶
- type AnswerCallbackQuery
- type AnswerCallbackQueryOption
- type DeleteChatPhoto
- type DeleteChatStickerSet
- type DeleteMessage
- type EditMessageCaption
- type EditMessageCaptionOption
- type EditMessageMedia
- type EditMessageMediaOption
- type EditMessageReplyMarkup
- type EditMessageText
- type EditMessageTextOption
- type ExportChatInviteLink
- type ForwardMessage
- type ForwardMessageOption
- type GetChat
- type GetChatAdministrators
- type GetChatMember
- type GetChatMembersCount
- type GetFile
- type GetGameHighScores
- type GetMe
- type GetUpdates
- type GetUpdatesOption
- type GetUserProfilePhotos
- type GetUserProfilePhotosOption
- type GetWebhookInfo
- type KickChatMember
- type KickChatMemberOption
- type LeaveChat
- type MultipartMethod
- type PinChatMessage
- type PinChatMessageOption
- type PromoteChatMember
- type PromoteChatMemberOption
- type RestrictChatMember
- type RestrictChatMemberOption
- type SendAnimation
- type SendAnimationOption
- type SendAudio
- type SendAudioOption
- type SendChatAction
- type SendContact
- type SendContactOption
- type SendDocument
- type SendDocumentOption
- type SendGame
- type SendGameOption
- type SendLocation
- type SendLocationOption
- type SendMediaGroup
- type SendMediaGroupOption
- type SendMessage
- type SendMessageOption
- type SendPhoto
- type SendPhotoOption
- type SendVenue
- type SendVenueOption
- type SendVideo
- type SendVideoNote
- type SendVideoNoteOption
- type SendVideoOption
- type SendVoice
- type SendVoiceOption
- type SetChatDescription
- type SetChatPhoto
- type SetChatPhotoOption
- type SetChatStickerSet
- type SetChatTitle
- type SetGameScores
- type SetGameScoresOption
- type SetWebhook
- type SetWebhookOption
- type SimpleMethod
- type TelegramMethod
- type UnbanChatMember
- type UnpinChatMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnswerCallbackQuery ¶
type AnswerCallbackQuery struct { CallbackQueryID string `json:"callback_query_id"` Text string `json:"text,omitempty"` ShowAlert bool `json:"show_alert,omitempty"` CacheTime int `json:"cache_time,omitempty"` URL string `json:"url,omitempty"` SimpleMethod }
AnswerCallbackQuery contains information about answerCallbackQuery telegram api method.
func NewAnswerCallbackQuery ¶
func NewAnswerCallbackQuery(id string, options ...AnswerCallbackQueryOption) *AnswerCallbackQuery
NewAnswerCallbackQuery creates AnswerCallbackQuery.
func (*AnswerCallbackQuery) Method ¶
func (r *AnswerCallbackQuery) Method() string
Method returns telegram api method endpoint.
type AnswerCallbackQueryOption ¶
type AnswerCallbackQueryOption interface {
ApplyAnswerCallbackQueryOption(*AnswerCallbackQuery)
}
AnswerCallbackQueryOption interface for setting AnswerCallbackQuery optional parameters.
type DeleteChatPhoto ¶
type DeleteChatPhoto struct { ChatID int64 `json:"chat_id"` SimpleMethod }
DeleteChatPhoto contains information about the deleteChatPhoto telegram api method.
func NewDeleteChatPhoto ¶
func NewDeleteChatPhoto(chatID int64) *DeleteChatPhoto
NewDeleteChatPhoto creates DeleteChatPhoto struct
func (*DeleteChatPhoto) Method ¶
func (r *DeleteChatPhoto) Method() string
Method returns telegram api method endpoint.
type DeleteChatStickerSet ¶
type DeleteChatStickerSet struct { ChatID int64 `json:"chat_id"` SimpleMethod }
DeleteChatStickerSet contains information about deleteChatStickerSet telegram api method.
func NewDeleteChatStickerSet ¶
func NewDeleteChatStickerSet(chatID int64) *DeleteChatStickerSet
NewDeleteChatStickerSet creates DeleteChatStickerSet struct.
func (*DeleteChatStickerSet) Method ¶
func (r *DeleteChatStickerSet) Method() string
Method returns telegram api method endpoint.
type DeleteMessage ¶
type DeleteMessage struct { ChatID int64 `json:"chat_id,omitempty"` MessageID int `json:"message_id,omitempty"` SimpleMethod }
DeleteMessage contains information about deleteMessage telegram api method.
func NewDeleteMessage ¶
func NewDeleteMessage(chatID int64, messageID int) *DeleteMessage
NewDeleteMessage creates SendMessage
func (*DeleteMessage) Method ¶
func (r *DeleteMessage) Method() string
Method returns telegram api method endpoint.
type EditMessageCaption ¶
type EditMessageCaption struct { ChatID int64 `json:"chat_id,omitempty"` MessageID int `json:"message_id,omitempty"` InlineMessageID string `json:"inline_message_id,omitempty"` Caption string `json:"caption"` ParseMode string `json:"parse_mode,omitempty"` ReplyMarkup keyboard.Keyboard `json:"reply_markup,omitempty"` SimpleMethod }
EditMessageCaption contains information about editMessageCaption telegram api method.
func NewEditMessageCaption ¶
func NewEditMessageCaption(message *args.MessageID, text args.TextData, options ...EditMessageCaptionOption) *EditMessageCaption
NewEditMessageCaption creates EditMessageCaption
func (*EditMessageCaption) Method ¶
func (r *EditMessageCaption) Method() string
Method returns telegram api method endpoint.
type EditMessageCaptionOption ¶
type EditMessageCaptionOption interface {
ApplyEditMessageCaptionOption(*EditMessageCaption)
}
EditMessageCaptionOption its a functional options interface.
type EditMessageMedia ¶
type EditMessageMedia struct { File *os.File `json:"-" form:"file"` ThumbFile *os.File `json:"-" form:"thumb"` ChatID int64 `json:"chat_id,omitempty" form:"chat_id,omitempty"` MessageID int `json:"message_id,omitempty" form:"message_id,omitempty"` InlineMessageID string `json:"inline_message_id,omitempty" form:"inline_message_id,omitempty"` Media string `json:"media" form:"media"` ReplyMarkup keyboard.Keyboard `json:"reply_markup,omitempty"` }
EditMessageMedia contains information about editMessageMedia telegram api method.
func NewEditMessageMedia ¶
func NewEditMessageMedia(message *args.MessageID, media args.InputMediaConfig, options ...EditMessageMediaOption) *EditMessageMedia
NewEditMessageMedia creates EditMessageMedia.
func (*EditMessageMedia) IsMultipart ¶
func (m *EditMessageMedia) IsMultipart() bool
IsMultipart returns true if method contains file to upload and false otherwise.
func (*EditMessageMedia) Method ¶
func (m *EditMessageMedia) Method() string
Method returns telegram api method endpoint.
type EditMessageMediaOption ¶
type EditMessageMediaOption interface {
ApplyEditMessageMediaOption(*EditMessageMedia)
}
EditMessageMediaOption its a functional options interface.
type EditMessageReplyMarkup ¶
type EditMessageReplyMarkup struct { ChatID int64 `json:"chat_id,omitempty"` MessageID int `json:"message_id,omitempty"` InlineMessageID string `json:"inline_message_id,omitempty"` ReplyMarkup keyboard.Keyboard `json:"reply_markup"` SimpleMethod }
EditMessageReplyMarkup contains information about editMessageReplyMarkup telegram api method.
func NewEditMessageReplyMarkup ¶
func NewEditMessageReplyMarkup(message *args.MessageID, keyboard keyboard.Keyboard) *EditMessageReplyMarkup
NewEditMessageReplyMarkup creates EditMessageReplyMarkup.
func (*EditMessageReplyMarkup) Method ¶
func (r *EditMessageReplyMarkup) Method() string
Method returns telegram api method endpoint.
type EditMessageText ¶
type EditMessageText struct { ChatID int64 `json:"chat_id,omitempty"` MessageID int `json:"message_id,omitempty"` InlineMessageID string `json:"inline_message_id,omitempty"` Text string `json:"text"` ParseMode string `json:"parse_mode,omitempty" ` DisableWebPagePreview bool `json:"disable_web_page_preview,omitempty"` ReplyMarkup keyboard.Keyboard `json:"reply_markup,omitempty"` SimpleMethod }
EditMessageText contains information about editMessageText telegram api method.
func NewEditMessageText ¶
func NewEditMessageText(message *args.MessageID, text args.TextData, options ...EditMessageTextOption) *EditMessageText
NewEditMessageText creates EditMessageText.
func (*EditMessageText) Method ¶
func (r *EditMessageText) Method() string
Method returns telegram api method endpoint.
type EditMessageTextOption ¶
type EditMessageTextOption interface {
ApplyEditMessageTextOption(*EditMessageText)
}
EditMessageTextOption its a functional options interface.
type ExportChatInviteLink ¶
type ExportChatInviteLink struct { ChatID int64 `json:"chat_id"` SimpleMethod }
ExportChatInviteLink contains information about the exportChatInviteLink telegram api method.
func NewExportChatInviteLink ¶
func NewExportChatInviteLink(chatID int64) *ExportChatInviteLink
NewExportChatInviteLink creates ExportChatInviteLink struct.
func (*ExportChatInviteLink) Method ¶
func (r *ExportChatInviteLink) Method() string
Method returns telegram api method endpoint.
type ForwardMessage ¶
type ForwardMessage struct { ChatID int `json:"chat_id"` FromChatID int `json:"from_chat_id"` MessageID int `json:"message_id"` DisableNotification bool `json:"disable_notification,omitempty"` SimpleMethod }
ForwardMessage contains information about forwardMessage telegram api method.
func NewForwardMessage ¶
func NewForwardMessage(chatID, fromChatID, messageID int, options ...ForwardMessageOption) *ForwardMessage
NewForwardMessage creates ForwardMessage.
func (*ForwardMessage) Method ¶
func (r *ForwardMessage) Method() string
Method returns telegram api method endpoint.
type ForwardMessageOption ¶
type ForwardMessageOption interface {
ApplyForwardMessageOption(*ForwardMessage)
}
ForwardMessageOption its a functional options interface.
type GetChat ¶
type GetChat struct { ChatID int64 `json:"chat_id"` SimpleMethod }
GetChat contains information about getChat rtelegram api method.
type GetChatAdministrators ¶
type GetChatAdministrators struct { ChatID int64 `json:"chat_id"` SimpleMethod }
GetChatAdministrators contains information about getChatAdministrators telegram api method.
func NewGetChatAdministrators ¶
func NewGetChatAdministrators(chatID int64) *GetChatAdministrators
NewGetChatAdministrators creates GetChatAdministrators struct.
func (*GetChatAdministrators) Method ¶
func (r *GetChatAdministrators) Method() string
Method returns telegram api method endpoint.
type GetChatMember ¶
type GetChatMember struct { ChatID int64 `json:"chat_id"` UserID int `json:"user_id"` SimpleMethod }
GetChatMember contains information about getChatMember telegram api method.
func NewGetChatMember ¶
func NewGetChatMember(chatID int64, userID int) *GetChatMember
NewGetChatMember creates GetChatMember struct method.
func (*GetChatMember) Method ¶
func (r *GetChatMember) Method() string
Method returns telegram api method endpoint.
type GetChatMembersCount ¶
type GetChatMembersCount struct { ChatID int64 `json:"chat_id"` SimpleMethod }
GetChatMembersCount contains information about getChatMembersCount telegram api method.
func NewGetChatMembersCount ¶
func NewGetChatMembersCount(chatID int64) *GetChatMembersCount
NewGetChatMembersCount creates GetChatMembersCount struct.
func (*GetChatMembersCount) Method ¶
func (r *GetChatMembersCount) Method() string
Method returns telegram api method endpoint.
type GetFile ¶
type GetFile struct { FileID string `json:"file_id"` SimpleMethod }
GetFile contains information about getFile telegram api method.
type GetGameHighScores ¶
type GetGameHighScores struct { UserID int `json:"user_id"` ChatID int64 `json:"chat_id,omitempty"` MessageID int `json:"message_id,omitempty"` InlineMessageID string `json:"inline_message_id,omitempty"` SimpleMethod }
GetGameHighScores contains information about getGameHighScores telegram api method.
func NewGetGameHighScores ¶
func NewGetGameHighScores(userID int, message args.MessageID) *GetGameHighScores
NewGetGameHighScores creates GetGameHighScores.
func (*GetGameHighScores) Method ¶
func (m *GetGameHighScores) Method() string
Method returns telegram api method endpoint.
type GetMe ¶
type GetMe struct {
SimpleMethod
}
GetMe contains information about getMe telegram api method.
type GetUpdates ¶
type GetUpdates struct { Offset int `json:"offset,omitempty"` Limit int `json:"limit,omitempty"` Timeout int `json:"timeout,omitempty"` SimpleMethod }
GetUpdates contains information about getUpdates telegram api method.
func NewGetUpdates ¶
func NewGetUpdates(options ...GetUpdatesOption) *GetUpdates
NewGetUpdates creates GetUpdates.
func (*GetUpdates) Method ¶
func (r *GetUpdates) Method() string
Method returns telegram api method endpoint.
type GetUpdatesOption ¶
type GetUpdatesOption interface {
ApplyGetUpdatesOption(*GetUpdates)
}
GetUpdatesOption interface for optional parameters.
type GetUserProfilePhotos ¶
type GetUserProfilePhotos struct { UserID int `json:"user_id"` Offset int `json:"offset,omitempty"` Limit int `json:"limit,omitempty"` SimpleMethod }
GetUserProfilePhotos contains information about getUserProfilePhotos telegram api method.
func NewGetUserProfilePhotos ¶
func NewGetUserProfilePhotos(userID int, options ...GetUserProfilePhotosOption) *GetUserProfilePhotos
NewGetUserProfilePhotos creates GetUserProfilePhotos.
func (*GetUserProfilePhotos) Method ¶
func (r *GetUserProfilePhotos) Method() string
Method returns telegram api method endpoint.
type GetUserProfilePhotosOption ¶
type GetUserProfilePhotosOption interface {
ApplyGetUserProfilePhotosOption(*GetUserProfilePhotos)
}
GetUserProfilePhotosOption interface for optional parameters.
type GetWebhookInfo ¶
type GetWebhookInfo struct {
SimpleMethod
}
GetWebhookInfo contains information about getWebhookInfo telegram api method.
func NewGetWebhookInfo ¶
func NewGetWebhookInfo() *GetWebhookInfo
NewGetWebhookInfo creates GetWebhookInfo.
func (*GetWebhookInfo) Method ¶
func (r *GetWebhookInfo) Method() string
Method returns telegram api method endpoint.
type KickChatMember ¶
type KickChatMember struct { ChatID int64 `json:"chat_id"` UserID int `json:"user_id"` UntilDate int `json:"until_date,omitempty"` SimpleMethod }
KickChatMember contains information about kickChatMember telegram api method.
func NewKickChatMember ¶
func NewKickChatMember(userID int, chatID int64, options ...KickChatMemberOption) *KickChatMember
NewKickChatMember creates KickChatMember.
func (*KickChatMember) Method ¶
func (r *KickChatMember) Method() string
Method returns telegram api method endpoint.
type KickChatMemberOption ¶
type KickChatMemberOption interface {
ApplyKickChatMemberOption(*KickChatMember)
}
KickChatMemberOption interface for optional parameters.
type LeaveChat ¶
type LeaveChat struct { ChatID int64 `json:"chat_id"` SimpleMethod }
LeaveChat contains information about leaveChat telegram api method.
func NewLeaveChat ¶
NewLeaveChat creates LeaveChat struct.
type MultipartMethod ¶
type MultipartMethod struct{}
MultipartMethod stub struct for multipart/form-data methods.
func (*MultipartMethod) IsMultipart ¶
func (mm *MultipartMethod) IsMultipart() bool
IsMultipart returns true if method is multipart and false otherwise.
type PinChatMessage ¶
type PinChatMessage struct { ChatID int64 `json:"chat_id"` MessageID int `json:"message_id"` DisableNotification bool `json:"disable_notification,omitempty"` SimpleMethod }
PinChatMessage contains information about pinChatMessage telegram api method.
func NewPinChatMessage ¶
func NewPinChatMessage(chatID int64, messageID int, options ...PinChatMessageOption) *PinChatMessage
NewPinChatMessage creates PinChatMessage struct.
func (*PinChatMessage) Method ¶
func (r *PinChatMessage) Method() string
Method returns telegram api method endpoint.
type PinChatMessageOption ¶
type PinChatMessageOption interface {
ApplyPinChatMessageOption(*PinChatMessage)
}
PinChatMessageOption interface for optional parameters.
type PromoteChatMember ¶
type PromoteChatMember struct { ChatID int64 `json:"chat_id"` UserID int `json:"user_id"` CanChangeInfo bool `json:"can_change_info,omitempty"` CanPostMessages bool `json:"can_post_messages,omitempty"` CanEditMessages bool `json:"can_edit_messages,omitempty"` CanDeleteMessages bool `json:"can_delete_messages,omitempty"` CanInviteUsers bool `json:"can_invite_users,omitempty"` CanRestrictMembers bool `json:"can_restrict_members,omitempty"` CanPinMessages bool `json:"can_pin_messages,omitempty"` CanPromoteMembers bool `json:"can_promote_members,omitempty"` SimpleMethod }
PromoteChatMember contains information about promoteChatMember telegram api method.
func NewPromoteChatMember ¶
func NewPromoteChatMember(userID int, chatID int64, options ...PromoteChatMemberOption) *PromoteChatMember
NewPromoteChatMember creates PromoteChatMember.
func (*PromoteChatMember) Method ¶
func (r *PromoteChatMember) Method() string
Method returns telegram api method endpoint.
type PromoteChatMemberOption ¶
type PromoteChatMemberOption interface {
ApplyPromoteChatMemberOption(*PromoteChatMember)
}
PromoteChatMemberOption interface for optional parameters.
type RestrictChatMember ¶
type RestrictChatMember struct { ChatID int64 `json:"chat_id"` UserID int `json:"user_id"` UntilDate int `json:"until_date,omitempty"` CanSendMessages bool `json:"can_send_messages,omitempty"` CanSendMediaMessages bool `json:"can_send_media_messages,omitempty"` CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"` CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty"` SimpleMethod }
RestrictChatMember contains information about restrictChatMember telegram api method.
func NewRestrictChatMember ¶
func NewRestrictChatMember(userID int, chatID int64, options ...RestrictChatMemberOption) *RestrictChatMember
NewRestrictChatMember creates RestrictChatMember.
func (*RestrictChatMember) Method ¶
func (r *RestrictChatMember) Method() string
Method returns telegram api method endpoint.
type RestrictChatMemberOption ¶
type RestrictChatMemberOption interface {
ApplyRestrictChatMemberOption(*RestrictChatMember)
}
RestrictChatMemberOption interface for optional parameters.
type SendAnimation ¶
type SendAnimation struct { ChatID int64 `json:"chat_id" form:"chat_id"` File *os.File `json:"-" form:"file"` ThumbFile *os.File `json:"-" form:"thumb"` Animation string `json:"animation" form:"animation"` Caption string `json:"caption,omitempty" form:"caption,omitempty"` Thumb string `json:"thumb,omitempty" form:"thumb,omitempty"` Width int `json:"width,omitempty" form:"width,omitempty"` Height int `json:"height,omitempty" form:"height,omitempty"` Duration int `form:"duration,omitempty" form:"duration,omitempty"` ParseMode string `json:"parse_mode,omitempty" form:"parse_mode,omitempty"` DisableNotification bool `json:"disable_notification,omitempty" form:"disable_notification,omitempty"` ReplyToMessageID int `json:"reply_to_message_id,omitempty" form:"reply_to_message_id,omitempty"` ReplyMarkup keyboard.Keyboard `json:"reply_markup,omitempty" form:"reply_markup,omitempty"` }
SendAnimation contains information about sendAnimation telegram api method.
func NewSendAnimation ¶
func NewSendAnimation(chatID int64, animation *args.AnimationConfig, options ...SendAnimationOption) *SendAnimation
NewSendAnimation creates SendAnimation.
func (*SendAnimation) IsMultipart ¶
func (m *SendAnimation) IsMultipart() bool
IsMultipart returns true if method contains file to upload and false otherwise.
func (*SendAnimation) Method ¶
func (m *SendAnimation) Method() string
Method returns telegram api method endpoint.
type SendAnimationOption ¶
type SendAnimationOption interface {
ApplySendAnimationOption(*SendAnimation)
}
SendAnimationOption its a functional options interface.
type SendAudio ¶
type SendAudio struct { ChatID int64 `json:"chat_id" form:"chat_id"` File *os.File `json:"-" form:"file"` ThumbFile *os.File `json:"-" form:"thumb"` Audio string `json:"audio"` Thumb string `json:"thumb,omitempty" form:"thumb,omitempty"` Caption string `json:"caption,omitempty" form:"caption,omitempty"` Duration int `json:"duration,omitempty" form:"caption,omitempty"` Performer string `json:"performer,omitempty" form:"performer,omitempty"` Title string `json:"title,omitempty" form:"title,omitempty"` ParseMode string `json:"parse_mode,omitempty" form:"parse_mode,omitempty"` DisableNotification bool `json:"disable_notification,omitempty" form:"disable_notification,omitempty"` ReplyToMessageID int `json:"reply_to_message_id,omitempty" form:"reply_to_message_id,omitempty"` ReplyMarkup keyboard.Keyboard `json:"reply_markup,omitempty" form:"reply_markup,omitempty"` }
SendAudio contains information about sendMessage telegram api method.
func NewSendAudio ¶
func NewSendAudio(chatID int64, audio *args.AudioConfig, options ...SendAudioOption) *SendAudio
NewSendAudio creates SendAudio.
func (*SendAudio) IsMultipart ¶
IsMultipart returns true if method contains a files to upload and false otherwise.
type SendAudioOption ¶
type SendAudioOption interface {
ApplySendAudioOption(*SendAudio)
}
SendAudioOption its a functional options interface.
type SendChatAction ¶
type SendChatAction struct { ChatID int64 `json:"chat_id"` Action types.ChatAction `json:"action"` SimpleMethod }
SendChatAction contains information about the sendChatAction telegram api method.
func NewSendChatAction ¶
func NewSendChatAction(chatID int64, action types.ChatAction) *SendChatAction
NewSendChatAction creates SendChatAction struct.
func (*SendChatAction) Method ¶
func (r *SendChatAction) Method() string
Method returns telegram api method endpoint.
type SendContact ¶
type SendContact struct { ChatID int64 `json:"chat_id"` PhoneNumber string `json:"phone_number"` FirstName string `json:"first_name"` LastName string `json:"last_name,omitempty"` VCard string `json:"vcard,omitempty"` DisableNotification bool `json:"disable_notification,omitempty"` ReplyToMessageID int `json:"reply_to_message_id,omitempty"` ReplyMarkup keyboard.Keyboard `json:"reply_markup,omitempty"` SimpleMethod }
SendContact contains information about sendContact telegram api method.
func NewSendContact ¶
func NewSendContact(chatID int64, contact types.Contact, options ...SendContactOption) *SendContact
NewSendContact creates SendContact.
func (*SendContact) Method ¶
func (r *SendContact) Method() string
Method returns telegram api method endpoint.
type SendContactOption ¶
type SendContactOption interface {
ApplySendContactOption(*SendContact)
}
SendContactOption interface for optional parameters.
type SendDocument ¶
type SendDocument struct { ChatID int64 `json:"chat_id" form:"chat_id"` File *os.File `json:"-" form:"file"` ThumbFile *os.File `json:"-" form:"thumb"` Document string `json:"document" form:"document"` Thumb string `json:"thumb,omitempty" form:"thumb,omitempty"` Caption string `json:"caption,omitempty" form:"caption,omitempty"` ParseMode string `json:"parse_mode,omitempty" form:"parse_mode,omitempty"` DisableNotification bool `json:"disable_notification,omitempty" form:"disable_notification,omitempty"` ReplyToMessageID int `json:"reply_to_message_id,omitempty" form:"reply_to_message_id,omitempty"` ReplyMarkup keyboard.Keyboard `json:"reply_markup,omitempty" form:"reply_markup,omitempty"` }
SendDocument contains information about sendDocument telegram api method.
func NewSendDocument ¶
func NewSendDocument(chatID int64, document *args.DocumentConfig, options ...SendDocumentOption) *SendDocument
NewSendDocument creates SendDocument.
func (*SendDocument) IsMultipart ¶
func (m *SendDocument) IsMultipart() bool
IsMultipart returns true if method contains file to upload and false otherwise.
func (*SendDocument) Method ¶
func (m *SendDocument) Method() string
Method returns telegram api method endpoint.
type SendDocumentOption ¶
type SendDocumentOption interface {
ApplySendDocumentOption(*SendDocument)
}
SendDocumentOption its a functional options interface.
type SendGame ¶
type SendGame struct { ChatID int `json:"chat_id"` GameShortName string `json:"game_short_name"` DisableNotification bool `json:"disable_notification,omitempty"` ReplyToMessageID int `json:"reply_to_message_id,omitempty"` ReplyMarkup keyboard.Keyboard `json:"reply_markup,omitempty"` SimpleMethod }
SendGame contains information about sendGame telegram api method.
func NewSendGame ¶
func NewSendGame(chatID int, name string, options ...SendGameOption) *SendGame
NewSendGame creates SendGame.
type SendGameOption ¶
type SendGameOption interface {
ApplySendGameOption(*SendGame)
}
SendGameOption interface for optional parameters.
type SendLocation ¶
type SendLocation struct { ChatID int64 `json:"chat_id"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` LivePeriod int `json:"live_period,omitempty"` DisableNotification bool `json:"disable_notification,omitempty"` ReplyToMessageID int `json:"reply_to_message_id,omitempty"` ReplyMarkup keyboard.Keyboard `json:"reply_markup,omitempty"` SimpleMethod }
SendLocation contains information about sendLocation telegram api method.
func NewSendLocation ¶
func NewSendLocation(chatID int64, location types.Location, options ...SendLocationOption) *SendLocation
NewSendLocation creates SendLocation.
func (*SendLocation) Method ¶
func (r *SendLocation) Method() string
Method returns telegram api method endpoint.
type SendLocationOption ¶
type SendLocationOption interface {
ApplySendLocationOption(*SendLocation)
}
SendLocationOption interface for optional parameters.
type SendMediaGroup ¶
type SendMediaGroup struct { Files []*os.File `json:"-" form:"file"` ThumbFiles []*os.File `json:"-" form:"thumb"` ChatID int64 `json:"chat_id" form:"chat_id"` Media []string `json:"media" form:"media"` DisableNotification bool `json:"disable_notification,omitempty" form:"disable_notification,omitempty"` ReplyToMessageID int `json:"reply_to_message_id,omitempty" form:"reply_to_message_id,omitempty"` }
SendMediaGroup contains information about sendMediaGroup telegram api method.
func NewSendMediaGroup ¶
func NewSendMediaGroup(chatID int64, medias []args.MediaGroupConfig, options ...SendMediaGroupOption) *SendMediaGroup
NewSendMediaGroup creates SendMediaGroup.
func (*SendMediaGroup) IsMultipart ¶
func (m *SendMediaGroup) IsMultipart() bool
IsMultipart returns true if method contains file to upload and false otherwise.
func (*SendMediaGroup) Method ¶
func (m *SendMediaGroup) Method() string
Method returns telegram api method endpoint.
type SendMediaGroupOption ¶
type SendMediaGroupOption interface {
ApplySendMediaGroupOption(*SendMediaGroup)
}
SendMediaGroupOption its a functional options interface.
type SendMessage ¶
type SendMessage struct { ChatID int64 `json:"chat_id"` Text string `json:"text"` ParseMode string `json:"parse_mode,omitempty" ` DisableWebPagePreview bool `json:"disable_web_page_preview,omitempty"` DisableNotification bool `json:"disable_notification,omitempty"` ReplyToMessageID int `json:"reply_to_message_id,omitempty"` ReplyMarkup keyboard.Keyboard `json:"reply_markup,omitempty"` SimpleMethod }
SendMessage contains information about sendMessage telegram api method.
func NewSendMessage ¶
func NewSendMessage(chatID int64, text args.TextData, options ...SendMessageOption) *SendMessage
NewSendMessage creates SendMessage.
func (*SendMessage) Method ¶
func (r *SendMessage) Method() string
Method returns telegram api method endpoint.
type SendMessageOption ¶
type SendMessageOption interface {
ApplySendMessageOption(*SendMessage)
}
SendMessageOption its a functional options interface.
type SendPhoto ¶
type SendPhoto struct { ChatID int64 `json:"chat_id" form:"chat_id"` File *os.File `json:"-"` Photo string `json:"photo" form:"photo"` Caption string `json:"caption,omitempty" form:"caption,omitempty"` ParseMode string `json:"parse_mode,omitempty" form:"parse_mode,omitempty"` DisableNotification bool `json:"disable_notification,omitempty" form:"disable_notification,omitempty"` ReplyToMessageID int `json:"reply_to_message_id,omitempty" form:"reply_to_message_id,omitempty"` ReplyMarkup keyboard.Keyboard `json:"reply_markup,omitempty" form:"reply_markup,omitempty"` }
SendPhoto contains information about sendPhoto telegram api method.
func NewSendPhoto ¶
func NewSendPhoto(chatID int64, photo *args.PhotoConfig, options ...SendPhotoOption) *SendPhoto
NewSendPhoto creates SendPhoto.
func (*SendPhoto) IsMultipart ¶
IsMultipart returns true if method contains file to upload and false otherwise.
type SendPhotoOption ¶
type SendPhotoOption interface {
ApplySendPhotoOption(*SendPhoto)
}
SendPhotoOption its a functional options interface.
type SendVenue ¶
type SendVenue struct { ChatID int64 `json:"chat_id"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Title string `json:"title"` Address string `json:"address"` FoursquareID string `json:"foursquare_id,omitempty"` FoursquareType string `json:"foursquare_type,omitempty"` DisableNotification bool `json:"disable_notification,omitempty"` ReplyToMessageID int `json:"reply_to_message_id,omitempty"` ReplyMarkup keyboard.Keyboard `json:"reply_markup,omitempty"` SimpleMethod }
SendVenue contains information about sendVenue telegram api method.
func NewSendVenue ¶
func NewSendVenue(chatID int64, venue types.Venue, options ...SendVenueOption) *SendVenue
NewSendVenue creates SendVenue.
type SendVenueOption ¶
type SendVenueOption interface {
ApplySendVenueOption(*SendVenue)
}
SendVenueOption interface for optional parameters.
type SendVideo ¶
type SendVideo struct { ChatID int64 `json:"chat_id" form:"chat_id"` File *os.File `json:"-" form:"file"` ThumbFile *os.File `json:"-" form:"thumb"` Video string `json:"video" form:"video"` Thumb string `json:"thumb,omitempty" form:"thumb,omitempty"` Caption string `json:"caption,omitempty" form:"caption,omitempty"` Width int `json:"width,omitempty" form:"width,omitempty"` Height int `json:"height,omitempty" form:"height,omitempty"` Duration int `json:"duration,omitempty" form:"duration,omitempty"` SupportsStreaming bool `json:"supports_streaming,omitempty" form:"supports_streaming,omitempty"` ParseMode string `json:"parse_mode,omitempty" form:"parse_mode,omitempty"` DisableNotification bool `json:"disable_notification,omitempty" form:"disable_notification,omitempty"` ReplyToMessageID int `json:"reply_to_message_id,omitempty" form:"reply_to_message_id,omitempty"` ReplyMarkup keyboard.Keyboard `json:"reply_markup,omitempty" form:"reply_markup,omitempty"` }
SendVideo contains information about sendVideo telegram api method.
func NewSendVideo ¶
func NewSendVideo(chatID int64, video *args.VideoConfig, options ...SendVideoOption) *SendVideo
NewSendVideo creates SendVideo.
func (*SendVideo) IsMultipart ¶
IsMultipart returns true if method contains file to upload and false otherwise.
type SendVideoNote ¶
type SendVideoNote struct { ChatID int64 `json:"chat_id" form:"chat_id"` File *os.File `json:"-" form:"file"` ThumbFile *os.File `json:"-" form:"thumb"` VideoNote string `json:"video_note" form:"video_note"` Thumb string `json:"thumb,omitempty" form:"thumb,omitempty"` Length int `json:"length,omitempty" form:"length,omitempty"` Duration int `json:"duration,omitempty" form:"duration,omitempty"` DisableNotification bool `json:"disable_notification,omitempty" form:"disable_notification,omitempty"` ReplyToMessageID int `json:"reply_to_message_id,omitempty" form:"reply_to_message_id,omitempty"` ReplyMarkup keyboard.Keyboard `json:"reply_markup,omitempty" form:"reply_markup,omitempty"` }
SendVideoNote contains information about sendVideoNote telegram api method.
func NewSendVideoNote ¶
func NewSendVideoNote(chatID int64, videoNote *args.VideoNoteConfig, options ...SendVideoNoteOption) *SendVideoNote
NewSendVideoNote creates SendVideoNote.
func (*SendVideoNote) IsMultipart ¶
func (m *SendVideoNote) IsMultipart() bool
IsMultipart returns true if method contains file to upload and false otherwise.
func (*SendVideoNote) Method ¶
func (m *SendVideoNote) Method() string
Method returns telegram api method endpoint.
type SendVideoNoteOption ¶
type SendVideoNoteOption interface {
ApplySendVideoNoteOption(*SendVideoNote)
}
SendVideoNoteOption its a functional options interface.
type SendVideoOption ¶
type SendVideoOption interface {
ApplySendVideoOption(*SendVideo)
}
SendVideoOption its a functional options interface.
type SendVoice ¶
type SendVoice struct { ChatID int64 `json:"chat_id" form:"chat_id"` File *os.File `json:"-" form:"file"` Voice string `json:"audio" form:"audio"` Caption string `json:"caption,omitempty" form:"caption,omitempty"` Duration int `json:"duration,omitempty" form:"duration,omitempty"` ParseMode string `json:"parse_mode,omitempty" form:"parse_mode,omitempty"` DisableNotification bool `json:"disable_notification,omitempty" form:"disable_notification,omitempty"` ReplyToMessageID int `json:"reply_to_message_id,omitempty" form:"reply_to_message_id,omitempty"` ReplyMarkup keyboard.Keyboard `json:"reply_markup,omitempty" form:"reply_markup,omitempty"` }
SendVoice contains information about sendVoice telegram api method.
func NewSendVoice ¶
func NewSendVoice(chatID int64, voice *args.VoiceConfig, options ...SendVoiceOption) *SendVoice
NewSendVoice creates SendVoice.
func (*SendVoice) IsMultipart ¶
IsMultipart returns true if method contains file to upload and false otherwise.
type SendVoiceOption ¶
type SendVoiceOption interface {
ApplySendVoiceOption(*SendVoice)
}
SendVoiceOption its a functional options interface.
type SetChatDescription ¶
type SetChatDescription struct { ChatID int64 `json:"chat_id"` Description string `json:"description"` SimpleMethod }
SetChatDescription contains information about SetChatDescription telegram api method.
func NewSetChatDescription ¶
func NewSetChatDescription(chatID int64, desc string) *SetChatDescription
NewSetChatDescription creates SetChatDescription struct.
func (*SetChatDescription) Method ¶
func (r *SetChatDescription) Method() string
Method returns telegram api method endpoint.
type SetChatPhoto ¶
type SetChatPhoto struct { File *os.File `form:"photo"` ChatID int64 `json:"chat_id" form:"chat_id"` Photo string `json:"photo" form:"photo"` MultipartMethod }
SetChatPhoto contains information about the SetChatPhoto telegram api method.
func NewSetChatPhoto ¶
func NewSetChatPhoto(chatID int64, file *os.File) *SetChatPhoto
NewSetChatPhoto creates SetChatPhoto struct.
func (*SetChatPhoto) Method ¶
func (r *SetChatPhoto) Method() string
Method returns telegram api method endpoint.
type SetChatPhotoOption ¶
type SetChatPhotoOption interface {
ApplySetChatPhotoOption(*SetChatPhoto)
}
SetChatPhotoOption interface for optional parameters.
type SetChatStickerSet ¶
type SetChatStickerSet struct { ChatID int64 `json:"chat_id"` StickerSetName string `json:"sticker_set_name"` SimpleMethod }
SetChatStickerSet contains information about setChatStickerSet telegram api method.
func NewSetChatStickerSet ¶
func NewSetChatStickerSet(chatID int64, stickerSetName string) *SetChatStickerSet
NewSetChatStickerSet creates SetChatStickerSet struct.
func (*SetChatStickerSet) Method ¶
func (r *SetChatStickerSet) Method() string
Method returns telegram api method endpoint.
type SetChatTitle ¶
type SetChatTitle struct { ChatID int64 `json:"chat_id"` Title string `json:"title"` SimpleMethod }
SetChatTitle contains information about SetChatTitle telegram api method.
func NewSetChatTitle ¶
func NewSetChatTitle(chatID int64, title string) *SetChatTitle
NewSetChatTitle creates SendMessage struct.
func (*SetChatTitle) Method ¶
func (r *SetChatTitle) Method() string
Method returns telegram api method endpoint.
type SetGameScores ¶
type SetGameScores struct { UserID int `json:"user_id"` Score int `json:"score"` ChatID int64 `json:"chat_id,omitempty"` MessageID int `json:"message_id,omitempty"` InlineMessageID string `json:"inline_message_id,omitempty"` Force bool `json:"force,omitempty"` DisableEditMessage bool `json:"disable_edit_message,omitempty"` SimpleMethod }
SetGameScores contains information about SetGameScore telegram api method.
func NewSetGameScores ¶
func NewSetGameScores(userID, score int, message args.MessageID, options ...SetGameScoresOption) *SetGameScores
NewSetGameScores creates SetGameScores.
func (*SetGameScores) Method ¶
func (m *SetGameScores) Method() string
Method returns telegram api method endpoint.
type SetGameScoresOption ¶
type SetGameScoresOption interface {
ApplySetGameScoresOption(*SetGameScores)
}
SetGameScoresOption interface for optional parameters.
type SetWebhook ¶
type SetWebhook struct { File *os.File `json:"-"` URL string `json:"url" form:"url"` Certificate string `json:"certificate,omitempty" form:"certificate,omitempty"` MaxConnections int `json:"max_connections,omitempty" form:"max_connections,omitempty"` AllowedUpdates []types.UpdateType `json:"allowed_updates,omitempty" form:"allowed_updates,omitempty"` }
SetWebhook contains information about SetWebhook telegram api method.
func NewSetWebhook ¶
func NewSetWebhook(url string, file *args.File, options ...SetWebhookOption) *SetWebhook
NewSetWebhook creates SetWebhook.
func (*SetWebhook) IsMultipart ¶
func (sw *SetWebhook) IsMultipart() bool
IsMultipart returns true if method is multipart and false otherwise.
func (*SetWebhook) Method ¶
func (sw *SetWebhook) Method() string
Method returns telegram api method endpoint.
type SetWebhookOption ¶
type SetWebhookOption interface {
ApplySetWebhookOption(*SetWebhook)
}
SetWebhookOption interface for optional parameters.
type SimpleMethod ¶
type SimpleMethod struct{}
SimpleMethod stub struct for simple methods.
func (*SimpleMethod) IsMultipart ¶
func (sm *SimpleMethod) IsMultipart() bool
IsMultipart returns true if method is multipart and false otherwise.
type TelegramMethod ¶
TelegramMethod generic interface for telegram api methods.
type UnbanChatMember ¶
type UnbanChatMember struct { ChatID int64 `json:"chat_id"` UserID int `json:"user_id"` SimpleMethod }
UnbanChatMember contains information about unbanChatMember telegram api method.
func NewUnbanChatMember ¶
func NewUnbanChatMember(userID int, chatID int64) *UnbanChatMember
NewUnbanChatMember creates UnbanChatMember.
func (*UnbanChatMember) Method ¶
func (r *UnbanChatMember) Method() string
Method returns telegram api method endpoint.
type UnpinChatMessage ¶
type UnpinChatMessage struct { ChatID int64 `json:"chat_id"` SimpleMethod }
UnpinChatMessage contains information about unpinChatMessage telegram api method.
func NewUnpinChatMessage ¶
func NewUnpinChatMessage(chatID int64) *UnpinChatMessage
NewUnpinChatMessage creates UnpinChatMessage struct.
func (*UnpinChatMessage) Method ¶
func (r *UnpinChatMessage) Method() string
Method returns telegram api method endpoint.