Builder for contact payloads.
This module provides a fluent API for sending contact information.
Examples
# Send contact with first name only
ctx
|> Contact.contact("John", "+123456789")
|> Contact.send(chat_id)
# Send contact with first and last name
ctx
|> Contact.contact("John", "Doe", "+123456789")
|> Contact.send(chat_id)
# Send contact silently
ctx
|> Contact.contact("Jane", "+987654321")
|> Contact.silent()
|> Contact.send(chat_id)
Summary
Functions
Sets contact information with first name and phone number.
Sets contact information with first name, last name, and phone number.
Sends the contact to the specified chat.
Sends the contact without notification sound.
Functions
Sets contact information with first name and phone number.
Parameters
ctx- Context mapname- Contact's first namephone- Contact's phone number
Returns
Updated context map with contact data set.
Examples
ctx
|> Contact.contact("John", "+1234567890")
|> Contact.send(chat_id)
Sets contact information with first name, last name, and phone number.
Parameters
ctx- Context mapfirst_name- Contact's first namelast_name- Contact's last namephone- Contact's phone number
Returns
Updated context map with contact data set.
Examples
ctx
|> Contact.contact("John", "Doe", "+1234567890")
|> Contact.send(chat_id)
Sends the contact to the specified chat.
Parameters
ctx- Context map with accumulated contact dataid- Chat ID to send the contact to
Returns
:ok- Contact sent successfully{:error, reason}- Failed to send contact
Sends the contact without notification sound.
Parameters
ctx- Context map
Returns
Updated context map with silent flag set.