Add helpers, change some items to pointers, add more inline results.

This commit is contained in:
Syfaro 2016-04-13 08:22:58 -05:00
parent 109da1a19f
commit 1ceb22b273
2 changed files with 145 additions and 70 deletions

View file

@ -209,21 +209,43 @@ func NewVoiceShare(chatID int64, fileID string) VoiceConfig {
}
}
// NewContact allows you to send a shared contact.
func NewContact(chatID int64, phoneNumber, firstName string) ContactConfig {
return ContactConfig{
BaseChat: BaseChat{
ChatID: chatID,
},
PhoneNumber: phoneNumber,
FirstName: firstName,
}
}
// NewLocation shares your location.
//
// chatID is where to send it, latitude and longitude are coordinates.
func NewLocation(chatID int64, latitude float64, longitude float64) LocationConfig {
return LocationConfig{
BaseChat: BaseChat{
ChatID: chatID,
ReplyToMessageID: 0,
ReplyMarkup: nil,
ChatID: chatID,
},
Latitude: latitude,
Longitude: longitude,
}
}
// NewVenue allows you to send a venue and its location.
func NewVenue(chatID int64, title, address string, latitude, longitude float64) VenueConfig {
return VenueConfig{
BaseChat: BaseChat{
ChatID: chatID,
},
Title: title,
Address: address,
Latitude: latitude,
Longitude: longitude,
}
}
// NewChatAction sets a chat action.
// Actions last for 5 seconds, or until your next action.
//