arguments

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

This package contains all arguments structs for Telegram Bot API method.

All arguments structs are named with "Args" suffix.

They can be simply constructed by using new() operator, then developer can call related method to set argument value.

Example:

args := new(arguments.SendMessageArgs)
args.ChatId(1)
args.Text("Hello, world")

Note:

* All arguments structs have Archive() method which will be called by core code, developer SHOULD NOT call it.

* All arguments structs are NOT goroutine-safety, you SHOULD avoid manipulating it in mulit-goroutine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddStickerToSetArgs

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

func (*AddStickerToSetArgs) Archive

func (a *AddStickerToSetArgs) Archive() (contentType string, data io.Reader)

func (*AddStickerToSetArgs) Emojis

func (a *AddStickerToSetArgs) Emojis(emojis string)

func (*AddStickerToSetArgs) MaskPosition

func (a *AddStickerToSetArgs) MaskPosition(point string, x, y, scale float64)

func (*AddStickerToSetArgs) Name

func (a *AddStickerToSetArgs) Name(name string)

func (*AddStickerToSetArgs) StickerFile

func (a *AddStickerToSetArgs) StickerFile(file InputFile)

func (*AddStickerToSetArgs) StickerId

func (a *AddStickerToSetArgs) StickerId(fileId string)

func (*AddStickerToSetArgs) UserId

func (a *AddStickerToSetArgs) UserId(userId int)

type AllowedUpdatesBuilder

type AllowedUpdatesBuilder interface {
	ArgumentBuilder

	// Allow to receive incoming message.
	Message() AllowedUpdatesBuilder

	// Allow to receive new version of a meesage which was edited.
	EditedMessage() AllowedUpdatesBuilder

	// Allow to receive incoming channel post.
	ChannelPost() AllowedUpdatesBuilder

	// Allow to receive new version of a channel post which was edited.
	EditedChannelPost() AllowedUpdatesBuilder

	// Allow to receive incoming inline query.
	InlineQuery() AllowedUpdatesBuilder

	// Allow to receive the result which user chose from an inline query.
	ChosenInlineResult() AllowedUpdatesBuilder

	// Allow to receive incoming callback query.
	CallbackQuery() AllowedUpdatesBuilder

	// Allow to receive incoming shipping query.
	ShippingQuery() AllowedUpdatesBuilder

	// Allow to receive incoming pre-checkout query.
	PreCheckoutQuery() AllowedUpdatesBuilder

	// Allow to receive poll state when it was voted or stopped.
	Poll() AllowedUpdatesBuilder
}

The builder to define which updates can received.

type AnswerCallbackQueryArgs

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

func (*AnswerCallbackQueryArgs) Archive

func (a *AnswerCallbackQueryArgs) Archive() (contentType string, data io.Reader)

func (*AnswerCallbackQueryArgs) CacheTime

func (a *AnswerCallbackQueryArgs) CacheTime(seconds int)

func (*AnswerCallbackQueryArgs) QueryId

func (a *AnswerCallbackQueryArgs) QueryId(queryId string)

func (*AnswerCallbackQueryArgs) ShowAlert

func (a *AnswerCallbackQueryArgs) ShowAlert()

func (*AnswerCallbackQueryArgs) Text

func (a *AnswerCallbackQueryArgs) Text(text string)

func (*AnswerCallbackQueryArgs) Url

func (a *AnswerCallbackQueryArgs) Url(url string)

type AnswerPreCheckoutQueryArgs

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

func (*AnswerPreCheckoutQueryArgs) Archive

func (a *AnswerPreCheckoutQueryArgs) Archive() (contentType string, data io.Reader)

func (*AnswerPreCheckoutQueryArgs) ErrorMessage

func (a *AnswerPreCheckoutQueryArgs) ErrorMessage(message string)

func (*AnswerPreCheckoutQueryArgs) Ok

func (*AnswerPreCheckoutQueryArgs) QueryId

func (a *AnswerPreCheckoutQueryArgs) QueryId(queryId string)

type AnswerShippingQueryArgs

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

func (*AnswerShippingQueryArgs) AddShippingOption

func (a *AnswerShippingQueryArgs) AddShippingOption() ShippingOptionBuilder

func (*AnswerShippingQueryArgs) Archive

func (a *AnswerShippingQueryArgs) Archive() (contentType string, data io.Reader)

func (*AnswerShippingQueryArgs) ErrorMessage

func (a *AnswerShippingQueryArgs) ErrorMessage(message string)

func (*AnswerShippingQueryArgs) Ok

func (a *AnswerShippingQueryArgs) Ok()

func (*AnswerShippingQueryArgs) QueryId

func (a *AnswerShippingQueryArgs) QueryId(queryId string)

type ArgumentBuilder

type ArgumentBuilder interface {

	// Apply the settings.
	// Should be called at the end of setup.
	Finish()
}

For complex argument such as JSON value, telegroid provides builder utilities for them.

All the builders implement this interface.

type ChatArgs

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

func (*ChatArgs) Archive

func (a *ChatArgs) Archive() (contentType string, data io.Reader)

func (*ChatArgs) Channel

func (a *ChatArgs) Channel(channelName string)

func (*ChatArgs) ChatId

func (a *ChatArgs) ChatId(chatId int)

type ChatMemberArgs

type ChatMemberArgs struct {
	ChatArgs
}

func (*ChatMemberArgs) Archive

func (a *ChatMemberArgs) Archive() (contentType string, data io.Reader)

func (*ChatMemberArgs) UserId

func (a *ChatMemberArgs) UserId(userId int)

type ChatMessageArgs

type ChatMessageArgs struct {
	ChatArgs
}

