Documentation ¶
Index ¶
- type Telegram
- func (t *Telegram) AnswerCallbackQuery(id string, options ...method.AnswerCallbackQueryOption) (bool, error)
- func (t *Telegram) DeleteChatPhoto(chatID int64) (bool, error)
- func (t *Telegram) DeleteChatStickerSet(chatID int64) (bool, error)
- func (t *Telegram) DeleteMessage(chatID int64, messageID int) (bool, error)
- func (t *Telegram) EditMessageCaption(messageID *args.MessageID, caption args.TextData, ...) (*types.Message, error)
- func (t *Telegram) EditMessageMedia(messageID *args.MessageID, media args.InputMediaConfig, ...) (*types.Message, error)
- func (t *Telegram) EditMessageReplyMarkup(messageID *args.MessageID, kb keyboard.Keyboard) (*types.Message, error)
- func (t *Telegram) EditMessageText(messageID *args.MessageID, text args.TextData, ...) (*types.Message, error)
- func (t *Telegram) ExportChatInviteLink(chatID int64) (string, error)
- func (t *Telegram) ForwardMessage(chatID, fromChatID, messageID int, options ...method.ForwardMessageOption) (types.Message, error)
- func (t *Telegram) GetChat(chatID int64) (types.Chat, error)
- func (t *Telegram) GetChatAdministrators(chatID int64) (types.ChatMember, error)
- func (t *Telegram) GetChatMember(chatID int64, userID int) (types.ChatMember, error)
- func (t *Telegram) GetChatMembersCount(chatID int64) (int, error)
- func (t *Telegram) GetFile(fileID string) (types.File, error)
- func (t *Telegram) GetMe() (types.User, error)
- func (t *Telegram) GetUpdates(options ...method.GetUpdatesOption) ([]types.Update, error)
- func (t *Telegram) GetUserProfilePhotos(userID int, options ...method.GetUserProfilePhotosOption) (types.UserProfilePhotos, error)
- func (t *Telegram) KickChatMember(userID int, chatID int64, options ...method.KickChatMemberOption) (bool, error)
- func (t *Telegram) LeaveChat(chatID int64) (bool, error)
- func (t *Telegram) PinChatMessage(chatID int64, messageID int, options ...method.PinChatMessageOption) (bool, error)
- func (t *Telegram) PromoteChatMember(userID int, chatID int64, options ...method.PromoteChatMemberOption) (bool, error)
- func (t *Telegram) RestrictChatMember(userID int, chatID int64, options ...method.RestrictChatMemberOption) (bool, error)
- func (t *Telegram) SendAnimation(chatID int64, animation *args.AnimationConfig, ...) (types.Message, error)
- func (t *Telegram) SendAudio(chatID int64, audio *args.AudioConfig, options ...method.SendAudioOption) (types.Message, error)
- func (t *Telegram) SendChatAction(chatID int64, action types.ChatAction) (types.Message, error)
- func (t *Telegram) SendContact(chatID int64, contact types.Contact, options ...method.SendContactOption) (types.Message, error)
- func (t *Telegram) SendDocument(chatID int64, document *args.DocumentConfig, ...) (types.Message, error)
- func (t *Telegram) SendLocation(chatID int64, location types.Location, options ...method.SendLocationOption) (types.Message, error)
- func (t *Telegram) SendMediaGroup(chatID int64, mediaGroup []args.MediaGroupConfig, ...) (types.Message, error)
- func (t *Telegram) SendMessage(chatID int64, text args.TextData, options ...method.SendMessageOption) (types.Message, error)
- func (t *Telegram) SendPhoto(chatID int64, photo *args.PhotoConfig, options ...method.SendPhotoOption) (types.Message, error)
- func (t *Telegram) SendVenue(chatID int64, venue types.Venue, options ...method.SendVenueOption) (types.Message, error)
- func (t *Telegram) SendVideo(chatID int64, video *args.VideoConfig, options ...method.SendVideoOption) (types.Message, error)
- func (t *Telegram) SendVideoNote(chatID int64, videoNote *args.VideoNoteConfig, ...) (types.Message, error)
- func (t *Telegram) SendVoice(chatID int64, voice *args.VoiceConfig, options ...method.SendVoiceOption) (types.Message, error)
- func (t *Telegram) SetChatDescription(chatID int64, description string) (bool, error)
- func (t *Telegram) SetChatPhoto(chatID int64, file *os.File) (bool, error)
- func (t *Telegram) SetChatStickerSet(chatID int64, stickerSetName string) (bool, error)
- func (t *Telegram) SetChatTitle(chatID int64, title string) (bool, error)
- func (t *Telegram) UnbanChatMember(userID int, chatID int64) (bool, error)
- func (t *Telegram) UnpinChatMessage(chatID int64) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Telegram ¶
type Telegram struct {
// contains filtered or unexported fields
}
Telegram telegram.
func (*Telegram) AnswerCallbackQuery ¶
func (t *Telegram) AnswerCallbackQuery(id string, options ...method.AnswerCallbackQueryOption) (bool, error)
AnswerCallbackQuery performs answerCallbackQuery telegram api method.
options:
option.Text(text string), option.ShowAlert(), option.URL(url string), option.CacheTime(time int)
Reference: https://core.telegram.org/bots/api#answercallbackquery
func (*Telegram) DeleteChatPhoto ¶
DeleteChatPhoto performs deleteChatPhoto telegram api method.
Reference: https://core.telegram.org/bots/api#deletechatphoto
func (*Telegram) DeleteChatStickerSet ¶
DeleteChatStickerSet performs deleteChatStickerSet telegram api method.
Reference: https://core.telegram.org/bots/api#deletechatstickerset
func (*Telegram) DeleteMessage ¶
DeleteMessage performs deleteMessage telegram api method.
func (*Telegram) EditMessageCaption ¶
func (t *Telegram) EditMessageCaption(messageID *args.MessageID, caption args.TextData, options ...method.EditMessageCaptionOption) (*types.Message, error)
EditMessageCaption performs editMessageCaption telegram api method. Returns pointer to the message, if message was sent by the bot or nil-pointer.
options:
option.Keyboard(keyboard markup.Keyboard)
Reference: https://core.telegram.org/bots/api#editmessagecaption
func (*Telegram) EditMessageMedia ¶
func (t *Telegram) EditMessageMedia(messageID *args.MessageID, media args.InputMediaConfig, options ...method.EditMessageMediaOption) (*types.Message, error)
EditMessageMedia performs editMessageMedia telegram api method. Returns pointer to the message, if message was sent by the bot or nil-pointer.
options:
option.Keyboard(keyboard markup.Keyboard)
Reference: https://core.telegram.org/bots/api#editmessagemedia
func (*Telegram) EditMessageReplyMarkup ¶
func (t *Telegram) EditMessageReplyMarkup(messageID *args.MessageID, kb keyboard.Keyboard) (*types.Message, error)
EditMessageReplyMarkup performs editMessageReplyMarkup telegram api method. Returns pointer to the message, if message was sent by the bot or nil-pointer.
Reference: https://core.telegram.org/bots/api#editmessagereplymarkup
func (*Telegram) EditMessageText ¶
func (t *Telegram) EditMessageText(messageID *args.MessageID, text args.TextData, options ...method.EditMessageTextOption) (*types.Message, error)
EditMessageText performs editMessageText telegram api method. Returns pointer to the message, if message was sent by the bot or nil-pointer.
options:
option.DisableWebPagePreview(), option.Keyboard(keyboard markup.Keyboard)
Reference: https://core.telegram.org/bots/api#editmessagetext
func (*Telegram) ExportChatInviteLink ¶
ExportChatInviteLink performs exportChatInviteLink telegram api method.
Reference: https://core.telegram.org/bots/api#exportchatinvitelink
func (*Telegram) ForwardMessage ¶
func (t *Telegram) ForwardMessage(chatID, fromChatID, messageID int, options ...method.ForwardMessageOption) (types.Message, error)
ForwardMessage performs forwardMessage telegram api method.
options:
option.DisableNotification()
Reference: https://core.telegram.org/bots/api#forwardmessage
func (*Telegram) GetChat ¶
GetChat performs getChat telegram api method.
Reference: https://core.telegram.org/bots/api#getchat
func (*Telegram) GetChatAdministrators ¶
func (t *Telegram) GetChatAdministrators(chatID int64) (types.ChatMember, error)
GetChatAdministrators performs getChatAdministrators telegram api method.
Reference: https://core.telegram.org/bots/api#getchatadministrators TODO: results is array
func (*Telegram) GetChatMember ¶
GetChatMember performs getChatMember telegram api method.
func (*Telegram) GetChatMembersCount ¶
GetChatMembersCount performs getChatMembersCount telegram api method.
Reference: https://core.telegram.org/bots/api#getchatmemberscount
func (*Telegram) GetFile ¶
GetFile performs getFile telegram api method.
Reference: https://core.telegram.org/bots/api#getfile
func (*Telegram) GetMe ¶
GetMe performs getMe telegram api method.
Reference: https://core.telegram.org/bots/api#getme
func (*Telegram) GetUpdates ¶
GetUpdates performs getMe telegram api method.
func (*Telegram) GetUserProfilePhotos ¶
func (t *Telegram) GetUserProfilePhotos(userID int, options ...method.GetUserProfilePhotosOption) (types.UserProfilePhotos, error)
GetUserProfilePhotos performs getUserProfilePhotos telegram api method.
options:
option.Offset(o int), option.Limit(l int)
Reference: https://core.telegram.org/bots/api#getuserprofilephotos
func (*Telegram) KickChatMember ¶
func (t *Telegram) KickChatMember(userID int, chatID int64, options ...method.KickChatMemberOption) (bool, error)
KickChatMember performs kickChatMember telegram api method.
options:
option.UntilDate(date int)
Reference: https://core.telegram.org/bots/api#kickchatmember
func (*Telegram) LeaveChat ¶
LeaveChat performs leaveChat telegram api method.
Reference: https://core.telegram.org/bots/api#leavechat
func (*Telegram) PinChatMessage ¶
func (t *Telegram) PinChatMessage(chatID int64, messageID int, options ...method.PinChatMessageOption) (bool, error)
PinChatMessage performs pinChatMessage telegram api method.
Reference: https://core.telegram.org/bots/api#pinchatmessage
func (*Telegram) PromoteChatMember ¶
func (t *Telegram) PromoteChatMember(userID int, chatID int64, options ...method.PromoteChatMemberOption) (bool, error)
PromoteChatMember performs promoteChatMember telegram api method.
options:
option.CanChangeInfo(), option.CanPostMessages(), option.CanDeleteMessages(), option.CanEditMessages() option.CanInviteUsers(), option.CanRestrictUsers(), option.CanPinMessages(), option.CanPromoteMembers()
Reference: https://core.telegram.org/bots/api#promotechatmember TODO: rework true/false
func (*Telegram) RestrictChatMember ¶
func (t *Telegram) RestrictChatMember(userID int, chatID int64, options ...method.RestrictChatMemberOption) (bool, error)
RestrictChatMember performs restrictChatMember telegram api method.
options:
option.CanSendMessages(), options.CanSendMediaMessages(), option.CanSendOtherMessages(), option.CanAddWebPagePreview()
Reference: https://core.telegram.org/bots/api#restrictchatmember TODO: rework true/false
func (*Telegram) SendAnimation ¶
func (t *Telegram) SendAnimation(chatID int64, animation *args.AnimationConfig, options ...method.SendAnimationOption) (types.Message, error)
SendAnimation performs sendAnimation telegram api method.
options:
option.DisableWebPagePreview(), option.ReplyToMessageID(id int), option.Keyboard(keyboard markup.Keyboard)
func (*Telegram) SendAudio ¶
func (t *Telegram) SendAudio(chatID int64, audio *args.AudioConfig, options ...method.SendAudioOption) (types.Message, error)
SendAudio performs sendAudio telegram api method.
options:
option.DisableWebPagePreview(), option.ReplyToMessageID(id int), option.Keyboard(keyboard markup.Keyboard)
Reference: https://core.telegram.org/bots/api#sendaudio
func (*Telegram) SendChatAction ¶
SendChatAction performs sendChatAction telegram api method.
Reference: https://core.telegram.org/bots/api#sendchataction
func (*Telegram) SendContact ¶
func (t *Telegram) SendContact(chatID int64, contact types.Contact, options ...method.SendContactOption) (types.Message, error)
SendContact performs sendContact telegram api method.
options:
option.DisableWebPagePreview(), option.ReplyToMessageID(id int), option.Keyboard(keyboard markup.Keyboard)
func (*Telegram) SendDocument ¶
func (t *Telegram) SendDocument(chatID int64, document *args.DocumentConfig, options ...method.SendDocumentOption) (types.Message, error)
SendDocument performs sendDocument telegram api method.
options:
option.DisableWebPagePreview(), option.ReplyToMessageID(id int), option.Keyboard(keyboard markup.Keyboard)
func (*Telegram) SendLocation ¶
func (t *Telegram) SendLocation(chatID int64, location types.Location, options ...method.SendLocationOption) (types.Message, error)
SendLocation performs sendLocation telegram api method.
options:
option.DisableWebPagePreview(), option.ReplyToMessageID(id int), option.Keyboard(keyboard markup.Keyboard)
func (*Telegram) SendMediaGroup ¶
func (t *Telegram) SendMediaGroup(chatID int64, mediaGroup []args.MediaGroupConfig, options ...method.SendMediaGroupOption) (types.Message, error)
SendMediaGroup performs sendMediaGroup telegram api method.
options:
option.DisableWebPagePreview(), option.ReplyToMessageID(id int),
Reference: https://core.telegram.org/bots/api#sendmediagroup TODO: parse response to array.
func (*Telegram) SendMessage ¶
func (t *Telegram) SendMessage(chatID int64, text args.TextData, options ...method.SendMessageOption) (types.Message, error)
SendMessage performs sendMessage telegram api method.
options:
option.DisableWebPagePreview(), option.DisableNotification() option.ReplyToMessageID(id int), option.Keyboard(keyboard markup.Keyboard)
func (*Telegram) SendPhoto ¶
func (t *Telegram) SendPhoto(chatID int64, photo *args.PhotoConfig, options ...method.SendPhotoOption) (types.Message, error)
SendPhoto performs sendPhoto telegram api method.
options:
option.DisableWebPagePreview(), option.ReplyToMessageID(id int), option.Keyboard(keyboard markup.Keyboard)
Reference: https://core.telegram.org/bots/api#sendphoto
func (*Telegram) SendVenue ¶
func (t *Telegram) SendVenue(chatID int64, venue types.Venue, options ...method.SendVenueOption) (types.Message, error)
SendVenue performs sendVenue telegram api method.
options:
option.DisableWebPagePreview(), option.ReplyToMessageID(id int), option.Keyboard(keyboard markup.Keyboard), option.Foursquare(id, type string)
Reference: https://core.telegram.org/bots/api#sendvenue
func (*Telegram) SendVideo ¶
func (t *Telegram) SendVideo(chatID int64, video *args.VideoConfig, options ...method.SendVideoOption) (types.Message, error)
SendVideo performs sendVideo telegram api method.
options:
option.DisableWebPagePreview(), option.ReplyToMessageID(id int), option.Keyboard(keyboard markup.Keyboard)
Reference: https://core.telegram.org/bots/api#sendvideo
func (*Telegram) SendVideoNote ¶
func (t *Telegram) SendVideoNote(chatID int64, videoNote *args.VideoNoteConfig, options ...method.SendVideoNoteOption) (types.Message, error)
SendVideoNote performs sendVideoNote telegram api method.
options:
option.DisableWebPagePreview(), option.ReplyToMessageID(id int), option.Keyboard(keyboard markup.Keyboard)
func (*Telegram) SendVoice ¶
func (t *Telegram) SendVoice(chatID int64, voice *args.VoiceConfig, options ...method.SendVoiceOption) (types.Message, error)
SendVoice performs sendVoice telegram api method.
options:
option.DisableWebPagePreview(), option.ReplyToMessageID(id int), option.Keyboard(keyboard markup.Keyboard)
Reference: https://core.telegram.org/bots/api#sendvoice
func (*Telegram) SetChatDescription ¶
SetChatDescription performs setChatDescription telegram api method.
Reference: https://core.telegram.org/bots/api#setchatdescription
func (*Telegram) SetChatPhoto ¶
SetChatPhoto performs setChatPhoto telegram api method.
func (*Telegram) SetChatStickerSet ¶
SetChatStickerSet performs setChatStickerSet telegram api method.
Reference: https://core.telegram.org/bots/api#setchatstickerset
func (*Telegram) SetChatTitle ¶
SetChatTitle performs setChatTitle telegram api method.
func (*Telegram) UnbanChatMember ¶
UnbanChatMember performs unbanChatMember telegram api method.
options:
option.UntilDate(date int)
Reference: https://core.telegram.org/bots/api#unbanchatmember
func (*Telegram) UnpinChatMessage ¶
UnpinChatMessage performs unpinChatMessage telegram api method.
Reference: https://core.telegram.org/bots/api#unpinchatmessage