Skip to content

Commit 2a4e6c9

Browse files
abbas980301Eleirbag89
authored andcommitted
Improve update types (#82)
* Add Caption() method * Add contact type * fix conflict * update document
1 parent c2418a0 commit 2a4e6c9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Telegram.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ class Telegram
5050
* Constant for type Location
5151
*/
5252
const LOCATION = 'location';
53-
53+
/**
54+
* Constant for type Contact
55+
*/
56+
const CONTACT = 'contact';
57+
5458
private $bot_id = "";
5559
private $data = array();
5660
private $updates = array();
@@ -1343,6 +1347,11 @@ public function Text()
13431347
return @$this->data["message"]["text"];
13441348
}
13451349

1350+
public function Caption()
1351+
{
1352+
return @$this->data["message"]["caption"];
1353+
}
1354+
13461355
/// Get the chat_id of the current message
13471356
/**
13481357
* \return the String users's chat_id
@@ -2027,6 +2036,9 @@ public function getUpdateType()
20272036
if (isset($update['message']['voice'])) {
20282037
return self::VOICE;
20292038
}
2039+
if (isset($update['message']['contact'])) {
2040+
return self::CONTACT;
2041+
}
20302042
if (isset($update['message']['document'])) {
20312043
return self::DOCUMENT;
20322044
}

0 commit comments

Comments
 (0)