Documentation ¶
Index ¶
- func AlwaysReturnFalse(bot TgBot, msg Message) bool
- func AlwaysReturnTrue(bot TgBot, msg Message) bool
- func StartServerMultiplesBots(uri string, pathl string, newrelic *RelicConfig, bots ...*TgBot)
- func StartServerMultiplesBotsHostPort(uri string, pathl string, host string, port string, newrelic *RelicConfig, ...)
- type Audio
- type AudioConditionalCall
- type ChainStructure
- type ChatAction
- type CommandStructure
- type ConditionCallStructure
- type Contact
- type CustomCall
- type DefaultOptionsBot
- type DeleteChatPhotoConditionalCall
- type Document
- type DocumentConditionalCall
- type File
- type ForceReply
- type ForwardConditionalCall
- type ForwardMessageQuery
- type GenericSendQuery
- type GetUserProfilePhotosQuery
- type GroupChat
- type GroupChatCreatedConditionalCall
- type GroupConditionalCall
- type ImageConditionalCall
- type KeyboardLayout
- type LeftParticipantConditionalCall
- type Location
- type LocationConditionalCall
- type Message
- type MessageWithUpdateID
- type MultiRegexCommand
- type NewParticipantConditionalCall
- type NewPhotoConditionalCall
- type NewTitleConditionalCall
- type NoMessageCall
- type ParseModeT
- type PhotoSize
- type QuerySendMessage
- type ReaderSender
- type RegexCommand
- type RelicConfig
- type RepliedConditionalCall
- type ReplyKeyboardHide
- type ReplyKeyboardMarkup
- type ReplyMarkupInt
- type ResultBase
- type ResultGetUpdates
- type ResultGetUser
- type ResultSetWebhook
- type ResultWithGetFile
- type ResultWithMessage
- type ResultWithUserProfilePhotos
- type Send
- func (s *Send) Action(action ChatAction) *SendChatAction
- func (s *Send) Audio(audio string) *SendAudio
- func (s *Send) Document(doc interface{}) *SendDocument
- func (s *Send) Forward(to int, msg int) *SendForward
- func (s *Send) Location(latitude float64, long float64) *SendLocation
- func (s *Send) Photo(photo interface{}) *SendPhoto
- func (s *Send) Sticker(stick interface{}) *SendSticker
- func (s *Send) Text(text string) *SendText
- func (s *Send) Video(vid string) *SendVideo
- func (s *Send) Voice(voice string) *SendVoice
- type SendAudio
- func (sp *SendAudio) Duration(d int) *SendAudio
- func (sp SendAudio) End() ResultWithMessage
- func (sp *SendAudio) ForceReply(fr ForceReply) *SendAudio
- func (sp *SendAudio) Keyboard(kb ReplyKeyboardMarkup) *SendAudio
- func (sp *SendAudio) KeyboardHide(kb ReplyKeyboardHide) *SendAudio
- func (sp *SendAudio) Performer(p string) *SendAudio
- func (sp *SendAudio) ReplyToMessage(rm int) *SendAudio
- func (sp *SendAudio) Title(d string) *SendAudio
- type SendAudioIDQuery
- type SendAudioPathQuery
- type SendChatAction
- type SendChatActionQuery
- type SendDocument
- func (sp SendDocument) End() ResultWithMessage
- func (sp *SendDocument) ForceReply(fr ForceReply) *SendDocument
- func (sp *SendDocument) Keyboard(kb ReplyKeyboardMarkup) *SendDocument
- func (sp *SendDocument) KeyboardHide(kb ReplyKeyboardHide) *SendDocument
- func (sp *SendDocument) ReplyToMessage(rm int) *SendDocument
- type SendDocumentIDQuery
- type SendDocumentPathQuery
- type SendForward
- type SendGetFile
- type SendLocation
- func (sp SendLocation) End() ResultWithMessage
- func (sp *SendLocation) ForceReply(fr ForceReply) *SendLocation
- func (sp *SendLocation) Keyboard(kb ReplyKeyboardMarkup) *SendLocation
- func (sp *SendLocation) KeyboardHide(kb ReplyKeyboardHide) *SendLocation
- func (sp *SendLocation) ReplyToMessage(rm int) *SendLocation
- func (sp *SendLocation) SetLatitude(lat float64) *SendLocation
- func (sp *SendLocation) SetLongitude(long float64) *SendLocation
- type SendLocationQuery
- type SendPhoto
- func (sp *SendPhoto) Caption(caption string) *SendPhoto
- func (sp SendPhoto) End() ResultWithMessage
- func (sp *SendPhoto) ForceReply(fr ForceReply) *SendPhoto
- func (sp *SendPhoto) Keyboard(kb ReplyKeyboardMarkup) *SendPhoto
- func (sp *SendPhoto) KeyboardHide(kb ReplyKeyboardHide) *SendPhoto
- func (sp *SendPhoto) ReplyToMessage(rm int) *SendPhoto
- type SendPhotoIDQuery
- type SendPhotoPathQuery
- type SendSticker
- func (sp SendSticker) End() ResultWithMessage
- func (sp *SendSticker) ForceReply(fr ForceReply) *SendSticker
- func (sp *SendSticker) Keyboard(kb ReplyKeyboardMarkup) *SendSticker
- func (sp *SendSticker) KeyboardHide(kb ReplyKeyboardHide) *SendSticker
- func (sp *SendSticker) ReplyToMessage(rm int) *SendSticker
- type SendStickerIDQuery
- type SendStickerPathQuery
- type SendText
- func (sp *SendText) DisablePreview(disab bool) *SendText
- func (sp SendText) End() ResultWithMessage
- func (sp *SendText) ForceReply(fr ForceReply) *SendText
- func (sp *SendText) Keyboard(kb ReplyKeyboardMarkup) *SendText
- func (sp *SendText) KeyboardHide(kb ReplyKeyboardHide) *SendText
- func (sp *SendText) ParseMode(pm ParseModeT) *SendText
- func (sp *SendText) ReplyToMessage(rm int) *SendText
- type SendVideo
- func (sp *SendVideo) Caption(cap string) *SendVideo
- func (sp *SendVideo) Duration(dur int) *SendVideo
- func (sp SendVideo) End() ResultWithMessage
- func (sp *SendVideo) ForceReply(fr ForceReply) *SendVideo
- func (sp *SendVideo) Keyboard(kb ReplyKeyboardMarkup) *SendVideo
- func (sp *SendVideo) KeyboardHide(kb ReplyKeyboardHide) *SendVideo
- func (sp *SendVideo) ReplyToMessage(rm int) *SendVideo
- type SendVideoIDQuery
- type SendVideoPathQuery
- type SendVoice
- func (sp *SendVoice) Duration(d int) *SendVoice
- func (sp SendVoice) End() ResultWithMessage
- func (sp *SendVoice) ForceReply(fr ForceReply) *SendVoice
- func (sp *SendVoice) Keyboard(kb ReplyKeyboardMarkup) *SendVoice
- func (sp *SendVoice) KeyboardHide(kb ReplyKeyboardHide) *SendVoice
- func (sp *SendVoice) ReplyToMessage(rm int) *SendVoice
- type SendVoiceIDQuery
- type SendVoicePathQuery
- type SetWebhookCertQuery
- type SetWebhookQuery
- type SimpleCommandFuncStruct
- type Sticker
- type StickerConditionalCall
- type TextConditionalCall
- type TgBot
- func (bot *TgBot) AddMainListener(list chan MessageWithUpdateID)
- func (bot *TgBot) Answer(msg Message) *Send
- func (bot *TgBot) AnyMsgFn(f func(TgBot, Message)) *TgBot
- func (bot *TgBot) AudioFn(f func(TgBot, Message, Audio, string)) *TgBot
- func (bot *TgBot) CancelChainCommand(path string, f func(TgBot, Message, string) *string) *TgBot
- func (bot *TgBot) CommandFn(path string, f func(TgBot, Message, []string, map[string]string) *string) *TgBot
- func (bot *TgBot) CustomFn(cond func(TgBot, Message) bool, f func(TgBot, Message)) *TgBot
- func (bot *TgBot) DefaultAllowWithoutSlashInMention(b bool) *TgBot
- func (bot *TgBot) DefaultCleanInitialUsername(b bool) *TgBot
- func (bot *TgBot) DefaultDisableWebpagePreview(b bool) *TgBot
- func (bot *TgBot) DefaultOneTimeKeyboard(b bool) *TgBot
- func (bot *TgBot) DefaultSelective(b bool) *TgBot
- func (bot *TgBot) DeleteChatPhotoFn(f func(TgBot, Message, int)) *TgBot
- func (bot *TgBot) DocumentFn(f func(TgBot, Message, Document, string)) *TgBot
- func (bot TgBot) DownloadFilePathReader(path string) (io.ReadCloser, error)
- func (bot *TgBot) EndChain() *TgBot
- func (bot *TgBot) File(id string) *SendGetFile
- func (bot *TgBot) ForwardFn(f func(TgBot, Message, User, int)) *TgBot
- func (bot TgBot) ForwardMessage(cid int, fid int, mid int) ResultWithMessage
- func (bot TgBot) ForwardMessageQuery(payload ForwardMessageQuery) ResultWithMessage
- func (bot TgBot) GetFile(id string) ResultWithGetFile
- func (bot TgBot) GetMe() (User, error)
- func (bot *TgBot) GetMessageChannel() chan MessageWithUpdateID
- func (bot TgBot) GetUpdates() ([]MessageWithUpdateID, error)
- func (bot TgBot) GetUserProfilePhotos(uid int, args ...int) UserProfilePhotos
- func (bot TgBot) GetUserProfilePhotosQuery(quer GetUserProfilePhotosQuery) ResultWithUserProfilePhotos
- func (bot *TgBot) GroupChatCreatedFn(f func(TgBot, Message, int)) *TgBot
- func (bot *TgBot) GroupFn(f func(TgBot, Message, int, string)) *TgBot
- func (bot TgBot) HandleBotan(msg Message)
- func (bot *TgBot) ImageFn(f func(TgBot, Message, []PhotoSize, string)) *TgBot
- func (bot *TgBot) LeftParticipantFn(f func(TgBot, Message, int, User)) *TgBot
- func (bot *TgBot) LocationFn(f func(TgBot, Message, float64, float64)) *TgBot
- func (bot *TgBot) LoopChain() *TgBot
- func (bot TgBot) MessagesHandler(Incoming <-chan MessageWithUpdateID)
- func (bot *TgBot) MultiCommandFn(paths []string, f func(TgBot, Message, []string, map[string]string) *string) *TgBot
- func (bot *TgBot) MultiRegexFn(paths []string, f func(TgBot, Message, []string, map[string]string) *string) *TgBot
- func (bot *TgBot) NewParticipantFn(f func(TgBot, Message, int, User)) *TgBot
- func (bot *TgBot) NewPhotoChatFn(f func(TgBot, Message, int, string)) *TgBot
- func (bot *TgBot) NewTitleChatFn(f func(TgBot, Message, int, string)) *TgBot
- func (bot *TgBot) NotCalledFn(f func(TgBot, Message)) *TgBot
- func (bot TgBot) ProcessAllMsg(msg Message)
- func (bot *TgBot) ProcessMessages(messages []MessageWithUpdateID)
- func (bot *TgBot) RegexFn(path string, f func(TgBot, Message, []string, map[string]string) *string) *TgBot
- func (bot *TgBot) ReplyFn(f func(TgBot, Message, Message)) *TgBot
- func (bot *TgBot) Send(cid int) *Send
- func (bot TgBot) SendAudio(cid int, audio string, duration *int, performer *string, title *string, ...) ResultWithMessage
- func (bot TgBot) SendAudioQuery(payload interface{}) ResultWithMessage
- func (bot TgBot) SendAudioWithForceReply(cid int, audio string, duration *int, performer *string, title *string, ...) ResultWithMessage
- func (bot TgBot) SendAudioWithKeyboard(cid int, audio string, duration *int, performer *string, title *string, ...) ResultWithMessage
- func (bot TgBot) SendAudioWithKeyboardHide(cid int, audio string, duration *int, performer *string, title *string, ...) ResultWithMessage
- func (bot TgBot) SendChatAction(cid int, ca ChatAction)
- func (bot TgBot) SendChatActionQuery(payload SendChatActionQuery)
- func (bot TgBot) SendDocument(cid int, document interface{}, rmi *int, rm *ReplyMarkupInt) ResultWithMessage
- func (bot TgBot) SendDocumentQuery(payload interface{}) ResultWithMessage
- func (bot TgBot) SendDocumentWithForceReply(cid int, document string, rmi *int, rm ForceReply) ResultWithMessage
- func (bot TgBot) SendDocumentWithKeyboard(cid int, document string, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage
- func (bot TgBot) SendDocumentWithKeyboardHide(cid int, document string, rmi *int, rm ReplyKeyboardHide) ResultWithMessage
- func (bot TgBot) SendLocation(cid int, latitude float64, longitude float64, rtmid *int, rm *ReplyMarkupInt) ResultWithMessage
- func (bot TgBot) SendLocationQuery(payload SendLocationQuery) ResultWithMessage
- func (bot TgBot) SendLocationWithForceReply(cid int, latitude float64, longitude float64, rtmid *int, rm ForceReply) ResultWithMessage
- func (bot TgBot) SendLocationWithKeyboard(cid int, latitude float64, longitude float64, rtmid *int, ...) ResultWithMessage
- func (bot TgBot) SendLocationWithKeyboardHide(cid int, latitude float64, longitude float64, rtmid *int, rm ReplyKeyboardHide) ResultWithMessage
- func (bot TgBot) SendMessage(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, ...) ResultWithMessage
- func (bot TgBot) SendMessageQuery(payload QuerySendMessage) ResultWithMessage
- func (bot TgBot) SendMessageWithForceReply(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, ...) ResultWithMessage
- func (bot TgBot) SendMessageWithKeyboard(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, ...) ResultWithMessage
- func (bot TgBot) SendMessageWithKeyboardHide(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, ...) ResultWithMessage
- func (bot TgBot) SendPhoto(cid int, photo interface{}, caption *string, rmi *int, rm *ReplyMarkupInt) ResultWithMessage
- func (bot TgBot) SendPhotoQuery(payload interface{}) ResultWithMessage
- func (bot TgBot) SendPhotoWithForceReply(cid int, photo interface{}, caption *string, rmi *int, rm ForceReply) ResultWithMessage
- func (bot TgBot) SendPhotoWithKeyboard(cid int, photo interface{}, caption *string, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage
- func (bot TgBot) SendPhotoWithKeyboardHide(cid int, photo interface{}, caption *string, rmi *int, rm ReplyKeyboardHide) ResultWithMessage
- func (bot TgBot) SendSticker(cid int, sticker interface{}, rmi *int, rm *ReplyMarkupInt) ResultWithMessage
- func (bot TgBot) SendStickerQuery(payload interface{}) ResultWithMessage
- func (bot TgBot) SendStickerWithForceReply(cid int, sticker interface{}, rmi *int, rm ForceReply) ResultWithMessage
- func (bot TgBot) SendStickerWithKeyboard(cid int, sticker interface{}, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage
- func (bot TgBot) SendStickerWithKeyboardHide(cid int, sticker interface{}, rmi *int, rm ReplyKeyboardHide) ResultWithMessage
- func (bot TgBot) SendVideo(cid int, photo string, caption *string, duration *int, rmi *int, ...) ResultWithMessage
- func (bot TgBot) SendVideoQuery(payload interface{}) ResultWithMessage
- func (bot TgBot) SendVideoWithForceReply(cid int, photo string, caption *string, duration *int, rmi *int, rm ForceReply) ResultWithMessage
- func (bot TgBot) SendVideoWithKeyboard(cid int, photo string, caption *string, duration *int, rmi *int, ...) ResultWithMessage
- func (bot TgBot) SendVideoWithKeyboardHide(cid int, photo string, caption *string, duration *int, rmi *int, ...) ResultWithMessage
- func (bot TgBot) SendVoice(cid int, audio string, duration *int, rmi *int, rm *ReplyMarkupInt) ResultWithMessage
- func (bot TgBot) SendVoiceQuery(payload interface{}) ResultWithMessage
- func (bot TgBot) SendVoiceWithForceReply(cid int, audio string, duration *int, rmi *int, rm ForceReply) ResultWithMessage
- func (bot TgBot) SendVoiceWithKeyboard(cid int, audio string, duration *int, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage
- func (bot TgBot) SendVoiceWithKeyboardHide(cid int, audio string, duration *int, rmi *int, rm ReplyKeyboardHide) ResultWithMessage
- func (bot *TgBot) ServerStart(uri string, pathl string)
- func (bot *TgBot) ServerStartHostPort(uri string, pathl string, host string, port string)
- func (bot *TgBot) SetBotanToken(tok string) *TgBot
- func (bot *TgBot) SetLowerText(b bool) *TgBot
- func (bot *TgBot) SetRecoverPanic(b bool) *TgBot
- func (bot *TgBot) SetRelicConfig(tok string, name string) *TgBot
- func (bot TgBot) SetWebhook(url string) (ResultSetWebhook, error)
- func (bot TgBot) SetWebhookNoQuery(urlw string) ResultSetWebhook
- func (bot TgBot) SetWebhookQuery(url *string, cert *string) ResultSetWebhook
- func (bot TgBot) SetWebhookWithCert(url string, cert string) ResultSetWebhook
- func (bot *TgBot) SimpleCommandFn(path string, f func(TgBot, Message, string) *string) *TgBot
- func (bot *TgBot) SimpleRegexFn(path string, f func(TgBot, Message, string) *string) *TgBot
- func (bot TgBot) SimpleSendAudio(msg Message, audio string) (res Message, err error)
- func (bot TgBot) SimpleSendChatAction(msg Message, ca ChatAction)
- func (bot TgBot) SimpleSendDocument(msg Message, document string) (res Message, err error)
- func (bot TgBot) SimpleSendLocation(msg Message, latitude float64, longitude float64) (res Message, err error)
- func (bot TgBot) SimpleSendMessage(msg Message, text string) (res Message, err error)
- func (bot TgBot) SimpleSendPhoto(msg Message, photo interface{}) (res Message, err error)
- func (bot TgBot) SimpleSendSticker(msg Message, sticker interface{}) (res Message, err error)
- func (bot TgBot) SimpleSendVideo(msg Message, photo string) (res Message, err error)
- func (bot TgBot) SimpleSendVoice(msg Message, audio string) (res Message, err error)
- func (bot *TgBot) SimpleStart()
- func (bot *TgBot) Start()
- func (bot *TgBot) StartChain() *TgBot
- func (bot *TgBot) StartMainListener()
- func (bot *TgBot) StartWithMessagesChannel(ch chan MessageWithUpdateID)
- func (bot *TgBot) StickerFn(f func(TgBot, Message, Sticker, string)) *TgBot
- func (bot *TgBot) VideoFn(f func(TgBot, Message, Video, string)) *TgBot
- func (bot *TgBot) VoiceFn(f func(TgBot, Message, Voice, string)) *TgBot
- type User
- type UserGroup
- type UserPhotos
- type UserProfilePhotos
- type Video
- type VideoConditionalCall
- type Voice
- type VoiceConditionalCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartServerMultiplesBots ¶
func StartServerMultiplesBots(uri string, pathl string, newrelic *RelicConfig, bots ...*TgBot)
StartServerMultiplesBots ...
Types ¶
type Audio ¶
type Audio struct { FileID string `json:"file_id"` Duration int `json:"duration"` Performer *string `json:"performer,omitempty"` Title *string `json:"title,omitempty"` MimeType *string `json:"mime_type,omitempty"` FileSize *int `json:"file_size,omitempty"` }
Audio ...
type AudioConditionalCall ¶
type AudioConditionalCall struct {
// contains filtered or unexported fields
}
AudioConditionalCall ...
type ChainStructure ¶
type ChainStructure struct {
// contains filtered or unexported fields
}
ChainStructure ...
func (*ChainStructure) AddToConditionalFuncs ¶
func (cc *ChainStructure) AddToConditionalFuncs(cf ConditionCallStructure)
AddToConditionalFuncs ...
func (*ChainStructure) SetCancelCond ¶
func (cc *ChainStructure) SetCancelCond(c ConditionCallStructure)
SetCancelCond ...
func (*ChainStructure) UserInChain ¶
func (cc *ChainStructure) UserInChain(msg Message) bool
UserInChain ...
type ChatAction ¶
type ChatAction int
ChatAction ...
const ( Typing ChatAction = 1 + iota UploadPhoto RecordVideo UploadVideo RecordAudio UploadAudio UploadDocument FindLocation )
This is the enumerable
func (ChatAction) String ¶
func (ca ChatAction) String() string
type CommandStructure ¶
type CommandStructure interface {
// contains filtered or unexported methods
}
CommandStructure ...
type ConditionCallStructure ¶
type ConditionCallStructure interface {
// contains filtered or unexported methods
}
ConditionCallStructure ...
type Contact ¶
type Contact struct { PhoneNumber string `json:"phone_number"` FirstName string `json:"first_name"` LastName *string `json:"last_name,omitempty"` UserID *int `json:"user_id,omitempty"` }
Contact ...
type CustomCall ¶
type CustomCall struct {
// contains filtered or unexported fields
}
CustomCall ...
type DefaultOptionsBot ¶
type DefaultOptionsBot struct { DisableWebURL *bool Selective *bool OneTimeKeyboard *bool CleanInitialUsername bool AllowWithoutSlashInMention bool LowerText bool RecoverPanic bool }
DefaultOptionsBot represents the options that the bot will try to apply automatically
type DeleteChatPhotoConditionalCall ¶
type DeleteChatPhotoConditionalCall struct {
// contains filtered or unexported fields
}
DeleteChatPhotoConditionalCall ...
type Document ¶
type Document struct { FileID string `json:"file_id"` Thumb *PhotoSize `json:"thumb,omitempty"` FileName *string `json:"file_name,omitempty"` MimeType *string `json:"mime_type,omitempty"` FileSize *int `json:"file_size,omitempty"` }
Document ...
type DocumentConditionalCall ¶
type DocumentConditionalCall struct {
// contains filtered or unexported fields
}
DocumentConditionalCall ...
type ForceReply ¶
type ForceReply struct { Force bool `json:"force_reply"` // always true! Selective bool `json:"selective,omitempty"` }
ForceReply ...
func (ForceReply) ImplementReplyMarkup ¶
func (fr ForceReply) ImplementReplyMarkup()
ImplementReplyMarkup ...
type ForwardConditionalCall ¶
type ForwardConditionalCall struct {
// contains filtered or unexported fields
}
ForwardConditionalCall ...
type ForwardMessageQuery ¶
type ForwardMessageQuery struct { ChatID int `json:"chat_id"` FromChatID int `json:"from_chat_id"` MessageID int `json:"message_id"` }
ForwardMessageQuery ...
type GenericSendQuery ¶
type GenericSendQuery struct { ChatID int `json:"chat_id"` Data interface{} `json:"data"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` ReplyMarkup *ReplyMarkupInt `json:"reply_markup,omitempty"` }
GenericSendQuery ...
type GetUserProfilePhotosQuery ¶
type GetUserProfilePhotosQuery struct { UserID int `json:"user_id"` Offset *int `json:"offset,omitempty"` Limit *int `json:"limit,omitempty"` }
GetUserProfilePhotosQuery ...
type GroupChatCreatedConditionalCall ¶
type GroupChatCreatedConditionalCall struct {
// contains filtered or unexported fields
}
GroupChatCreatedConditionalCall ...
type GroupConditionalCall ¶
type GroupConditionalCall struct {
// contains filtered or unexported fields
}
GroupConditionalCall ...
type ImageConditionalCall ¶
type ImageConditionalCall struct {
// contains filtered or unexported fields
}
ImageConditionalCall ...
type LeftParticipantConditionalCall ¶
type LeftParticipantConditionalCall struct {
// contains filtered or unexported fields
}
LeftParticipantConditionalCall ...
type LocationConditionalCall ¶
type LocationConditionalCall struct {
// contains filtered or unexported fields
}
LocationConditionalCall ...
type Message ¶
type Message struct { ID int `json:"message_id"` From User `json:"from"` Date int `json:"date"` Chat UserGroup `json:"chat"` ForwardFrom *User `json:"forward_from,omitempty"` ForwardDate *int `json:"forward_date,omitempty"` ReplyToMessage *Message `json:"reply_to_message,omitempty"` Text *string `json:"text,omitempty"` Audio *Audio `json:"audio,omitempty"` Voice *Voice `json:"voice,omitempty"` Document *Document `json:"document,omitempty"` Photo *[]PhotoSize `json:"photo,omitempty"` Sticker *Sticker `json:"sticker,omitempty"` Video *Video `json:"video,omitempty"` Caption *string `json:"caption,omitempty"` Location *Location `json:"location,omitempty"` NewChatParticipant *User `json:"new_chat_participant,omitempty"` LeftChatParticipant *User `json:"left_chat_participant,omitempty"` NewChatTitle *string `json:"new_chat_title,omitempty"` NewChatPhoto *string `json:"new_chat_photo,omitempty"` DeleteChatPhoto *bool `json:"delete_chat_photo,omitempty"` GroupChatCreated *bool `json:"group_chat_created,omitempty"` }
Message ...
type MessageWithUpdateID ¶
MessageWithUpdateID ...
type MultiRegexCommand ¶
MultiRegexCommand ...
type NewParticipantConditionalCall ¶
type NewParticipantConditionalCall struct {
// contains filtered or unexported fields
}
NewParticipantConditionalCall ...
type NewPhotoConditionalCall ¶
type NewPhotoConditionalCall struct {
// contains filtered or unexported fields
}
NewPhotoConditionalCall ...
type NewTitleConditionalCall ¶
type NewTitleConditionalCall struct {
// contains filtered or unexported fields
}
NewTitleConditionalCall ...
type NoMessageCall ¶
type NoMessageCall struct {
// contains filtered or unexported fields
}
NoMessageCall ...
type ParseModeT ¶
type ParseModeT int
const (
Markdown ParseModeT = 1 + iota
)
func (ParseModeT) String ¶
func (pa ParseModeT) String() string
type PhotoSize ¶
type PhotoSize struct { FileID string `json:"file_id"` Width int `json:"width"` Height int `json:"height"` FileSize *int `json:"file_size,omitempty"` }
PhotoSize ...
type QuerySendMessage ¶
type QuerySendMessage struct { ChatID int `json:"chat_id"` Text string `json:"text"` ParseMode *string `json:"parse_mode,omitempty"` DisableWebPagePreview *bool `json:"disable_web_page_preview,omitempty"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` ReplyMarkup *ReplyMarkupInt `json:"reply_markup,omitempty"` }
QuerySendMessage ...
func (QuerySendMessage) String ¶
func (qsm QuerySendMessage) String() string
type ReaderSender ¶
type RegexCommand ¶
RegexCommand ...
type RelicConfig ¶
type RepliedConditionalCall ¶
type RepliedConditionalCall struct {
// contains filtered or unexported fields
}
RepliedConditionalCall ...
type ReplyKeyboardHide ¶
type ReplyKeyboardHide struct { HideKeyboard bool `json:"hide_keyboard"` // always true! Selective bool `json:"selective,omitempty"` }
ReplyKeyboardHide ...
func (ReplyKeyboardHide) ImplementReplyMarkup ¶
func (rkh ReplyKeyboardHide) ImplementReplyMarkup()
ImplementReplyMarkup ...
type ReplyKeyboardMarkup ¶
type ReplyKeyboardMarkup struct { Keyboard KeyboardLayout `json:"keyboard"` ResizeKeyboard bool `json:"resize_keyboard,omitempty"` // Default false OneTimeKeyboard bool `json:"one_time_keyboard,omitempty"` // Default false Selective bool `json:"selective,omitempty"` }
ReplyKeyboardMarkup ...
func (ReplyKeyboardMarkup) ImplementReplyMarkup ¶
func (rkm ReplyKeyboardMarkup) ImplementReplyMarkup()
ImplementReplyMarkup ...
type ResultBase ¶
type ResultBase struct { Ok bool `json:"ok"` ErrorCode *int `json:"error_code,omitempty"` Description *string `json:"description,omitempty"` }
ResultBase ...
type ResultGetUpdates ¶
type ResultGetUpdates struct { ResultBase Result []MessageWithUpdateID `json:"result"` }
ResultGetUpdates ...
type ResultGetUser ¶
type ResultGetUser struct { ResultBase Result User `json:"result,omitempty"` }
ResultGetUser ...
type ResultSetWebhook ¶
type ResultSetWebhook struct { Ok bool `json:"ok"` Description string `json:"description"` Result *bool `json:"result,omitempty"` ErrorCode *int `json:"error_code,omitempty"` }
ResultSetWebhook ...
type ResultWithGetFile ¶
type ResultWithGetFile struct { ResultBase Result *File `json:"result,omitempty"` }
type ResultWithMessage ¶
type ResultWithMessage struct { ResultBase Result *Message `json:"result,omitempty"` }
ResultWithMessage ...
type ResultWithUserProfilePhotos ¶
type ResultWithUserProfilePhotos struct { ResultBase Result *UserProfilePhotos `json:"result,omitempty"` }
ResultWithUserProfilePhotos ...
type Send ¶
Send general construct to generate send actions
func (*Send) Action ¶
func (s *Send) Action(action ChatAction) *SendChatAction
Action return a SendAction instance to chain actions easy
func (*Send) Document ¶
func (s *Send) Document(doc interface{}) *SendDocument
Document return a SendDocument instance to chain actions easy
func (*Send) Forward ¶
func (s *Send) Forward(to int, msg int) *SendForward
Forward return a SendForward instance to chain actions easy
func (*Send) Location ¶
func (s *Send) Location(latitude float64, long float64) *SendLocation
Location return a SendLocation instance to chain actions easy
func (*Send) Sticker ¶
func (s *Send) Sticker(stick interface{}) *SendSticker
Sticker return a SendSticker instance to chain actions easy
type SendAudio ¶
type SendAudio struct { Send *Send Audio string DurationField *int PerformerField *string TitleField *string ReplyToMessageID *int ReplyMarkup *ReplyMarkupInt }
SendAudio ...
func (*SendAudio) ForceReply ¶
func (sp *SendAudio) ForceReply(fr ForceReply) *SendAudio
ForceReply ...
func (*SendAudio) Keyboard ¶
func (sp *SendAudio) Keyboard(kb ReplyKeyboardMarkup) *SendAudio
Keyboard ...
func (*SendAudio) KeyboardHide ¶
func (sp *SendAudio) KeyboardHide(kb ReplyKeyboardHide) *SendAudio
KeyboardHide ...
func (*SendAudio) ReplyToMessage ¶
ReplyToMessage ...
type SendAudioIDQuery ¶
type SendAudioIDQuery struct { ChatID int `json:"chat_id"` Audio string `json:"audio"` Duration *int `json:"duration,omitempty"` Performer *string `json:"performer,omitempty"` Title *string `json:"title,omitempty"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` ReplyMarkup *ReplyMarkupInt `json:"reply_markup,omitempty"` }
SendAudioIDQuery ...
type SendAudioPathQuery ¶
type SendAudioPathQuery struct { ChatID int `json:"chat_id"` Audio string `json:"audio"` Duration *int `json:"duration,omitempty"` Performer *string `json:"performer,omitempty"` Title *string `json:"title,omitempty"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` ReplyMarkup *ReplyMarkupInt `json:"reply_markup,omitempty"` }
SendAudioPathQuery ...
type SendChatAction ¶
type SendChatAction struct { Send *Send Action ChatAction }
SendChatAction ...
func (*SendChatAction) SetAction ¶
func (sca *SendChatAction) SetAction(act ChatAction) *SendChatAction
SetAction ...
type SendChatActionQuery ¶
SendChatActionQuery ...
type SendDocument ¶
type SendDocument struct { Send *Send Document interface{} ReplyToMessageID *int ReplyMarkup *ReplyMarkupInt }
SendDocument ...
func (*SendDocument) ForceReply ¶
func (sp *SendDocument) ForceReply(fr ForceReply) *SendDocument
ForceReply ...
func (*SendDocument) Keyboard ¶
func (sp *SendDocument) Keyboard(kb ReplyKeyboardMarkup) *SendDocument
Keyboard ...
func (*SendDocument) KeyboardHide ¶
func (sp *SendDocument) KeyboardHide(kb ReplyKeyboardHide) *SendDocument
KeyboardHide ...
func (*SendDocument) ReplyToMessage ¶
func (sp *SendDocument) ReplyToMessage(rm int) *SendDocument
ReplyToMessage ...
type SendDocumentIDQuery ¶
type SendDocumentIDQuery struct { ChatID int `json:"chat_id"` Document string `json:"document"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` ReplyMarkup *ReplyMarkupInt `json:"reply_markup,omitempty"` }
SendDocumentIDQuery ...
type SendDocumentPathQuery ¶
type SendDocumentPathQuery struct { ChatID int `json:"chat_id"` Document string `json:"document"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` ReplyMarkup *ReplyMarkupInt `json:"reply_markup,omitempty"` }
SendDocumentPathQuery ...
type SendForward ¶
type SendForward struct { Send *Send // contains filtered or unexported fields }
SendForward ...
type SendGetFile ¶
SendGetFile ...
func (SendGetFile) End ¶
func (sgf SendGetFile) End()
func (SendGetFile) ToPath ¶
func (self SendGetFile) ToPath(path string) error
func (SendGetFile) ToReader ¶
func (self SendGetFile) ToReader() (io.ReadCloser, error)
type SendLocation ¶
type SendLocation struct { Send *Send Latitude float64 Longitude float64 ReplyToMessageID *int ReplyMarkup *ReplyMarkupInt }
SendLocation ...
func (*SendLocation) ForceReply ¶
func (sp *SendLocation) ForceReply(fr ForceReply) *SendLocation
ForceReply ...
func (*SendLocation) Keyboard ¶
func (sp *SendLocation) Keyboard(kb ReplyKeyboardMarkup) *SendLocation
Keyboard ...
func (*SendLocation) KeyboardHide ¶
func (sp *SendLocation) KeyboardHide(kb ReplyKeyboardHide) *SendLocation
KeyboardHide ...
func (*SendLocation) ReplyToMessage ¶
func (sp *SendLocation) ReplyToMessage(rm int) *SendLocation
ReplyToMessage ...
func (*SendLocation) SetLatitude ¶
func (sp *SendLocation) SetLatitude(lat float64) *SendLocation
SetLatitude ...
func (*SendLocation) SetLongitude ¶
func (sp *SendLocation) SetLongitude(long float64) *SendLocation
SetLongitude ...
type SendLocationQuery ¶
type SendLocationQuery struct { ChatID int `json:"chat_id"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` ReplyMarkup *ReplyMarkupInt `json:"reply_markup,omitempty"` }
SendLocationQuery ...
type SendPhoto ¶
type SendPhoto struct { Send *Send Photo interface{} CaptionField *string ReplyToMessageID *int ReplyMarkup *ReplyMarkupInt }
SendPhoto ...
func (*SendPhoto) ForceReply ¶
func (sp *SendPhoto) ForceReply(fr ForceReply) *SendPhoto
ForceReply ...
func (*SendPhoto) Keyboard ¶
func (sp *SendPhoto) Keyboard(kb ReplyKeyboardMarkup) *SendPhoto
Keyboard ...
func (*SendPhoto) KeyboardHide ¶
func (sp *SendPhoto) KeyboardHide(kb ReplyKeyboardHide) *SendPhoto
KeyboardHide ...
func (*SendPhoto) ReplyToMessage ¶
ReplyToMessage ...
type SendPhotoIDQuery ¶
type SendPhotoIDQuery struct { ChatID int `json:"chat_id"` Photo string `json:"photo"` Caption *string `json:"caption,omitempty"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` ReplyMarkup *ReplyMarkupInt `json:"reply_markup,omitempty"` }
SendPhotoIDQuery ...
type SendPhotoPathQuery ¶
type SendPhotoPathQuery struct { ChatID int `json:"chat_id"` Photo string `json:"photo"` Caption *string `json:"caption,omitempty"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` ReplyMarkup *ReplyMarkupInt `json:"reply_markup,omitempty"` }
SendPhotoPathQuery ...
type SendSticker ¶
type SendSticker struct { Send *Send Sticker interface{} ReplyToMessageID *int ReplyMarkup *ReplyMarkupInt }
SendSticker ...
func (*SendSticker) ForceReply ¶
func (sp *SendSticker) ForceReply(fr ForceReply) *SendSticker
ForceReply ...
func (*SendSticker) Keyboard ¶
func (sp *SendSticker) Keyboard(kb ReplyKeyboardMarkup) *SendSticker
Keyboard ...
func (*SendSticker) KeyboardHide ¶
func (sp *SendSticker) KeyboardHide(kb ReplyKeyboardHide) *SendSticker
KeyboardHide ...
func (*SendSticker) ReplyToMessage ¶
func (sp *SendSticker) ReplyToMessage(rm int) *SendSticker
ReplyToMessage ...
type SendStickerIDQuery ¶
type SendStickerIDQuery struct { ChatID int `json:"chat_id"` Sticker string `json:"sticker"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` ReplyMarkup *ReplyMarkupInt `json:"reply_markup,omitempty"` }
SendStickerIDQuery ...
type SendStickerPathQuery ¶
type SendStickerPathQuery struct { ChatID int `json:"chat_id"` Sticker string `json:"sticker"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` ReplyMarkup *ReplyMarkupInt `json:"reply_markup,omitempty"` }
SendStickerPathQuery ...
type SendText ¶
type SendText struct { Send *Send Text string ParseModeS *ParseModeT DisableWebPagePreview *bool ReplyToMessageID *int ReplyMarkup *ReplyMarkupInt }
SendText ...
func (*SendText) DisablePreview ¶
DisablePreview ...
func (*SendText) ForceReply ¶
func (sp *SendText) ForceReply(fr ForceReply) *SendText
ForceReply ...
func (*SendText) Keyboard ¶
func (sp *SendText) Keyboard(kb ReplyKeyboardMarkup) *SendText
Keyboard ...
func (*SendText) KeyboardHide ¶
func (sp *SendText) KeyboardHide(kb ReplyKeyboardHide) *SendText
KeyboardHide ...
func (*SendText) ParseMode ¶
func (sp *SendText) ParseMode(pm ParseModeT) *SendText
func (*SendText) ReplyToMessage ¶
ReplyToMessage ...
type SendVideo ¶
type SendVideo struct { Send *Send Video string CaptionField *string DurationField *int ReplyToMessageID *int ReplyMarkup *ReplyMarkupInt }
SendVideo ...
func (*SendVideo) ForceReply ¶
func (sp *SendVideo) ForceReply(fr ForceReply) *SendVideo
ForceReply ...
func (*SendVideo) Keyboard ¶
func (sp *SendVideo) Keyboard(kb ReplyKeyboardMarkup) *SendVideo
Keyboard ...
func (*SendVideo) KeyboardHide ¶
func (sp *SendVideo) KeyboardHide(kb ReplyKeyboardHide) *SendVideo
KeyboardHide ...
func (*SendVideo) ReplyToMessage ¶
ReplyToMessage ...
type SendVideoIDQuery ¶
type SendVideoIDQuery struct { ChatID int `json:"chat_id"` Video string `json:"video"` Duration *int `json:"duration,omitempty"` Caption *string `json:"caption,omitempty"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` ReplyMarkup *ReplyMarkupInt `json:"reply_markup,omitempty"` }
SendVideoIDQuery ...
type SendVideoPathQuery ¶
type SendVideoPathQuery struct { ChatID int `json:"chat_id"` Video string `json:"video"` Duration *int `json:"duration,omitempty"` Caption *string `json:"caption,omitempty"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` ReplyMarkup *ReplyMarkupInt `json:"reply_markup,omitempty"` }
SendVideoPathQuery ...
type SendVoice ¶
type SendVoice struct { Send *Send Voice string DurationField *int ReplyToMessageID *int ReplyMarkup *ReplyMarkupInt }
SendVoice ...
func (*SendVoice) ForceReply ¶
func (sp *SendVoice) ForceReply(fr ForceReply) *SendVoice
ForceReply ...
func (*SendVoice) Keyboard ¶
func (sp *SendVoice) Keyboard(kb ReplyKeyboardMarkup) *SendVoice
Keyboard ...
func (*SendVoice) KeyboardHide ¶
func (sp *SendVoice) KeyboardHide(kb ReplyKeyboardHide) *SendVoice
KeyboardHide ...
func (*SendVoice) ReplyToMessage ¶
ReplyToMessage ...
type SendVoiceIDQuery ¶
type SendVoiceIDQuery struct { ChatID int `json:"chat_id"` Voice string `json:"voice"` Duration *int `json:"duration,omitempty"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` ReplyMarkup *ReplyMarkupInt `json:"reply_markup,omitempty"` }
SendVoiceIDQuery ...
type SendVoicePathQuery ¶
type SendVoicePathQuery struct { ChatID int `json:"chat_id"` Voice string `json:"voice"` Duration *int `json:"duration,omitempty"` ReplyToMessageID *int `json:"reply_to_message_id,omitempty"` ReplyMarkup *ReplyMarkupInt `json:"reply_markup,omitempty"` }
SendVoicePathQuery ...
type SetWebhookCertQuery ¶
type SetWebhookCertQuery struct { URL string `json:"url,omitempty"` Certificate string `json:"certificate,omitempty"` }
SetWebhookCertQuery ...
type SetWebhookQuery ¶
type SetWebhookQuery struct {
URL *string `json:"url,omitempty"`
}
SetWebhookQuery ...
type SimpleCommandFuncStruct ¶
type SimpleCommandFuncStruct struct {
// contains filtered or unexported fields
}
SimpleCommandFuncStruct struct wrapper for simple command funcs
func (SimpleCommandFuncStruct) CallSimpleCommandFunc ¶
func (scf SimpleCommandFuncStruct) CallSimpleCommandFunc(bot TgBot, msg Message, m []string, km map[string]string) *string
CallSimpleCommandFunc wrapper for simple functions
type Sticker ¶
type Sticker struct { FileID string `json:"file_id"` Width int `json:"width"` Height int `json:"height"` Thumb *PhotoSize `json:"thumb,omitempty"` // .webp or .jpg format FileSize *int `json:"file_size,omitempty"` }
Sticker ...
type StickerConditionalCall ¶
type StickerConditionalCall struct {
// contains filtered or unexported fields
}
StickerConditionalCall ...
type TextConditionalCall ¶
type TextConditionalCall struct {
// contains filtered or unexported fields
}
TextConditionalCall ...
type TgBot ¶
type TgBot struct { Token string FirstName string ID int Username string BaseRequestURL string BaseFileRequestURL string RelicCfg *RelicConfig BotanIO *botan.Botan MainListener chan MessageWithUpdateID LastUpdateID int64 TestConditionalFuncs []ConditionCallStructure NoMessageFuncs []NoMessageCall ChainConditionals []*ChainStructure BuildingChain bool DefaultOptions DefaultOptionsBot }
TgBot basic bot struct that handle all the interaction functions.
func New ¶
New creates an instance of a new bot with the token supplied, if it's invalid this method fail with a panic.
func NewTgBot ¶
NewTgBot creates an instance of a new bot with the token supplied, if it's invalid this method fail with a panic.
func NewWithError ¶
NewWithError creates an instance and return possible error
func (*TgBot) AddMainListener ¶
func (bot *TgBot) AddMainListener(list chan MessageWithUpdateID)
AddMainListener add the channel as the main listener, this will be called with the messages received.
func (*TgBot) Answer ¶
Answer start a Send petition answering the message. See Send* structs (SendPhoto, SendText, ...)
func (*TgBot) CancelChainCommand ¶
CancelChainCommand add a special command that cancel the current chain
func (*TgBot) CommandFn ¶
func (bot *TgBot) CommandFn(path string, f func(TgBot, Message, []string, map[string]string) *string) *TgBot
CommandFn Add a command function, with capture groups and/or named capture groups.
func (*TgBot) DefaultAllowWithoutSlashInMention ¶
DefaultAllowWithoutSlashInMention ...
func (*TgBot) DefaultCleanInitialUsername ¶
DefaultCleanInitialUsername ...
func (*TgBot) DefaultDisableWebpagePreview ¶
DefaultDisableWebpagePreview ...
func (*TgBot) DefaultOneTimeKeyboard ¶
DefaultOneTimeKeyboard ...
func (*TgBot) DefaultSelective ¶
DefaultSelective ...
func (*TgBot) DeleteChatPhotoFn ¶
DeleteChatPhotoFn add a function to be called when the photo of a chat is deleted.
func (*TgBot) DocumentFn ¶
DocumentFn add a function to be called when a document arrives.
func (TgBot) DownloadFilePathReader ¶
func (bot TgBot) DownloadFilePathReader(path string) (io.ReadCloser, error)
func (*TgBot) EndChain ¶
EndChain ends the chain, after this, the functions will be added as always.
func (*TgBot) File ¶
func (bot *TgBot) File(id string) *SendGetFile
func (*TgBot) ForwardFn ¶
ForwardFn add a function to be called when a message forwarding other arrives.
func (TgBot) ForwardMessage ¶
func (bot TgBot) ForwardMessage(cid int, fid int, mid int) ResultWithMessage
ForwardMessage full function wrapper for forwardMessage
func (TgBot) ForwardMessageQuery ¶
func (bot TgBot) ForwardMessageQuery(payload ForwardMessageQuery) ResultWithMessage
ForwardMessageQuery full forwardMessage call
func (TgBot) GetFile ¶
func (bot TgBot) GetFile(id string) ResultWithGetFile
func (*TgBot) GetMessageChannel ¶
func (bot *TgBot) GetMessageChannel() chan MessageWithUpdateID
GetMessageChannel create a channel and start the default messages handler, you can use this to build your own server listener (just send the MessageWithUpdateID to that channel)
func (TgBot) GetUpdates ¶
func (bot TgBot) GetUpdates() ([]MessageWithUpdateID, error)
GetUpdates call getUpdates
func (TgBot) GetUserProfilePhotos ¶
func (bot TgBot) GetUserProfilePhotos(uid int, args ...int) UserProfilePhotos
GetUserProfilePhotos args will use only the two first parameters, the first one will be the limit of images to get, and the second will be the offset photo id.
func (TgBot) GetUserProfilePhotosQuery ¶
func (bot TgBot) GetUserProfilePhotosQuery(quer GetUserProfilePhotosQuery) ResultWithUserProfilePhotos
GetUserProfilePhotosQuery raw method that uses the struct to send the petition.
func (*TgBot) GroupChatCreatedFn ¶
GroupChatCreatedFn add a function to be called when a group chat is created.
func (TgBot) HandleBotan ¶
func (*TgBot) LeftParticipantFn ¶
LeftParticipantFn add a function to be called when a participant left.
func (*TgBot) LocationFn ¶
LocationFn add a function to be called when a location arrives.
func (TgBot) MessagesHandler ¶
func (bot TgBot) MessagesHandler(Incoming <-chan MessageWithUpdateID)
MessagesHandler is the default listener, just listen for a channel and call the default message processor
func (*TgBot) MultiCommandFn ¶
func (bot *TgBot) MultiCommandFn(paths []string, f func(TgBot, Message, []string, map[string]string) *string) *TgBot
MultiCommandFn add multiples commands with capture groups. Only one of this will be executed.
func (*TgBot) MultiRegexFn ¶
func (bot *TgBot) MultiRegexFn(paths []string, f func(TgBot, Message, []string, map[string]string) *string) *TgBot
MultiRegexFn add multiples regular expressions with capture groups. Only one will be executed.
func (*TgBot) NewParticipantFn ¶
NewParticipantFn add a function to be called when new participant is received.
func (*TgBot) NewPhotoChatFn ¶
NewPhotoChatFn add a function to be called when the photo of a chat is changed.
func (*TgBot) NewTitleChatFn ¶
NewTitleChatFn add a function to be called when the title of a group is changed.
func (TgBot) ProcessAllMsg ¶
ProcessAllMsg default message handler that take care of clean the messages, the chains and the action functions.
func (*TgBot) ProcessMessages ¶
func (bot *TgBot) ProcessMessages(messages []MessageWithUpdateID)
ProcessMessages will take care about the highest message ID to get updates in the right way. This will call the MainListener channel with a MessageWithUpdateID
func (*TgBot) RegexFn ¶
func (bot *TgBot) RegexFn(path string, f func(TgBot, Message, []string, map[string]string) *string) *TgBot
RegexFn add a regular expression function with capture groups and/or named capture groups.
func (*TgBot) ReplyFn ¶
ReplyFn add a function to be called when a message replied other is arrives.
func (*TgBot) Send ¶
Send start a Send petition to the user/chat cid. See Send* structs (SendPhoto, SendVideo, ...)
func (TgBot) SendAudio ¶
func (bot TgBot) SendAudio(cid int, audio string, duration *int, performer *string, title *string, rmi *int, rm *ReplyMarkupInt) ResultWithMessage
SendAudio full function to send an audio. Uses the reply markup interface.
func (TgBot) SendAudioQuery ¶
func (bot TgBot) SendAudioQuery(payload interface{}) ResultWithMessage
SendAudioQuery full function using the query.
func (TgBot) SendAudioWithForceReply ¶
func (bot TgBot) SendAudioWithForceReply(cid int, audio string, duration *int, performer *string, title *string, rmi *int, rm ForceReply) ResultWithMessage
SendAudioWithForceReply send a audio with explicit Force Reply.
func (TgBot) SendAudioWithKeyboard ¶
func (bot TgBot) SendAudioWithKeyboard(cid int, audio string, duration *int, performer *string, title *string, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage
SendAudioWithKeyboard send a audio with explicit Keyboard
func (TgBot) SendAudioWithKeyboardHide ¶
func (bot TgBot) SendAudioWithKeyboardHide(cid int, audio string, duration *int, performer *string, title *string, rmi *int, rm ReplyKeyboardHide) ResultWithMessage
SendAudioWithKeyboardHide send a audio with explicit Keyboard Hide.
func (TgBot) SendChatAction ¶
func (bot TgBot) SendChatAction(cid int, ca ChatAction)
SendChatAction send an action to an id.
func (TgBot) SendChatActionQuery ¶
func (bot TgBot) SendChatActionQuery(payload SendChatActionQuery)
SendChatActionQuery send an action query.
func (TgBot) SendDocument ¶
func (bot TgBot) SendDocument(cid int, document interface{}, rmi *int, rm *ReplyMarkupInt) ResultWithMessage
SendDocument full function to send document, uses the reply markup interface.
func (TgBot) SendDocumentQuery ¶
func (bot TgBot) SendDocumentQuery(payload interface{}) ResultWithMessage
SendDocumentQuery full function using the query.
func (TgBot) SendDocumentWithForceReply ¶
func (bot TgBot) SendDocumentWithForceReply(cid int, document string, rmi *int, rm ForceReply) ResultWithMessage
SendDocumentWithForceReply send a document with explicit force reply
func (TgBot) SendDocumentWithKeyboard ¶
func (bot TgBot) SendDocumentWithKeyboard(cid int, document string, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage
SendDocumentWithKeyboard send a document with explicit keyboard.
func (TgBot) SendDocumentWithKeyboardHide ¶
func (bot TgBot) SendDocumentWithKeyboardHide(cid int, document string, rmi *int, rm ReplyKeyboardHide) ResultWithMessage
SendDocumentWithKeyboardHide send a document with explicit keyboard hide.
func (TgBot) SendLocation ¶
func (bot TgBot) SendLocation(cid int, latitude float64, longitude float64, rtmid *int, rm *ReplyMarkupInt) ResultWithMessage
SendLocation full function wrapper for sendLocation
func (TgBot) SendLocationQuery ¶
func (bot TgBot) SendLocationQuery(payload SendLocationQuery) ResultWithMessage
SendLocationQuery full sendLocation call with query.
func (TgBot) SendLocationWithForceReply ¶
func (bot TgBot) SendLocationWithForceReply(cid int, latitude float64, longitude float64, rtmid *int, rm ForceReply) ResultWithMessage
SendLocationWithForceReply send a location with explicit force reply.
func (TgBot) SendLocationWithKeyboard ¶
func (bot TgBot) SendLocationWithKeyboard(cid int, latitude float64, longitude float64, rtmid *int, rm ReplyKeyboardMarkup) ResultWithMessage
SendLocationWithKeyboard send a location with explicit keyboard.
func (TgBot) SendLocationWithKeyboardHide ¶
func (bot TgBot) SendLocationWithKeyboardHide(cid int, latitude float64, longitude float64, rtmid *int, rm ReplyKeyboardHide) ResultWithMessage
SendLocationWithKeyboardHide send a location with explicit keyboard hide.
func (TgBot) SendMessage ¶
func (bot TgBot) SendMessage(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, rm *ReplyMarkupInt) ResultWithMessage
SendMessage full function wrapper for sendMessage, uses the markup interface
func (TgBot) SendMessageQuery ¶
func (bot TgBot) SendMessageQuery(payload QuerySendMessage) ResultWithMessage
SendMessageQuery full sendMessage with the query.
func (TgBot) SendMessageWithForceReply ¶
func (bot TgBot) SendMessageWithForceReply(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, rm ForceReply) ResultWithMessage
SendMessageWithForceReply send a message with explicit Force Reply.
func (TgBot) SendMessageWithKeyboard ¶
func (bot TgBot) SendMessageWithKeyboard(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, rm ReplyKeyboardMarkup) ResultWithMessage
SendMessageWithKeyboard send a message with explicit Keyboard
func (TgBot) SendMessageWithKeyboardHide ¶
func (bot TgBot) SendMessageWithKeyboardHide(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, rm ReplyKeyboardHide) ResultWithMessage
SendMessageWithKeyboardHide send a message with explicit Keyboard Hide.
func (TgBot) SendPhoto ¶
func (bot TgBot) SendPhoto(cid int, photo interface{}, caption *string, rmi *int, rm *ReplyMarkupInt) ResultWithMessage
SendPhoto full function wrapper for sendPhoto, use the markup interface.
func (TgBot) SendPhotoQuery ¶
func (bot TgBot) SendPhotoQuery(payload interface{}) ResultWithMessage
SendPhotoQuery full function that uses the query.
func (TgBot) SendPhotoWithForceReply ¶
func (bot TgBot) SendPhotoWithForceReply(cid int, photo interface{}, caption *string, rmi *int, rm ForceReply) ResultWithMessage
SendPhotoWithForceReply send a photo with explicit Force Reply.
func (TgBot) SendPhotoWithKeyboard ¶
func (bot TgBot) SendPhotoWithKeyboard(cid int, photo interface{}, caption *string, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage
SendPhotoWithKeyboard send a photo with explicit Keyboard
func (TgBot) SendPhotoWithKeyboardHide ¶
func (bot TgBot) SendPhotoWithKeyboardHide(cid int, photo interface{}, caption *string, rmi *int, rm ReplyKeyboardHide) ResultWithMessage
SendPhotoWithKeyboardHide send a photo with explicit Keyboard Hide.
func (TgBot) SendSticker ¶
func (bot TgBot) SendSticker(cid int, sticker interface{}, rmi *int, rm *ReplyMarkupInt) ResultWithMessage
SendSticker full function to send a sticker, uses reply markup interface.
func (TgBot) SendStickerQuery ¶
func (bot TgBot) SendStickerQuery(payload interface{}) ResultWithMessage
SendStickerQuery full function to send an sticker, uses the query.
func (TgBot) SendStickerWithForceReply ¶
func (bot TgBot) SendStickerWithForceReply(cid int, sticker interface{}, rmi *int, rm ForceReply) ResultWithMessage
SendStickerWithForceReply send a sticker with explicit force reply.
func (TgBot) SendStickerWithKeyboard ¶
func (bot TgBot) SendStickerWithKeyboard(cid int, sticker interface{}, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage
SendStickerWithKeyboard send a sticker with explicit keyboard.
func (TgBot) SendStickerWithKeyboardHide ¶
func (bot TgBot) SendStickerWithKeyboardHide(cid int, sticker interface{}, rmi *int, rm ReplyKeyboardHide) ResultWithMessage
SendStickerWithKeyboardHide send a sticker with explicit keyboad hide.
func (TgBot) SendVideo ¶
func (bot TgBot) SendVideo(cid int, photo string, caption *string, duration *int, rmi *int, rm *ReplyMarkupInt) ResultWithMessage
SendVideo full function to send a video.
func (TgBot) SendVideoQuery ¶
func (bot TgBot) SendVideoQuery(payload interface{}) ResultWithMessage
SendVideoQuery full function to send video with query.
func (TgBot) SendVideoWithForceReply ¶
func (bot TgBot) SendVideoWithForceReply(cid int, photo string, caption *string, duration *int, rmi *int, rm ForceReply) ResultWithMessage
SendVideoWithForceReply send a video with explicit force reply.
func (TgBot) SendVideoWithKeyboard ¶
func (bot TgBot) SendVideoWithKeyboard(cid int, photo string, caption *string, duration *int, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage
SendVideoWithKeyboard send a video with explicit keyboard.
func (TgBot) SendVideoWithKeyboardHide ¶
func (bot TgBot) SendVideoWithKeyboardHide(cid int, photo string, caption *string, duration *int, rmi *int, rm ReplyKeyboardHide) ResultWithMessage
SendVideoWithKeyboardHide send a video with explici keyboard hide.
func (TgBot) SendVoice ¶
func (bot TgBot) SendVoice(cid int, audio string, duration *int, rmi *int, rm *ReplyMarkupInt) ResultWithMessage
SendVoice full function to send an audio. Uses the reply markup interface.
func (TgBot) SendVoiceQuery ¶
func (bot TgBot) SendVoiceQuery(payload interface{}) ResultWithMessage
SendVoiceQuery full function using the query.
func (TgBot) SendVoiceWithForceReply ¶
func (bot TgBot) SendVoiceWithForceReply(cid int, audio string, duration *int, rmi *int, rm ForceReply) ResultWithMessage
SendVoiceWithForceReply send a audio with explicit Force Reply.
func (TgBot) SendVoiceWithKeyboard ¶
func (bot TgBot) SendVoiceWithKeyboard(cid int, audio string, duration *int, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage
SendVoiceWithKeyboard send a audio with explicit Keyboard
func (TgBot) SendVoiceWithKeyboardHide ¶
func (bot TgBot) SendVoiceWithKeyboardHide(cid int, audio string, duration *int, rmi *int, rm ReplyKeyboardHide) ResultWithMessage
SendVoiceWithKeyboardHide send a audio with explicit Keyboard Hide.
func (*TgBot) ServerStart ¶
ServerStart starts a server that listen for updates, if uri parameter is not empty string, it will try to set the proper webhook The default server uses Martini classic, and listen in POST /<pathl>/token (The token without the :) To listen it runs the Martini.Run() method, that get $HOST and $PORT from the environment, or uses locashost/3000 if not setted.
func (*TgBot) ServerStartHostPort ¶
func (*TgBot) SetBotanToken ¶
func (*TgBot) SetLowerText ¶
func (*TgBot) SetRecoverPanic ¶
func (TgBot) SetWebhook ¶
func (bot TgBot) SetWebhook(url string) (ResultSetWebhook, error)
SetWebhook call the setWebhook API method with the URL suplied, will return the result or an error (the error will be sended if the webhook can't be setted)
func (TgBot) SetWebhookNoQuery ¶
func (bot TgBot) SetWebhookNoQuery(urlw string) ResultSetWebhook
SetWebhookNoQuery ...
func (TgBot) SetWebhookQuery ¶
func (bot TgBot) SetWebhookQuery(url *string, cert *string) ResultSetWebhook
SetWebhookQuery raw method that uses the struct to send the petition.
func (TgBot) SetWebhookWithCert ¶
func (bot TgBot) SetWebhookWithCert(url string, cert string) ResultSetWebhook
SetWebhookWithCert ...
func (*TgBot) SimpleCommandFn ¶
SimpleCommandFn Add a simple command function.
func (*TgBot) SimpleRegexFn ¶
SimpleRegexFn add a simple regular expression function.
func (TgBot) SimpleSendAudio ¶
SimpleSendAudio send just an audio
func (TgBot) SimpleSendChatAction ¶
func (bot TgBot) SimpleSendChatAction(msg Message, ca ChatAction)
SimpleSendChatAction just send an action answering a message.
func (TgBot) SimpleSendDocument ¶
SimpleSendDocument send just a document.
func (TgBot) SimpleSendLocation ¶
func (bot TgBot) SimpleSendLocation(msg Message, latitude float64, longitude float64) (res Message, err error)
SimpleSendLocation just send a location.
func (TgBot) SimpleSendMessage ¶
SimpleSendMessage send a simple text message.
func (TgBot) SimpleSendPhoto ¶
SimpleSendPhoto send just a photo.
func (TgBot) SimpleSendSticker ¶
SimpleSendSticker just send a sticker!!
func (TgBot) SimpleSendVideo ¶
SimpleSendVideo just send a video from file path or id
func (TgBot) SimpleSendVoice ¶
SimpleSendVoice send just an audio
func (*TgBot) SimpleStart ¶
func (bot *TgBot) SimpleStart()
SimpleStart will start to get updates with the default listener and callbacks (with long-polling getUpdates way)
func (*TgBot) Start ¶
func (bot *TgBot) Start()
Start will start the main process (that use the MainListener channel), it uses getUpdates with longs-polling way and handle the ID
func (*TgBot) StartChain ¶
StartChain will start a chain process, all the functions you add after this will be part of the same chain.
func (*TgBot) StartMainListener ¶
func (bot *TgBot) StartMainListener()
StartMainListener will run a start a new channel and start the default message handler, assigning it to the main listener.
func (*TgBot) StartWithMessagesChannel ¶
func (bot *TgBot) StartWithMessagesChannel(ch chan MessageWithUpdateID)
StartWithMessagesChannel will start to get updates with your own channel that handle the messages (with long-polling getUpdates way)
type User ¶
type User struct { ID int `json:"id"` FirstName string `json:"first_name"` LastName *string `json:"last_name,omitempty"` Username *string `json:"username,omitempty"` }
User ...
type UserGroup ¶
type UserGroup struct { ID int `json:"id"` FirstName *string `json:"first_name,omitempty"` LastName *string `json:"last_name,omitempty"` Username *string `json:"username,omitempty"` Title *string `json:"title,omitempty"` }
UserGroup ..
type UserProfilePhotos ¶
type UserProfilePhotos struct { TotalCount int `json:"total_count"` Photos UserPhotos `json:"photos"` }
UserProfilePhotos ...
type Video ¶
type Video struct { FileID string `json:"file_id"` Width int `json:"width"` Height int `json:"height"` Duration int `json:"duration"` Thumb *PhotoSize `json:"thumb,omitempty"` MimeType *string `json:"mime_type,omitempty"` FileSize *int `json:"file_size,omitempty"` }
Video ...
type VideoConditionalCall ¶
type VideoConditionalCall struct {
// contains filtered or unexported fields
}
VideoConditionalCall ...
type Voice ¶
type Voice struct { FileID string `json:"file_id"` Duration int `json:"duration"` MimeType *string `json:"mime_type,omitempty"` FileSize *int `json:"file_size,omitempty"` }
Voice ...
type VoiceConditionalCall ¶
type VoiceConditionalCall struct {
// contains filtered or unexported fields
}
VoiceConditionalCall ...