Skip to content

Commit 595aba3

Browse files
author
Syfaro
committed
Add sendContact method.
1 parent b613053 commit 595aba3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

configs.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,28 @@ func (config VenueConfig) method() string {
513513
return "sendVenue"
514514
}
515515

516+
// ContactConfig allows you to send a contact.
517+
type ContactConfig struct {
518+
BaseChat
519+
PhoneNumber string
520+
FirstName string
521+
LastName string
522+
}
523+
524+
func (config ContactConfig) values() (url.Values, error) {
525+
v, _ := config.BaseChat.values()
526+
527+
v.Add("phone_number", config.PhoneNumber)
528+
v.Add("first_name", config.FirstName)
529+
v.Add("last_name", config.LastName)
530+
531+
return v, nil
532+
}
533+
534+
func (config ContactConfig) method() string {
535+
return "sendContact"
536+
}
537+
516538
// ChatActionConfig contains information about a SendChatAction request.
517539
type ChatActionConfig struct {
518540
BaseChat

0 commit comments

Comments
 (0)