func (*ChatMessageArgs) Archive

func (a *ChatMessageArgs) Archive() (contentType string, data io.Reader)

func (*ChatMessageArgs) MessageId

func (a *ChatMessageArgs) MessageId(messageId int)

type CreateNewStickerSetArgs

type CreateNewStickerSetArgs struct {
	AddStickerToSetArgs
}

func (*CreateNewStickerSetArgs) Archive

func (a *CreateNewStickerSetArgs) Archive() (contentType string, data io.Reader)

func (*CreateNewStickerSetArgs) ContainsMasks

func (a *CreateNewStickerSetArgs) ContainsMasks()

func (*CreateNewStickerSetArgs) Title

func (a *CreateNewStickerSetArgs) Title(title string)

type DeleteStickerFromSetArgs

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

func (*DeleteStickerFromSetArgs) Archive

func (a *DeleteStickerFromSetArgs) Archive() (contentType string, data io.Reader)

func (*DeleteStickerFromSetArgs) StickerId

func (a *DeleteStickerFromSetArgs) StickerId(fileId string)

type EditMessageCaptionArgs

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

func (*EditMessageCaptionArgs) Caption

func (a *EditMessageCaptionArgs) Caption(caption string) ParseModeSelector

func (*EditMessageCaptionArgs) InlineKeyboard

func (a *EditMessageCaptionArgs) InlineKeyboard() InlineKeyboardBuilder

func (*EditMessageCaptionArgs) InlineMessageId

func (a *EditMessageCaptionArgs) InlineMessageId(inlineMessageId int)

type EditMessageLiveLocationArgs

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

func (*EditMessageLiveLocationArgs) InlineKeyboard

func (a *EditMessageLiveLocationArgs) InlineKeyboard() InlineKeyboardBuilder

func (*EditMessageLiveLocationArgs) InlineMessageId

func (a *EditMessageLiveLocationArgs) InlineMessageId(inlineMessageId int)

func (*EditMessageLiveLocationArgs) Location

func (a *EditMessageLiveLocationArgs) Location(latitude, longitude float64)

type EditMessageMediaArgs

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

func (*EditMessageMediaArgs) InlineKeyboard

func (a *EditMessageMediaArgs) InlineKeyboard() InlineKeyboardBuilder

func (*EditMessageMediaArgs) InlineMessageId

func (a *EditMessageMediaArgs) InlineMessageId(inlineMessageId int)

func (*EditMessageMediaArgs) MediaAnimation

func (a *EditMessageMediaArgs) MediaAnimation() MediaAnimationBuilder

func (*EditMessageMediaArgs) MediaAudio

func (a *EditMessageMediaArgs) MediaAudio() MediaAudioBuilder

func (*EditMessageMediaArgs) MediaDocument

func (a *EditMessageMediaArgs) MediaDocument() MediaDocumentBuilder

func (*EditMessageMediaArgs) MediaPhoto

func (a *EditMessageMediaArgs) MediaPhoto() MediaPhotoBuilder

func (*EditMessageMediaArgs) MediaVideo

func (a *EditMessageMediaArgs) MediaVideo() MediaVideoBuilder

type EditMessageReplyMarkupArgs

type EditMessageReplyMarkupArgs _EditMessageReplyMarkupArgs

type EditMessageTextArgs

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

func (*EditMessageTextArgs) DisableWebPagePreview

func (a *EditMessageTextArgs) DisableWebPagePreview()

func (*EditMessageTextArgs) InlineKeyboard

func (a *EditMessageTextArgs) InlineKeyboard() InlineKeyboardBuilder

func (*EditMessageTextArgs) InlineMessageId

func (a *EditMessageTextArgs) InlineMessageId(inlineMessageId int)

func (*EditMessageTextArgs) Text

type ForwardMessageArgs

type ForwardMessageArgs struct {
	ChatArgs
}

func (*ForwardMessageArgs) Archive

func (a *ForwardMessageArgs) Archive() (contentType string, data io.Reader)

func (*ForwardMessageArgs) DisableNotification

func (a *ForwardMessageArgs) DisableNotification()

func (*ForwardMessageArgs) FromChannel

func (a *ForwardMessageArgs) FromChannel(channelName string)

func (*ForwardMessageArgs) FromChatId

func (a *ForwardMessageArgs) FromChatId(chatId int)

func (*ForwardMessageArgs) MessageId

func (a *ForwardMessageArgs) MessageId(messageId int)

type GetFileArgs

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

func (*GetFileArgs) Archive

func (a *GetFileArgs) Archive() (contentType string, data io.Reader)

func (*GetFileArgs) FileId

func (a *GetFileArgs) FileId(fileId string)

type GetGameHighScoresArgs

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

func (*GetGameHighScoresArgs) Archive

func (a *GetGameHighScoresArgs) Archive() (contentType string, data io.Reader)

func (*GetGameHighScoresArgs) ChatMessageId

func (a *GetGameHighScoresArgs) ChatMessageId(chatId int, messageId int)

func (*GetGameHighScoresArgs) InlineMessageId

func (a *GetGameHighScoresArgs) InlineMessageId(messageId int)

func (*GetGameHighScoresArgs) UserId

func (a *GetGameHighScoresArgs) UserId(userId int)

type GetStickerSetArgs

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

func (*GetStickerSetArgs) Archive

func (a *GetStickerSetArgs) Archive() (contentType string, data io.Reader)

func (*GetStickerSetArgs) Name

func (a *GetStickerSetArgs) Name(name string)

type GetUpdatesArgs

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

func (*GetUpdatesArgs) AllowedUpdates

func (a *GetUpdatesArgs) AllowedUpdates() AllowedUpdatesBuilder

