Skip to content

Commit fdceed2

Browse files
committed
Add exportChatInviteLink, setChatPhoto and deleteChatPhoto api methods
1 parent fa6c633 commit fdceed2

File tree

1 file changed

+89
-5
lines changed

1 file changed

+89
-5
lines changed

Telegram.php

Lines changed: 89 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,7 @@ public function buildForceReply($selective = true)
18491849
* </tr>
18501850
* <tr>
18511851
* <td>reply_markup</td>
1852-
* <td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
1852+
* <td><a href="https://core.telegram.org/bots/api#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
18531853
* <td>Optional</td>
18541854
* <td>A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>. If empty, one 'Pay <code>total price</code>' button will be shown. If not empty, the first button must be a Pay button.</td>
18551855
* </tr>
@@ -1993,7 +1993,7 @@ public function answerPreCheckoutQuery(array $content)
19931993
* </tr>
19941994
* <tr>
19951995
* <td>reply_markup</td>
1996-
* <td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
1996+
* <td><a href="https://core.telegram.org/bots/api#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="https://core.telegram.org/bots/api#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="https://core.telegram.org/bots/api#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="https://core.telegram.org/bots/api#forcereply">ForceReply</a></td>
19971997
* <td>Optional</td>
19981998
* <td>Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
19991999
* </tr>
@@ -2024,9 +2024,9 @@ public function sendVideoNote(array $content)
20242024
* </tr>
20252025
* <tr>
20262026
* <td>photo</td>
2027-
* <td><a href="#inputfile">InputFile</a> or String</td>
2027+
* <td><a href="https://core.telegram.org/bots/api#inputfile">InputFile</a> or String</td>
20282028
* <td>Yes</td>
2029-
* <td>Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. <a href="#sending-files">More info on Sending Files »</a></td>
2029+
* <td>Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. <a href="https://core.telegram.org/bots/api#sending-files">More info on Sending Files »</a></td>
20302030
* </tr>
20312031
* <tr>
20322032
* <td>caption</td>
@@ -2048,7 +2048,7 @@ public function sendVideoNote(array $content)
20482048
* </tr>
20492049
* <tr>
20502050
* <td>reply_markup</td>
2051-
* <td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
2051+
* <td><a href="https://core.telegram.org/bots/api#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="https://core.telegram.org/bots/api#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="https://core.telegram.org/bots/api#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="https://core.telegram.org/bots/api#forcereply">ForceReply</a></td>
20522052
* <td>Optional</td>
20532053
* <td>Additional interface options. A JSON-serialized object for an <a href="https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating">inline keyboard</a>, <a href="https://core.telegram.org/bots#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
20542054
* </tr>
@@ -2140,6 +2140,90 @@ public function promoteChatMember(array $content)
21402140
{
21412141
return $this->endpoint('promoteChatMember', $content);
21422142
}
2143+
2144+
/// Export Chat Invite Link
2145+
2146+
/**
2147+
* Use this method to export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns exported invite link as String on success.
2148+
* <table>
2149+
* <tr>
2150+
* <td><strong>Parameters</strong></td>
2151+
* <td><strong>Type</strong></td>
2152+
* <td><strong>Required</strong></td>
2153+
* <td><strong>Description</strong></td>
2154+
* </tr>
2155+
* <tr>
2156+
* <td>chat_id</td>
2157+
* <td>Integer or String</td>
2158+
* <td>Yes</td>
2159+
* <td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
2160+
* </tr>
2161+
* </table>
2162+
* \param $content the request parameters as array
2163+
* \return the JSON Telegram's reply.
2164+
*/
2165+
public function exportChatInviteLink(array $content)
2166+
{
2167+
return $this->endpoint('exportChatInviteLink', $content);
2168+
}
2169+
2170+
// Set Chat Photo
2171+
2172+
/**
2173+
* Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is off in the target group.
2174+
* <table>
2175+
* <tr>
2176+
* <td><strong>Parameters</strong></td>
2177+
* <td><strong>Type</strong></td>
2178+
* <td><strong>Required</strong></td>
2179+
* <td><strong>Description</strong></td>
2180+
* </tr>
2181+
* <tr>
2182+
* <td>chat_id</td>
2183+
* <td>Integer or String</td>
2184+
* <td>Yes</td>
2185+
* <td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
2186+
* </tr>
2187+
* <tr>
2188+
* <td>photo</td>
2189+
* <td><a href="https://core.telegram.org/bots/api#inputfile">InputFile</a></td>
2190+
* <td>Yes</td>
2191+
* <td>New chat photo, uploaded using multipart/form-data</td>
2192+
* </tr>
2193+
* </table>
2194+
* \param $content the request parameters as array
2195+
* \return the JSON Telegram's reply.
2196+
*/
2197+
public function setChatPhoto(array $content)
2198+
{
2199+
return $this->endpoint('setChatPhoto', $content);
2200+
}
2201+
2202+
// Delete Chat Photo
2203+
2204+
/**
2205+
* Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is off in the target group.
2206+
* <table>
2207+
* <tr>
2208+
* <td><strong>Parameters</strong></td>
2209+
* <td><strong>Type</strong></td>
2210+
* <td><strong>Required</strong></td>
2211+
* <td><strong>Description</strong></td>
2212+
* </tr>
2213+
* <tr>
2214+
* <td>chat_id</td>
2215+
* <td>Integer or String</td>
2216+
* <td>Yes</td>
2217+
* <td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
2218+
* </tr>
2219+
* </table>
2220+
* \param $content the request parameters as array
2221+
* \return the JSON Telegram's reply.
2222+
*/
2223+
public function deleteChatPhoto(array $content)
2224+
{
2225+
return $this->endpoint('deleteChatPhoto', $content);
2226+
}
21432227

21442228
/// Delete a message
21452229

0 commit comments

Comments
 (0)