Skip to content

Commit

Permalink
Added sendContact and sendVenue functions
Browse files Browse the repository at this point in the history
I have added 2 functions: sendContact and sendVenue. The sendVenue is very similar to sending a location but you can also send a title, address and fourqsuare id with the location. The sendContact function accepts a phonenumber, first name and last name to send a contact.
  • Loading branch information
feltkamptv committed May 23, 2016
1 parent 7281d4e commit e6dbf12
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/Telegram.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,51 @@ public function sendLocation($chat_id, $latitude, $longitude, $reply_to_message_
return $this->sendRequest('sendLocation', $params);
}

/**
* Send Venue.
*
* @link https://core.telegram.org/bots/api#sendvenue
*
* @param int $chat_id
* @param float $latitude
* @param float $longitude
* @param string $title
* @param string $address
* @param string $foursquare_id
* @param int $reply_to_message_id
* @param KeyboardMarkup $reply_markup
*
* @return Array
*/
public function sendVenue($chat_id, $latitude, $longitude, $title, $address, $foursquare_id = null, $reply_to_message_id = null, $reply_markup = null)
{
$params = compact('chat_id', 'latitude', 'longitude', 'title', 'address', 'foursquare_id', 'reply_to_message_id', 'reply_markup');

return $this->sendRequest('sendVenue', $params);
}

/**
* Send Contact.
*
* @link https://core.telegram.org/bots/api#sendcontact
*
* @param int $chat_id
* @param string $phonenumber
* @param string $first_name
* @param string $last_name
* @param bool $disable_notification
* @param int $reply_to_message_id
* @param KeyboardMarkup $reply_markup
*
* @return Array
*/
public function sendContact($chat_id, $phone_number, $first_name, $last_name = null, $reply_to_message_id = null, $reply_markup = null)
{
$params = compact('chat_id', 'phone_number', 'first_name', 'last_name', 'reply_to_message_id', 'reply_markup');

return $this->sendRequest('sendContact', $params);
}

/**
* Send Chat Action.
*
Expand Down

0 comments on commit e6dbf12

Please sign in to comment.