func (*GetUpdatesArgs) Archive

func (a *GetUpdatesArgs) Archive() (contentType string, data io.Reader)

func (*GetUpdatesArgs) Limit

func (a *GetUpdatesArgs) Limit(limit int)

func (*GetUpdatesArgs) Offset

func (a *GetUpdatesArgs) Offset(offset int)

type GetUserProfilePhotosArgs

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

func (*GetUserProfilePhotosArgs) Archive

func (a *GetUserProfilePhotosArgs) Archive() (contentType string, data io.Reader)

func (*GetUserProfilePhotosArgs) Limit

func (a *GetUserProfilePhotosArgs) Limit(limit int)

func (*GetUserProfilePhotosArgs) Offset

func (a *GetUserProfilePhotosArgs) Offset(offset int)

func (*GetUserProfilePhotosArgs) UserId

func (a *GetUserProfilePhotosArgs) UserId(userId int)

type InlineKeyboardBuilder

type InlineKeyboardBuilder interface {
	ArgumentBuilder

	// Add a URL button.
	AddUrlButton(text, url string) InlineKeyboardBuilder

	// Add a callback button.
	AddCallbackButton(text, data string) InlineKeyboardBuilder

	// Set a game button. One inline keyboard can
	// have only one game/pay button at most.
	GameButton(text string) InlineKeyboardBuilder

	// Set a pay button. One inline keyboard can
	// have only one game/pay button at most.
	PayButton(text string) InlineKeyboardBuilder

	// Define how the buttons are arranged.
	//
	// Each rowSize means how many buttons can be placed in that row, and the
	// last rowSize will be followed if there are more buttons need to be placed.
	//
	// If the layout is not specified, all the buttons will be placed in one row.
	//
	// For example, if the layout is
	//     [2]:    The buttons will be splited to multiple rows,
	//             each row contains two buttons at most.
	//     [3, 2]: The buttons will be splited to multiple rows,
	//             the first row contains three buttons,
	//             and the other rows contain two buttons at most.
	Layout(rowSize ...int) InlineKeyboardBuilder
}

InlineKeyboardBuilder is the builder to assemble inline keyboard.

type InputFile

type InputFile interface {

	// Base name of the file
	Name() string

	// Reader to read the file data, will be
	// closed by the code who use it.
	Data() io.ReadCloser
}

InputFile interface that hold the file name and content reader

func InputFileFromData

func InputFileFromData(name string, data []byte) InputFile

Create `InputFile` instance by pesudo name and memory data

func InputFileFromLocal

func InputFileFromLocal(localFile string) (f InputFile, err error)

Create `InputFile` instance by local file

type KickChatMemberArgs

type KickChatMemberArgs struct {
	ChatMemberArgs
}

func (*KickChatMemberArgs) Archive

func (a *KickChatMemberArgs) Archive() (contentType string, data io.Reader)

func (*KickChatMemberArgs) UntilDate

func (a *KickChatMemberArgs) UntilDate(timestamp int64)

type MediaAnimationBuilder

type MediaAnimationBuilder interface {
	ArgumentBuilder

	// Set caption
	Caption(caption string) MediaAnimationBuilder

	// Set caption parsing mode to Markdown
	Markdown() MediaAnimationBuilder

	// Set caption parsing mode to HTML
	HTML() MediaAnimationBuilder

	// Set animation with URL
	MediaUrl(url string) MediaAnimationBuilder

	// Set animation with existing fileId
	MediaFileId(fileId string) MediaAnimationBuilder

	// Set animation with file data
	MediaFile(file InputFile) MediaAnimationBuilder

	// Set thumb with existing fileId
	ThumbFileId(fileId string) MediaAnimationBuilder

	// Set thumb with file data
	ThumbFile(file InputFile) MediaAnimationBuilder

	// Set animation size
	Size(width, height int) MediaAnimationBuilder

	// Set animation duration in seconds
	Duration(duration int) MediaAnimationBuilder
}

type MediaAudioBuilder

type MediaAudioBuilder interface {
	ArgumentBuilder

	// Set caption
	Caption(caption string) MediaAudioBuilder

	// Set caption parsing mode to Markdown
	Markdown() MediaAudioBuilder

	// Set caption parsing mode to HTML
	HTML() MediaAudioBuilder

	// Set audio with URL
	MediaUrl(url string) MediaAudioBuilder

	// Set audio with existing fileId
	MediaFileId(fileId string) MediaAudioBuilder

	// Set audio with file data
	MediaFile(file InputFile) MediaAudioBuilder

	// Set thumb with existing fileId
	ThumbFileId(fileId string) MediaAudioBuilder

	// Set thumb with file data
	ThumbFile(file InputFile) MediaAudioBuilder

	// Set audio duration in seconds
	Duration(duration int) MediaAudioBuilder

	// Set audio performer
	Performer(performer string) MediaAudioBuilder

	// Set audio title
	Title(title string) MediaAudioBuilder
}

type MediaDocumentBuilder

type MediaDocumentBuilder interface {
	ArgumentBuilder

	// Set caption
	Caption(caption string) MediaDocumentBuilder

	// Set caption parsing mode to Markdown
	Markdown() MediaDocumentBuilder

	// Set caption parsing mode to HTML
	HTML() MediaDocumentBuilder

	// Set document with URL
	MediaUrl(url string) MediaDocumentBuilder

	// Set video with existing fileId
	MediaFileId(fileId string) MediaDocumentBuilder

	// Set video with file data
	MediaFile(file InputFile) MediaDocumentBuilder

	// Set thumb with existing fileId
	ThumbFileId(fileId string) MediaDocumentBuilder

	// Set thumb with file
	ThumbFile(file InputFile) MediaDocumentBuilder
}

