Skip to content

Commit 477ebd5

Browse files
committed
Add methods getStickerSet, uploadStickerFile, createNewStickerSet, addStickerToSet, setStickerPositionInSet and deleteStickerFromSet
1 parent d05de06 commit 477ebd5

File tree

1 file changed

+235
-7
lines changed

1 file changed

+235
-7
lines changed

Telegram.php

Lines changed: 235 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,7 +2141,7 @@ public function promoteChatMember(array $content)
21412141
return $this->endpoint('promoteChatMember', $content);
21422142
}
21432143

2144-
/// Export Chat Invite Link
2144+
//// Export Chat Invite Link
21452145

21462146
/**
21472147
* 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.
@@ -2167,7 +2167,7 @@ public function exportChatInviteLink(array $content)
21672167
return $this->endpoint('exportChatInviteLink', $content);
21682168
}
21692169

2170-
// Set Chat Photo
2170+
/// Set Chat Photo
21712171

21722172
/**
21732173
* 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.
@@ -2199,7 +2199,7 @@ public function setChatPhoto(array $content)
21992199
return $this->endpoint('setChatPhoto', $content);
22002200
}
22012201

2202-
// Delete Chat Photo
2202+
/// Delete Chat Photo
22032203

22042204
/**
22052205
* 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.
@@ -2225,7 +2225,7 @@ public function deleteChatPhoto(array $content)
22252225
return $this->endpoint('deleteChatPhoto', $content);
22262226
}
22272227

2228-
// Set Chat Title
2228+
/// Set Chat Title
22292229

22302230
/**
22312231
* Use this method to change the title of a chat. Titles 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.
@@ -2257,7 +2257,7 @@ public function setChatTitle(array $content)
22572257
return $this->endpoint('setChatTitle', $content);
22582258
}
22592259

2260-
// Set Chat Description
2260+
/// Set Chat Description
22612261

22622262
/**
22632263
* Use this method to change the description of 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 True on success.
@@ -2289,7 +2289,7 @@ public function setChatDescription(array $content)
22892289
return $this->endpoint('setChatDescription', $content);
22902290
}
22912291

2292-
// Pin Chat Message
2292+
/// Pin Chat Message
22932293

22942294
/**
22952295
* Use this method to pin a message in a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
@@ -2327,7 +2327,7 @@ public function pinChatMessage(array $content)
23272327
return $this->endpoint('pinChatMessage', $content);
23282328
}
23292329

2330-
// Unpin Chat Message
2330+
/// Unpin Chat Message
23312331

23322332
/**
23332333
* Use this method to unpin a message in a supergroup chat. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
@@ -2352,6 +2352,234 @@ public function unpinChatMessage(array $content)
23522352
{
23532353
return $this->endpoint('unpinChatMessage', $content);
23542354
}
2355+
2356+
/// Get Sticker Set
2357+
2358+
/**
2359+
* Use this method to get a sticker set. On success, a StickerSet object is returned.
2360+
* <table>
2361+
* <tr>
2362+
* <td><strong>Parameters</strong></td>
2363+
* <td><strong>Type</strong></td>
2364+
* <td><strong>Required</strong></td>
2365+
* <td><strong>Description</strong></td>
2366+
* </tr>
2367+
* <tr>
2368+
* <td>name</td>
2369+
* <td>String</td>
2370+
* <td>Yes</td>
2371+
* <td>Short name of the sticker set that is used in <code>t.me/addstickers/</code> URLs (e.g., <em>animals</em>)</td>
2372+
* </tr>
2373+
* </table>
2374+
* \param $content the request parameters as array
2375+
* \return the JSON Telegram's reply.
2376+
*/
2377+
public function getStickerSet(array $content)
2378+
{
2379+
return $this->endpoint('getStickerSet', $content);
2380+
}
2381+
2382+
/// Upload Sticker File
2383+
2384+
/**
2385+
* Use this method to upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success.
2386+
* <table>
2387+
* <tr>
2388+
* <td><strong>Parameters</strong></td>
2389+
* <td><strong>Type</strong></td>
2390+
* <td><strong>Required</strong></td>
2391+
* <td><strong>Description</strong></td>
2392+
* </tr>
2393+
* <tr>
2394+
* <td>user_id</td>
2395+
* <td>Integer</td>
2396+
* <td>Yes</td>
2397+
* <td>User identifier of sticker file owner</td>
2398+
* </tr>
2399+
* <tr>
2400+
* <td>png_sticker</td>
2401+
* <td><a href="#inputfile">InputFile</a></td>
2402+
* <td>Yes</td>
2403+
* <td><strong>Png</strong> image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. <a href="#sending-files">More info on Sending Files »</a></td>
2404+
* </tr>
2405+
* </table>
2406+
* \param $content the request parameters as array
2407+
* \return the JSON Telegram's reply.
2408+
*/
2409+
public function uploadStickerFile(array $content)
2410+
{
2411+
return $this->endpoint('uploadStickerFile', $content);
2412+
}
2413+
2414+
/// Create New Sticker Set
2415+
2416+
/**
2417+
* Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set. Returns True on success.
2418+
* <table>
2419+
* <tr>
2420+
* <td><strong>Parameters</strong></td>
2421+
* <td><strong>Type</strong></td>
2422+
* <td><strong>Required</strong></td>
2423+
* <td><strong>Description</strong></td>
2424+
* </tr>
2425+
* <tr>
2426+
* <td>user_id</td>
2427+
* <td>Integer</td>
2428+
* <td>Yes</td>
2429+
* <td>User identifier of created sticker set owner</td>
2430+
* </tr>
2431+
* <tr>
2432+
* <td>name</td>
2433+
* <td>String</td>
2434+
* <td>Yes</td>
2435+
* <td>Short name of sticker set, to be used in <code>t.me/addstickers/</code> URLs (e.g., <em>animals</em>). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in <em>“_by_&lt;bot username&gt;”</em>. <em>&lt;bot_username&gt;</em> is case insensitive. 1-64 characters.</td>
2436+
* </tr>
2437+
* <tr>
2438+
* <td>title</td>
2439+
* <td>String</td>
2440+
* <td>Yes</td>
2441+
* <td>Sticker set title, 1-64 characters</td>
2442+
* </tr>
2443+
* <tr>
2444+
* <td>png_sticker</td>
2445+
* <td><a href="#inputfile">InputFile</a> or String</td>
2446+
* <td>Yes</td>
2447+
* <td><strong>Png</strong> image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a <em>file_id</em> as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. <a href="#sending-files">More info on Sending Files »</a></td>
2448+
* </tr>
2449+
* <tr>
2450+
* <td>emojis</td>
2451+
* <td>String</td>
2452+
* <td>Yes</td>
2453+
* <td>One or more emoji corresponding to the sticker</td>
2454+
* </tr>
2455+
* <tr>
2456+
* <td>is_masks</td>
2457+
* <td>Boolean</td>
2458+
* <td>Optional</td>
2459+
* <td>Pass <em>True</em>, if a set of mask stickers should be created</td>
2460+
* </tr>
2461+
* <tr>
2462+
* <td>mask_position</td>
2463+
* <td><a href="#maskposition">MaskPosition</a></td>
2464+
* <td>Optional</td>
2465+
* <td>Position where the mask should be placed on faces</td>
2466+
* </tr>
2467+
* </table>
2468+
* \param $content the request parameters as array
2469+
* \return the JSON Telegram's reply.
2470+
*/
2471+
public function createNewStickerSet(array $content)
2472+
{
2473+
return $this->endpoint('createNewStickerSet', $content);
2474+
}
2475+
2476+
/// Add Sticker To Set
2477+
2478+
/**
2479+
* Use this method to add a new sticker to a set created by the bot. Returns True on success.
2480+
* <table>
2481+
* <tr>
2482+
* <td><strong>Parameters</strong></td>
2483+
* <td><strong>Type</strong></td>
2484+
* <td><strong>Required</strong></td>
2485+
* <td><strong>Description</strong></td>
2486+
* </tr>
2487+
* <tr>
2488+
* <td>user_id</td>
2489+
* <td>Integer</td>
2490+
* <td>Yes</td>
2491+
* <td>User identifier of sticker set owner</td>
2492+
* </tr>
2493+
* <tr>
2494+
* <td>name</td>
2495+
* <td>String</td>
2496+
* <td>Yes</td>
2497+
* <td>Sticker set name</td>
2498+
* </tr>
2499+
* <tr>
2500+
* <td>png_sticker</td>
2501+
* <td><a href="#inputfile">InputFile</a> or String</td>
2502+
* <td>Yes</td>
2503+
* <td><strong>Png</strong> image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a <em>file_id</em> as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. <a href="#sending-files">More info on Sending Files »</a></td>
2504+
* </tr>
2505+
* <tr>
2506+
* <td>emojis</td>
2507+
* <td>String</td>
2508+
* <td>Yes</td>
2509+
* <td>One or more emoji corresponding to the sticker</td>
2510+
* </tr>
2511+
* <tr>
2512+
* <td>mask_position</td>
2513+
* <td><a href="#maskposition">MaskPosition</a></td>
2514+
* <td>Optional</td>
2515+
* <td>Position where the mask should be placed on faces</td>
2516+
* </tr>
2517+
* </table>
2518+
* \param $content the request parameters as array
2519+
* \return the JSON Telegram's reply.
2520+
*/
2521+
public function addStickerToSet(array $content)
2522+
{
2523+
return $this->endpoint('addStickerToSet', $content);
2524+
}
2525+
2526+
/// Set Sticker Position In Set
2527+
2528+
/**
2529+
* Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success.
2530+
* <table>
2531+
* <tr>
2532+
* <td><strong>Parameters</strong></td>
2533+
* <td><strong>Type</strong></td>
2534+
* <td><strong>Required</strong></td>
2535+
* <td><strong>Description</strong></td>
2536+
* </tr>
2537+
* <tr>
2538+
* <td>sticker</td>
2539+
* <td>String</td>
2540+
* <td>Yes</td>
2541+
* <td>File identifier of the sticker</td>
2542+
* </tr>
2543+
* <tr>
2544+
* <td>position</td>
2545+
* <td>Integer</td>
2546+
* <td>Yes</td>
2547+
* <td>New sticker position in the set, zero-based</td>
2548+
* </tr>
2549+
* </table>
2550+
* \param $content the request parameters as array
2551+
* \return the JSON Telegram's reply.
2552+
*/
2553+
public function setStickerPositionInSet(array $content)
2554+
{
2555+
return $this->endpoint('setStickerPositionInSet', $content);
2556+
}
2557+
2558+
/// Delete Sticker From Set
2559+
2560+
/**
2561+
* Use this method to delete a sticker from a set created by the bot. Returns True on success.
2562+
* <table>
2563+
* <tr>
2564+
* <td><strong>Parameters</strong></td>
2565+
* <td><strong>Type</strong></td>
2566+
* <td><strong>Required</strong></td>
2567+
* <td><strong>Description</strong></td>
2568+
* </tr>
2569+
* <tr>
2570+
* <td>sticker</td>
2571+
* <td>String</td>
2572+
* <td>Yes</td>
2573+
* <td>File identifier of the sticker</td>
2574+
* </tr>
2575+
* </table>
2576+
* \param $content the request parameters as array
2577+
* \return the JSON Telegram's reply.
2578+
*/
2579+
public function deleteStickerFromSet(array $content)
2580+
{
2581+
return $this->endpoint('deleteStickerFromSet', $content);
2582+
}
23552583

23562584
/// Delete a message
23572585

0 commit comments

Comments
 (0)