Skip to content

Commit 4cb023a

Browse files
authored
Merge pull request #175 from Mohsen322/patch-2
added ANIMATION type const and fixed some bugs
2 parents d9f896e + b3ea496 commit 4cb023a

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

Telegram.php

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ class Telegram
4747
* Constant for type Voice.
4848
*/
4949
const VOICE = 'voice';
50+
/**
51+
* Constant for type animation.
52+
*/
53+
const ANIMATION = 'animation';
5054
/**
5155
* Constant for type Document.
5256
*/
@@ -3014,9 +3018,6 @@ public function getUpdateType()
30143018
if (isset($update['edited_message'])) {
30153019
return self::EDITED_MESSAGE;
30163020
}
3017-
if (isset($update['message']['reply_to_message'])) {
3018-
return self::REPLY;
3019-
}
30203021
if (isset($update['message']['text'])) {
30213022
return self::MESSAGE;
30223023
}
@@ -3035,12 +3036,18 @@ public function getUpdateType()
30353036
if (isset($update['message']['contact'])) {
30363037
return self::CONTACT;
30373038
}
3038-
if (isset($update['message']['document'])) {
3039-
return self::DOCUMENT;
3040-
}
30413039
if (isset($update['message']['location'])) {
30423040
return self::LOCATION;
30433041
}
3042+
if (isset($update['message']['reply_to_message'])) {
3043+
return self::REPLY;
3044+
}
3045+
if (isset($update['message']['animation'])) {
3046+
return self::ANIMATION;
3047+
}
3048+
if (isset($update['message']['document'])) {
3049+
return self::DOCUMENT;
3050+
}
30443051
if (isset($update['channel_post'])) {
30453052
return self::CHANNEL_POST;
30463053
}
@@ -3062,9 +3069,9 @@ private function sendAPIRequest($url, array $content, $post = true)
30623069
curl_setopt($ch, CURLOPT_POST, 1);
30633070
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
30643071
}
3065-
echo "inside curl if";
3072+
// echo "inside curl if";
30663073
if (!empty($this->proxy)) {
3067-
echo "inside proxy if";
3074+
// echo "inside proxy if";
30683075
if (array_key_exists("type", $this->proxy)) {
30693076
curl_setopt($ch, CURLOPT_PROXYTYPE, $this->proxy["type"]);
30703077
}
@@ -3074,12 +3081,12 @@ private function sendAPIRequest($url, array $content, $post = true)
30743081
}
30753082

30763083
if (array_key_exists("url", $this->proxy)) {
3077-
echo "Proxy Url";
3084+
// echo "Proxy Url";
30783085
curl_setopt($ch, CURLOPT_PROXY, $this->proxy["url"]);
30793086
}
30803087

30813088
if (array_key_exists("port", $this->proxy)) {
3082-
echo "Proxy port";
3089+
// echo "Proxy port";
30833090
curl_setopt($ch, CURLOPT_PROXYPORT, $this->proxy["port"]);
30843091
}
30853092

0 commit comments

Comments
 (0)