type MediaPhotoBuilder

type MediaPhotoBuilder interface {
	ArgumentBuilder

	// Set caption
	Caption(caption string) MediaPhotoBuilder

	// Set caption parsing mode to Markdown
	Markdown() MediaPhotoBuilder

	// Set caption parsing mode to HTML
	HTML() MediaPhotoBuilder

	// Set media with URL
	MediaUrl(url string) MediaPhotoBuilder

	// Set media with FileId
	MediaFileId(fileId string) MediaPhotoBuilder

	// Set media with file data
	MediaFile(file InputFile) MediaPhotoBuilder
}

type MediaVideoBuilder

type MediaVideoBuilder interface {
	ArgumentBuilder

	// Set caption
	Caption(caption string) MediaVideoBuilder

	// Set caption parsing mode to Markdown
	Markdown() MediaVideoBuilder

	// Set caption parsing mode to HTML
	HTML() MediaVideoBuilder

	// Set video with URL
	MediaUrl(url string) MediaVideoBuilder

	// Set video with existing fileId
	MediaFileId(fileId string) MediaVideoBuilder

	// Set video with file data
	MediaFile(file InputFile) MediaVideoBuilder

	// Set thumb with existing fileId
	ThumbFileId(fileId string) MediaVideoBuilder

	// Set thumb with file data
	ThumbFile(file InputFile) MediaVideoBuilder

	// Set video size
	Size(width, height int) MediaVideoBuilder

	// Set video duration in seconds
	Duration(duration int) MediaVideoBuilder

	// Set video supports streaming
	SupportsStreaming() MediaVideoBuilder
}

type ParseModeSelector

type ParseModeSelector interface {

	// Set parse mode to Markdown
	Markdown()

	// Set parse mode to HTML
	HTML()
}

Switch parse mode for text/caption

type PassportFileErrorBuilder

type PassportFileErrorBuilder interface {
	ArgumentBuilder
	UtilityBill() PassportFileErrorBuilder
	BankStatement() PassportFileErrorBuilder
	RentalAgreement() PassportFileErrorBuilder
	PassportRegistration() PassportFileErrorBuilder
	TemporaryRegistration() PassportFileErrorBuilder
	FileHash(hash ...string) PassportFileErrorBuilder
	Message(message string) PassportFileErrorBuilder
}

type PassportFrontSideErrorBuilder

type PassportFrontSideErrorBuilder interface {
	ArgumentBuilder
	Passport() PassportFrontSideErrorBuilder
	DriverLicense() PassportFrontSideErrorBuilder
	IdentityCard() PassportFrontSideErrorBuilder
	InternalPassport() PassportFrontSideErrorBuilder
	FileHash(hash string) PassportFrontSideErrorBuilder
	Message(message string) PassportFrontSideErrorBuilder
}

type PassportSelfieErrorBuilder

type PassportSelfieErrorBuilder interface {
	ArgumentBuilder
	Passport() PassportSelfieErrorBuilder
	DriverLicense() PassportSelfieErrorBuilder
	IdentityCard() PassportSelfieErrorBuilder
	InternalPassport() PassportSelfieErrorBuilder
	FileHash(hash string) PassportSelfieErrorBuilder
	Message(message string) PassportSelfieErrorBuilder
}

type PinChatMessageArgs

type PinChatMessageArgs struct {
	ChatArgs
}

func (*PinChatMessageArgs) Archive

func (a *PinChatMessageArgs) Archive() (contentType string, data io.Reader)

func (*PinChatMessageArgs) DisableNotification

func (a *PinChatMessageArgs) DisableNotification()

func (*PinChatMessageArgs) MessageId

func (a *PinChatMessageArgs) MessageId(messageId int)

type PromoteChatMemberArgs

type PromoteChatMemberArgs struct {
	ChatMemberArgs
}

func (*PromoteChatMemberArgs) Archive

func (a *PromoteChatMemberArgs) Archive() (contentType string, data io.Reader)

func (*PromoteChatMemberArgs) ChangeInfo

func (a *PromoteChatMemberArgs) ChangeInfo() Switch

func (*PromoteChatMemberArgs) DeleteMessages

func (a *PromoteChatMemberArgs) DeleteMessages() Switch

func (*PromoteChatMemberArgs) EditMessages

func (a *PromoteChatMemberArgs) EditMessages() Switch

func (*PromoteChatMemberArgs) InviteUsers

func (a *PromoteChatMemberArgs) InviteUsers() Switch

func (*PromoteChatMemberArgs) PinMessages

func (a *PromoteChatMemberArgs) PinMessages() Switch

func (*PromoteChatMemberArgs) PostMessages

func (a *PromoteChatMemberArgs) PostMessages() Switch

func (*PromoteChatMemberArgs) PromoteMembers

func (a *PromoteChatMemberArgs) PromoteMembers() Switch

func (*PromoteChatMemberArgs) RestrictMembers

func (a *PromoteChatMemberArgs) RestrictMembers() Switch

type ReplyKeyboardBuilder

