Animation type support added

This commit is contained in:
Denis Orlikhin 2018-09-06 15:44:42 +03:00
parent 75244dc4f7
commit 0343f9ec27
3 changed files with 96 additions and 1 deletions

View file

@ -13,7 +13,7 @@ func NewMessage(chatID int64, text string) MessageConfig {
ChatID: chatID,
ReplyToMessageID: 0,
},
Text: text,
Text: text,
DisableWebPagePreview: false,
}
}
@ -200,6 +200,35 @@ func NewVideoShare(chatID int64, fileID string) VideoConfig {
}
}
// NewAnimationUpload creates a new animation uploader.
//
// chatID is where to send it, file is a string path to the file,
// FileReader, or FileBytes.
func NewAnimationUpload(chatID int64, file interface{}) AnimationConfig {
return AnimationConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
File: file,
UseExisting: false,
},
}
}
// NewAnimationShare shares an existing animation.
// You may use this to reshare an existing animation without reuploading it.
//
// chatID is where to send it, fileID is the ID of the animation
// already uploaded.
func NewAnimationShare(chatID int64, fileID string) AnimationConfig {
return AnimationConfig{
BaseFile: BaseFile{
BaseChat: BaseChat{ChatID: chatID},
FileID: fileID,
UseExisting: true,
},
}
}
// NewVideoNoteUpload creates a new video note uploader.
//
// chatID is where to send it, file is a string path to the file,