Archived
1
This repository has been archived on 2022-11-04. You can view files and clone it, but cannot push or open issues or pull requests.
fwzookeeper/vendor/gitlab.com/toby3d/telegram/utils_audio.go
2018-11-29 20:32:51 +04:00

38 lines
538 B
Go

package telegram
func (a *Audio) FullName(sep string) (name string) {
if !a.HasTitle() {
return
}
if a.HasPerformer() {
name += a.Performer + sep
}
name += a.Title
return
}
func (a *Audio) HasPerformer() bool {
return a != nil && a.Performer != ""
}
func (a *Audio) HasTitle() bool {
return a != nil && a.Title != ""
}
func (a *Audio) HasThumb() bool {
return a != nil && a.Thumb != nil
}
func (a *Audio) File() *File {
if a == nil {
return nil
}
return &File{
FileID: a.FileID,
FileSize: a.FileSize,
}
}