type ReplyKeyboardBuilder interface {
	ArgumentBuilder

	// Requests clients to resize the keyboard vertically for optimal fit
	ResizeKeyboard() ReplyKeyboardBuilder

	// Requests clients hide the keyboard once it's been used,
	OneTimeKeyboard() ReplyKeyboardBuilder

	// Set the keyboard shows to specific users only.
	Selective() ReplyKeyboardBuilder

	// Add one or more text buttons.
	AddButtons(text ...string) ReplyKeyboardBuilder

	// Add a contact button, which will send user's phone number when be clicked.
	AddContactButton(text string) ReplyKeyboardBuilder

	// Add a location button, which will send user's current location when be clicked.
	AddLocationButton(text string) ReplyKeyboardBuilder

	// Define how the buttons are arranged.
	//
	// Each rowSize means how many buttons can be placed in that row, and the
	// last rowSize will be followed if there are more buttons need to be placed.
	//
	// If the layout is not specified, all the buttons will be placed in one row.
	//
	// For example, if the layout is
	//     [2]:    The buttons will be splited to multiple rows,
	//             each row contains two buttons at most.
	//     [3, 2]: The buttons will be splited to multiple rows,
	//             the first row contains three buttons,
	//             and the other rows contain two buttons at most.
	Layout(rowSize ...int) ReplyKeyboardBuilder
}

ReplyKeyboardBuilder is the builder to assemble reply keyboard.

type RestrictChatMemberArgs

type RestrictChatMemberArgs struct {
	KickChatMemberArgs
}

func (*RestrictChatMemberArgs) AddWebPagePreviews

func (a *RestrictChatMemberArgs) AddWebPagePreviews() Switch

func (*RestrictChatMemberArgs) Archive

func (a *RestrictChatMemberArgs) Archive() (contentType string, data io.Reader)

func (*RestrictChatMemberArgs) SendMediaMessages

func (a *RestrictChatMemberArgs) SendMediaMessages() Switch

func (*RestrictChatMemberArgs) SendMessages

func (a *RestrictChatMemberArgs) SendMessages() Switch

func (*RestrictChatMemberArgs) SendOtherMessages

func (a *RestrictChatMemberArgs) SendOtherMessages() Switch

type SendAnimationArgs

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

func (*SendAnimationArgs) Animation

func (a *SendAnimationArgs) Animation(file InputFile)

func (*SendAnimationArgs) Caption

func (a *SendAnimationArgs) Caption(caption string) ParseModeSelector

func (*SendAnimationArgs) Duration

func (a *SendAnimationArgs) Duration(duration int)

func (*SendAnimationArgs) Size

func (a *SendAnimationArgs) Size(width, height int)

func (*SendAnimationArgs) Thumb

func (a *SendAnimationArgs) Thumb(file InputFile)

type SendAudioArgs

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

func (*SendAudioArgs) Audio

func (a *SendAudioArgs) Audio(file InputFile)

func (*SendAudioArgs) AudioFileId

func (a *SendAudioArgs) AudioFileId(fileId string)

func (*SendAudioArgs) AudioUrl

func (a *SendAudioArgs) AudioUrl(url string)

func (*SendAudioArgs) Caption

func (a *SendAudioArgs) Caption(caption string) ParseModeSelector

func (*SendAudioArgs) Duration

func (a *SendAudioArgs) Duration(duration int)

func (*SendAudioArgs) Performer

func (a *SendAudioArgs) Performer(performer string)

func (*SendAudioArgs) Thumb

func (a *SendAudioArgs) Thumb(file InputFile)

func (*SendAudioArgs) Title

func (a *SendAudioArgs) Title(title string)

type SendChatActionArgs

type SendChatActionArgs struct {
	ChatArgs
}

func (*SendChatActionArgs) Archive

func (a *SendChatActionArgs) Archive() (contentType string, data io.Reader)

func (*SendChatActionArgs) FindLocation

func (a *SendChatActionArgs) FindLocation()

func (*SendChatActionArgs) RecordAudio

func (a *SendChatActionArgs) RecordAudio()

func (*SendChatActionArgs) RecordVideo

func (a *SendChatActionArgs) RecordVideo()

func (*SendChatActionArgs) RecordVideoNote

func (a *SendChatActionArgs) RecordVideoNote()

func (*SendChatActionArgs) Typing

func (a *SendChatActionArgs) Typing()

func (*SendChatActionArgs) UploadAudio

func (a *SendChatActionArgs) UploadAudio()

func (*SendChatActionArgs) UploadDocument

func (a *SendChatActionArgs) UploadDocument()

func (*SendChatActionArgs) UploadPhoto

func (a *SendChatActionArgs) UploadPhoto()

func (*SendChatActionArgs) UploadVideo

func (a *SendChatActionArgs) UploadVideo()

func (*SendChatActionArgs) UploadVideoNote

func (a *SendChatActionArgs) UploadVideoNote()

type SendContactArgs

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

func (*SendContactArgs) DisableNotification

func (a *SendContactArgs) DisableNotification()

func (*SendContactArgs) FirstName

func (a *SendContactArgs) FirstName(firstName string)

func (*SendContactArgs) ForceReply

func (a *SendContactArgs) ForceReply(selective bool)

func (*SendContactArgs) InlineKeyboard

func (a *SendContactArgs) InlineKeyboard() InlineKeyboardBuilder

func (*SendContactArgs) LastName

func (a *SendContactArgs) LastName(lastName string)

func (*SendContactArgs) PhoneNumber

func (a *SendContactArgs) PhoneNumber(phoneNumber string)

func (*SendContactArgs) RemoveKeyboard

func (a *SendContactArgs) RemoveKeyboard(selective bool)

func (*SendContactArgs) ReplyKeyboard

func (a *SendContactArgs) ReplyKeyboard() ReplyKeyboardBuilder

func (*SendContactArgs) ReplyToMessageId

func (a *SendContactArgs) ReplyToMessageId(messageId int)

func (*SendContactArgs) VCard

func (a *SendContactArgs) VCard(vcard string)

type SendDocumentArgs

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

func (*SendDocumentArgs) Caption

func (a *SendDocumentArgs) Caption(caption string) ParseModeSelector

func (*SendDocumentArgs) Document

