all repos — telegram-bot-api @ 595aba3deaee4ab337d484d57928ab49f9811e08

Golang bindings for the Telegram Bot API

Add sendContact method.
Syfaro syfaro@foxpaw.in
Tue, 12 Apr 2016 13:02:08 -0500
commit

595aba3deaee4ab337d484d57928ab49f9811e08

parent

b6130533a37705a96e236717c9baf6484c0e8c8c

1 files changed, 22 insertions(+), 0 deletions(-)

jump to
M configs.goconfigs.go

@@ -513,6 +513,28 @@ func (config VenueConfig) method() string {

return "sendVenue" } +// ContactConfig allows you to send a contact. +type ContactConfig struct { + BaseChat + PhoneNumber string + FirstName string + LastName string +} + +func (config ContactConfig) values() (url.Values, error) { + v, _ := config.BaseChat.values() + + v.Add("phone_number", config.PhoneNumber) + v.Add("first_name", config.FirstName) + v.Add("last_name", config.LastName) + + return v, nil +} + +func (config ContactConfig) method() string { + return "sendContact" +} + // ChatActionConfig contains information about a SendChatAction request. type ChatActionConfig struct { BaseChat