func (a *SendDocumentArgs) Document(file InputFile)

func (*SendDocumentArgs) Thumb

func (a *SendDocumentArgs) Thumb(file InputFile)

type SendGameArgs

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

func (*SendGameArgs) Archive

func (a *SendGameArgs) Archive() (contentType string, data io.Reader)

func (*SendGameArgs) ChatId

func (a *SendGameArgs) ChatId(chatId int)

func (*SendGameArgs) DisableNotification

func (a *SendGameArgs) DisableNotification()

func (*SendGameArgs) InlineKeyboard

func (a *SendGameArgs) InlineKeyboard() InlineKeyboardBuilder

func (*SendGameArgs) ReplyToMessageId

func (a *SendGameArgs) ReplyToMessageId(messageId int)

func (*SendGameArgs) ShortName

func (a *SendGameArgs) ShortName(shortName string)

type SendInvoiceArgs

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

func (*SendInvoiceArgs) AddPrice

func (a *SendInvoiceArgs) AddPrice(label string, amount int)

func (*SendInvoiceArgs) Archive

func (a *SendInvoiceArgs) Archive() (contentType string, data io.Reader)

func (*SendInvoiceArgs) ChatId

func (a *SendInvoiceArgs) ChatId(chatId int)

func (*SendInvoiceArgs) Currency

func (a *SendInvoiceArgs) Currency(currency string)

func (*SendInvoiceArgs) Description

func (a *SendInvoiceArgs) Description(description string)

func (*SendInvoiceArgs) DisableNotification

func (a *SendInvoiceArgs) DisableNotification()

func (*SendInvoiceArgs) Flexible

func (a *SendInvoiceArgs) Flexible()

func (*SendInvoiceArgs) InlineKeyboard

func (a *SendInvoiceArgs) InlineKeyboard() InlineKeyboardBuilder

func (*SendInvoiceArgs) NeedEmail

func (a *SendInvoiceArgs) NeedEmail()

func (*SendInvoiceArgs) NeedName

func (a *SendInvoiceArgs) NeedName()

func (*SendInvoiceArgs) NeedPhoneNumber

func (a *SendInvoiceArgs) NeedPhoneNumber()

func (*SendInvoiceArgs) NeedShippingAddress

func (a *SendInvoiceArgs) NeedShippingAddress()

func (*SendInvoiceArgs) Payload

func (a *SendInvoiceArgs) Payload(payload string)

func (*SendInvoiceArgs) PhotoMeasure

func (a *SendInvoiceArgs) PhotoMeasure(width, height int)

func (*SendInvoiceArgs) PhotoSize

func (a *SendInvoiceArgs) PhotoSize(size int)

func (*SendInvoiceArgs) PhotoUrl

func (a *SendInvoiceArgs) PhotoUrl(url string)

func (*SendInvoiceArgs) ProviderData

func (a *SendInvoiceArgs) ProviderData(data string)

func (*SendInvoiceArgs) ProviderToken

func (a *SendInvoiceArgs) ProviderToken(token string)

func (*SendInvoiceArgs) ReplyToMessageId

func (a *SendInvoiceArgs) ReplyToMessageId(messageId int)

func (*SendInvoiceArgs) SendEmailToProvider

func (a *SendInvoiceArgs) SendEmailToProvider()

func (*SendInvoiceArgs) SendPhoneNumberToProvider

func (a *SendInvoiceArgs) SendPhoneNumberToProvider()

func (*SendInvoiceArgs) StartParameter

func (a *SendInvoiceArgs) StartParameter(parameter string)

func (*SendInvoiceArgs) Title

func (a *SendInvoiceArgs) Title(title string)

type SendLocationArgs

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

func (*SendLocationArgs) DisableNotification

func (a *SendLocationArgs) DisableNotification()

func (*SendLocationArgs) ForceReply

func (a *SendLocationArgs) ForceReply(selective bool)

func (*SendLocationArgs) InlineKeyboard

func (a *SendLocationArgs) InlineKeyboard() InlineKeyboardBuilder

func (*SendLocationArgs) LivePeriod

func (a *SendLocationArgs) LivePeriod(period int)

func (*SendLocationArgs) Location

func (a *SendLocationArgs) Location(latitude, longitude float64)

func (*SendLocationArgs) RemoveKeyboard

func (a *SendLocationArgs) RemoveKeyboard(selective bool)

func (*SendLocationArgs) ReplyKeyboard

func (a *SendLocationArgs) ReplyKeyboard() ReplyKeyboardBuilder

func (*SendLocationArgs) ReplyToMessageId

func (a *SendLocationArgs) ReplyToMessageId(messageId int)

type SendMediaGroupArgs

type SendMediaGroupArgs struct {
	ChatArgs
	// contains filtered or unexported fields
}

func (*SendMediaGroupArgs) AddMediaPhoto

func (a *SendMediaGroupArgs) AddMediaPhoto() MediaPhotoBuilder

Add a photo media to the group. According to the API limit, you can add at most 10 photo/video media to one group.

func (*SendMediaGroupArgs) AddMediaVideo

func (a *SendMediaGroupArgs) AddMediaVideo() MediaVideoBuilder

Add a video media to the group. According to the API limit, you can add at most 10 photo/video media to one group.

func (*SendMediaGroupArgs) Archive

func (a *SendMediaGroupArgs) Archive() (contentType string, data io.Reader)

func (*SendMediaGroupArgs) DisableNotification

func (a *SendMediaGroupArgs) DisableNotification()

func (*SendMediaGroupArgs) ReplyToMessageId

func (a *SendMediaGroupArgs) ReplyToMessageId(messageId int)

type SendMessageArgs

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

func (*SendMessageArgs) DisableNotification

func (a *SendMessageArgs) DisableNotification()

func (*SendMessageArgs) DisableWebPagePreview

func (a *SendMessageArgs) DisableWebPagePreview()

func (*SendMessageArgs) ForceReply

func (a *SendMessageArgs) ForceReply(selective bool)

func (*SendMessageArgs) InlineKeyboard

func (a *SendMessageArgs) InlineKeyboard() InlineKeyboardBuilder

func (*SendMessageArgs) RemoveKeyboard

func (a *SendMessageArgs) RemoveKeyboard(selective bool)

func (*SendMessageArgs) ReplyKeyboard

func (a *SendMessageArgs) ReplyKeyboard() ReplyKeyboardBuilder

func (*SendMessageArgs) ReplyToMessageId

func (a *SendMessageArgs) ReplyToMessageId(messageId int)

func (*SendMessageArgs) Text

type SendPhotoArgs

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

func (*SendPhotoArgs) Caption

func (a *SendPhotoArgs) Caption(caption string) ParseModeSelector

func (*SendPhotoArgs) Photo

func (a *SendPhotoArgs) Photo(file InputFile)

func (*SendPhotoArgs) PhotoFileId

func (a *SendPhotoArgs) PhotoFileId(fileId string)

func (*SendPhotoArgs) PhotoUrl

func (a *SendPhotoArgs) PhotoUrl(url string)

type SendPollArgs

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

func (*SendPollArgs) DisableNotification

func (a *SendPollArgs) DisableNotification()

func (*SendPollArgs) ForceReply

func (a *SendPollArgs) ForceReply(selective bool)

func (*SendPollArgs) InlineKeyboard

func (a *SendPollArgs) InlineKeyboard() InlineKeyboardBuilder

func (*SendPollArgs) Options

func (a *SendPollArgs) Options(options ...string)

func (*SendPollArgs) Question

func (a *SendPollArgs) Question(questing string)

func (*SendPollArgs) RemoveKeyboard

func (a *SendPollArgs) RemoveKeyboard(selective bool)

func (*SendPollArgs) ReplyKeyboard

func (a *SendPollArgs) ReplyKeyboard() ReplyKeyboardBuilder

func (*SendPollArgs) ReplyToMessageId

func (a *SendPollArgs) ReplyToMessageId(messageId int)

type SendStickerArgs

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

func (*SendStickerArgs) DisableNotification

func (a *SendStickerArgs) DisableNotification()

func (*SendStickerArgs) ForceReply

func (a *SendStickerArgs) ForceReply(selective bool)

func (*SendStickerArgs) InlineKeyboard

func (a *SendStickerArgs) InlineKeyboard() InlineKeyboardBuilder

func (*SendStickerArgs) RemoveKeyboard

func (a *SendStickerArgs) RemoveKeyboard(selective bool)

func (*SendStickerArgs) ReplyKeyboard

func (a *SendStickerArgs) ReplyKeyboard() ReplyKeyboardBuilder

func (*SendStickerArgs) ReplyToMessageId

func (a *SendStickerArgs) ReplyToMessageId(messageId int)

func (*SendStickerArgs) StickerFile

func (a *SendStickerArgs) StickerFile(file InputFile)

func (*SendStickerArgs) StickerId

func (a *SendStickerArgs) StickerId(stickerId string)

type SendVenueArgs

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

func (*SendVenueArgs) Address

func (a *SendVenueArgs) Address(address string)

func (*SendVenueArgs) DisableNotification

func (a *SendVenueArgs) DisableNotification()

func (*SendVenueArgs) ForceReply

func (a *SendVenueArgs) ForceReply(selective bool)

func (*SendVenueArgs) Foursquare

func (a *SendVenueArgs) Foursquare(fsId, fsType string)

func (*SendVenueArgs) InlineKeyboard

func (a *SendVenueArgs) InlineKeyboard() InlineKeyboardBuilder

func (*SendVenueArgs) Location

func (a *SendVenueArgs) Location(latitude, longitude float64)

func (*SendVenueArgs) RemoveKeyboard

func (a *SendVenueArgs) RemoveKeyboard(selective bool)

func (*SendVenueArgs) ReplyKeyboard

func (a *SendVenueArgs) ReplyKeyboard() ReplyKeyboardBuilder

func (*SendVenueArgs) ReplyToMessageId

func (a *SendVenueArgs) ReplyToMessageId(messageId int)

func (*SendVenueArgs) Title

func (a *SendVenueArgs) Title(title string)

type SendVideoArgs

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

func (*SendVideoArgs) Caption

func (a *SendVideoArgs) Caption(caption string) ParseModeSelector

func (*SendVideoArgs) Duration

func (a *SendVideoArgs) Duration(duration int)

func (*SendVideoArgs) Size

func (a *SendVideoArgs) Size(width, height int)

func (*SendVideoArgs) SupportsStreaming

func (a *SendVideoArgs) SupportsStreaming()

func (*SendVideoArgs) Thumb

func (a *SendVideoArgs) Thumb(file InputFile)

func (*SendVideoArgs) Video

func (a *SendVideoArgs) Video(file InputFile)

func (*SendVideoArgs) VideoUrl

func (a *SendVideoArgs) VideoUrl(videoUrl string)

type SendVideoNoteArgs

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

func (*SendVideoNoteArgs) Caption

func (a *SendVideoNoteArgs) Caption(caption string) ParseModeSelector

func (*SendVideoNoteArgs) Duration

func (a *SendVideoNoteArgs) Duration(duration int)

func (*SendVideoNoteArgs) SideLength

func (a *SendVideoNoteArgs) SideLength(length int)

func (*SendVideoNoteArgs) Thumb

func (a *SendVideoNoteArgs) Thumb(file InputFile)

func (*SendVideoNoteArgs) VideoNote

func (a *SendVideoNoteArgs) VideoNote(file InputFile)

type SendVoiceArgs

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

func (*SendVoiceArgs) Caption

func (a *SendVoiceArgs) Caption(caption string) ParseModeSelector

func (*SendVoiceArgs) Duration

func (a *SendVoiceArgs) Duration(duration int)

func (*SendVoiceArgs) Voice

func (a *SendVoiceArgs) Voice(file InputFile)

type SetChatDescriptionArgs

type SetChatDescriptionArgs struct {
	ChatArgs
}

func (*SetChatDescriptionArgs) Archive

func (a *SetChatDescriptionArgs) Archive() (contentType string, data io.Reader)

func (*SetChatDescriptionArgs) Description

func (a *SetChatDescriptionArgs) Description(description string)

type SetChatPhotoArgs

type SetChatPhotoArgs struct {
	ChatArgs
}

func (*SetChatPhotoArgs) Archive

func (a *SetChatPhotoArgs) Archive() (contentType string, data io.Reader)

func (*SetChatPhotoArgs) Photo

func (a *SetChatPhotoArgs) Photo(file InputFile)

type SetChatStickerSetArgs

type SetChatStickerSetArgs struct {
	ChatArgs
}

func (*SetChatStickerSetArgs) Archive

func (a *SetChatStickerSetArgs) Archive() (contentType string, data io.Reader)

func (*SetChatStickerSetArgs) StickerSet

func (a *SetChatStickerSetArgs) StickerSet(name string)

type SetChatTitleArgs

type SetChatTitleArgs struct {
	ChatArgs
}

func (*SetChatTitleArgs) Archive

func (a *SetChatTitleArgs) Archive() (contentType string, data io.Reader)

func (*SetChatTitleArgs) Title

func (a *SetChatTitleArgs) Title(title string)

type SetGameScoreArgs

type SetGameScoreArgs struct {
	GetGameHighScoresArgs
}

func (*SetGameScoreArgs) Archive

func (a *SetGameScoreArgs) Archive() (contentType string, data io.Reader)

func (*SetGameScoreArgs) DisableEditMessage

func (a *SetGameScoreArgs) DisableEditMessage()

func (*SetGameScoreArgs) Force

func (a *SetGameScoreArgs) Force()

func (*SetGameScoreArgs) Score

func (a *SetGameScoreArgs) Score(score int)

type SetPassportDataErrorsArgs

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

func (*SetPassportDataErrorsArgs) AddDataFieldError

func (*SetPassportDataErrorsArgs) AddFileError

func (*SetPassportDataErrorsArgs) AddFrontSideError

func (*SetPassportDataErrorsArgs) AddReverseSideError

func (*SetPassportDataErrorsArgs) AddSelfieError

func (*SetPassportDataErrorsArgs) AddTranslationFileError

func (*SetPassportDataErrorsArgs) AddUnspecifiedError

func (*SetPassportDataErrorsArgs) Archive

func (a *SetPassportDataErrorsArgs) Archive() (contentType string, data io.Reader)

func (*SetPassportDataErrorsArgs) UserId

func (a *SetPassportDataErrorsArgs) UserId(userId int)

type SetStickerPositionInSetArgs

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

func (*SetStickerPositionInSetArgs) Archive

func (a *SetStickerPositionInSetArgs) Archive() (contentType string, data io.Reader)

func (*SetStickerPositionInSetArgs) Position

func (a *SetStickerPositionInSetArgs) Position(position int)

func (*SetStickerPositionInSetArgs) StickerId

func (a *SetStickerPositionInSetArgs) StickerId(fileId string)

type SetWebhookArgs

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

func (*SetWebhookArgs) AllowedUpdates

func (a *SetWebhookArgs) AllowedUpdates() AllowedUpdatesBuilder

func (*SetWebhookArgs) Archive

func (a *SetWebhookArgs) Archive() (contentType string, data io.Reader)

func (*SetWebhookArgs) Certificate

func (a *SetWebhookArgs) Certificate(file InputFile)

func (*SetWebhookArgs) MaxConnections

func (a *SetWebhookArgs) MaxConnections(maxConns int)

func (*SetWebhookArgs) Url

func (a *SetWebhookArgs) Url(url string)

type ShippingOptionBuilder

type ShippingOptionBuilder interface {
	ArgumentBuilder

	// Set option identifier
	Id(id string) ShippingOptionBuilder

	// Set option title
	Title(title string) ShippingOptionBuilder

	// Add a labeled price
	AddPrice(label string, amount int) ShippingOptionBuilder
}

type StopPollArgs

type StopPollArgs struct {
	ChatMessageArgs
}

func (*StopPollArgs) Archive

func (a *StopPollArgs) Archive() (contentType string, data io.Reader)

func (*StopPollArgs) InlineKeyboard

func (a *StopPollArgs) InlineKeyboard() InlineKeyboardBuilder

type Switch

type Switch interface {

	// Set the argument to true
	On()

	// Set the argument to false
	Off()
}

Value switch for boolean argument

type UploadStickerFileArgs

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

func (*UploadStickerFileArgs) Archive

func (a *UploadStickerFileArgs) Archive() (contentType string, data io.Reader)

func (*UploadStickerFileArgs) StickerFile

func (a *UploadStickerFileArgs) StickerFile(file InputFile)

func (*UploadStickerFileArgs) UserId

func (a *UploadStickerFileArgs) UserId(userId int)

Jump to

Keyboard shortcuts

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