• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vjik / telegram-bot-api / 13337335348

14 Feb 2025 08:55PM UTC coverage: 99.911% (-0.09%) from 100.0%
13337335348

Pull #145

github

web-flow
Merge e5e8377b4 into cdb66e2d8
Pull Request #145: Move base URL and token to `TelegramBotApi`

26 of 31 new or added lines in 4 files covered. (83.87%)

5609 of 5614 relevant lines covered (99.91%)

28.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

99.47
/src/TelegramBotApi.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Vjik\TelegramBot\Api;
6

7
use DateTimeImmutable;
8
use DateTimeInterface;
9
use LogicException;
10
use Psr\Log\LoggerInterface;
11
use Vjik\TelegramBot\Api\Method\AnswerCallbackQuery;
12
use Vjik\TelegramBot\Api\Method\ApproveChatJoinRequest;
13
use Vjik\TelegramBot\Api\Method\BanChatMember;
14
use Vjik\TelegramBot\Api\Method\BanChatSenderChat;
15
use Vjik\TelegramBot\Api\Method\Close;
16
use Vjik\TelegramBot\Api\Method\CloseForumTopic;
17
use Vjik\TelegramBot\Api\Method\CloseGeneralForumTopic;
18
use Vjik\TelegramBot\Api\Method\CopyMessage;
19
use Vjik\TelegramBot\Api\Method\CopyMessages;
20
use Vjik\TelegramBot\Api\Method\CreateChatInviteLink;
21
use Vjik\TelegramBot\Api\Method\CreateChatSubscriptionInviteLink;
22
use Vjik\TelegramBot\Api\Method\CreateForumTopic;
23
use Vjik\TelegramBot\Api\Method\DeclineChatJoinRequest;
24
use Vjik\TelegramBot\Api\Method\DeleteChatPhoto;
25
use Vjik\TelegramBot\Api\Method\DeleteChatStickerSet;
26
use Vjik\TelegramBot\Api\Method\DeleteForumTopic;
27
use Vjik\TelegramBot\Api\Method\DeleteMyCommands;
28
use Vjik\TelegramBot\Api\Method\EditChatInviteLink;
29
use Vjik\TelegramBot\Api\Method\EditChatSubscriptionInviteLink;
30
use Vjik\TelegramBot\Api\Method\EditForumTopic;
31
use Vjik\TelegramBot\Api\Method\EditGeneralForumTopic;
32
use Vjik\TelegramBot\Api\Method\ExportChatInviteLink;
33
use Vjik\TelegramBot\Api\Method\ForwardMessage;
34
use Vjik\TelegramBot\Api\Method\ForwardMessages;
35
use Vjik\TelegramBot\Api\Method\Game\GetGameHighScores;
36
use Vjik\TelegramBot\Api\Method\Game\SendGame;
37
use Vjik\TelegramBot\Api\Method\Game\SetGameScore;
38
use Vjik\TelegramBot\Api\Method\GetBusinessConnection;
39
use Vjik\TelegramBot\Api\Method\GetChat;
40
use Vjik\TelegramBot\Api\Method\GetChatAdministrators;
41
use Vjik\TelegramBot\Api\Method\GetChatMember;
42
use Vjik\TelegramBot\Api\Method\GetChatMemberCount;
43
use Vjik\TelegramBot\Api\Method\GetChatMenuButton;
44
use Vjik\TelegramBot\Api\Method\GetFile;
45
use Vjik\TelegramBot\Api\Method\GetForumTopicIconStickers;
46
use Vjik\TelegramBot\Api\Method\GetMe;
47
use Vjik\TelegramBot\Api\Method\GetMyCommands;
48
use Vjik\TelegramBot\Api\Method\GetMyDefaultAdministratorRights;
49
use Vjik\TelegramBot\Api\Method\GetMyDescription;
50
use Vjik\TelegramBot\Api\Method\GetMyName;
51
use Vjik\TelegramBot\Api\Method\GetMyShortDescription;
52
use Vjik\TelegramBot\Api\Method\GetUserChatBoosts;
53
use Vjik\TelegramBot\Api\Method\GetUserProfilePhotos;
54
use Vjik\TelegramBot\Api\Method\HideGeneralForumTopic;
55
use Vjik\TelegramBot\Api\Method\Inline\AnswerInlineQuery;
56
use Vjik\TelegramBot\Api\Method\Inline\AnswerWebAppQuery;
57
use Vjik\TelegramBot\Api\Method\Inline\SavePreparedInlineMessage;
58
use Vjik\TelegramBot\Api\Method\LeaveChat;
59
use Vjik\TelegramBot\Api\Method\LogOut;
60
use Vjik\TelegramBot\Api\Method\Passport\SetPassportDataErrors;
61
use Vjik\TelegramBot\Api\Method\Payment\AnswerPreCheckoutQuery;
62
use Vjik\TelegramBot\Api\Method\Payment\AnswerShippingQuery;
63
use Vjik\TelegramBot\Api\Method\Payment\CreateInvoiceLink;
64
use Vjik\TelegramBot\Api\Method\Payment\EditUserStarSubscription;
65
use Vjik\TelegramBot\Api\Method\Payment\GetStarTransactions;
66
use Vjik\TelegramBot\Api\Method\Payment\RefundStarPayment;
67
use Vjik\TelegramBot\Api\Method\Payment\SendInvoice;
68
use Vjik\TelegramBot\Api\Method\PinChatMessage;
69
use Vjik\TelegramBot\Api\Method\PromoteChatMember;
70
use Vjik\TelegramBot\Api\Method\RemoveChatVerification;
71
use Vjik\TelegramBot\Api\Method\RemoveUserVerification;
72
use Vjik\TelegramBot\Api\Method\ReopenForumTopic;
73
use Vjik\TelegramBot\Api\Method\ReopenGeneralForumTopic;
74
use Vjik\TelegramBot\Api\Method\RestrictChatMember;
75
use Vjik\TelegramBot\Api\Method\RevokeChatInviteLink;
76
use Vjik\TelegramBot\Api\Method\SendAnimation;
77
use Vjik\TelegramBot\Api\Method\SendAudio;
78
use Vjik\TelegramBot\Api\Method\SendChatAction;
79
use Vjik\TelegramBot\Api\Method\SendContact;
80
use Vjik\TelegramBot\Api\Method\SendDice;
81
use Vjik\TelegramBot\Api\Method\SendDocument;
82
use Vjik\TelegramBot\Api\Method\SendLocation;
83
use Vjik\TelegramBot\Api\Method\SendMediaGroup;
84
use Vjik\TelegramBot\Api\Method\SendMessage;
85
use Vjik\TelegramBot\Api\Method\SendPaidMedia;
86
use Vjik\TelegramBot\Api\Method\SendPhoto;
87
use Vjik\TelegramBot\Api\Method\SendPoll;
88
use Vjik\TelegramBot\Api\Method\SendVenue;
89
use Vjik\TelegramBot\Api\Method\SendVideo;
90
use Vjik\TelegramBot\Api\Method\SendVideoNote;
91
use Vjik\TelegramBot\Api\Method\SendVoice;
92
use Vjik\TelegramBot\Api\Method\SetChatAdministratorCustomTitle;
93
use Vjik\TelegramBot\Api\Method\SetChatDescription;
94
use Vjik\TelegramBot\Api\Method\SetChatMenuButton;
95
use Vjik\TelegramBot\Api\Method\SetChatPermissions;
96
use Vjik\TelegramBot\Api\Method\SetChatPhoto;
97
use Vjik\TelegramBot\Api\Method\SetChatStickerSet;
98
use Vjik\TelegramBot\Api\Method\SetChatTitle;
99
use Vjik\TelegramBot\Api\Method\SetMessageReaction;
100
use Vjik\TelegramBot\Api\Method\SetMyCommands;
101
use Vjik\TelegramBot\Api\Method\SetMyDefaultAdministratorRights;
102
use Vjik\TelegramBot\Api\Method\SetMyDescription;
103
use Vjik\TelegramBot\Api\Method\SetMyName;
104
use Vjik\TelegramBot\Api\Method\SetMyShortDescription;
105
use Vjik\TelegramBot\Api\Method\SetUserEmojiStatus;
106
use Vjik\TelegramBot\Api\Method\Sticker\AddStickerToSet;
107
use Vjik\TelegramBot\Api\Method\Sticker\CreateNewStickerSet;
108
use Vjik\TelegramBot\Api\Method\Sticker\DeleteStickerFromSet;
109
use Vjik\TelegramBot\Api\Method\Sticker\DeleteStickerSet;
110
use Vjik\TelegramBot\Api\Method\Sticker\GetAvailableGifts;
111
use Vjik\TelegramBot\Api\Method\Sticker\GetCustomEmojiStickers;
112
use Vjik\TelegramBot\Api\Method\Sticker\GetStickerSet;
113
use Vjik\TelegramBot\Api\Method\Sticker\ReplaceStickerInSet;
114
use Vjik\TelegramBot\Api\Method\Sticker\SendGift;
115
use Vjik\TelegramBot\Api\Method\Sticker\SendSticker;
116
use Vjik\TelegramBot\Api\Method\Sticker\SetCustomEmojiStickerSetThumbnail;
117
use Vjik\TelegramBot\Api\Method\Sticker\SetStickerEmojiList;
118
use Vjik\TelegramBot\Api\Method\Sticker\SetStickerKeywords;
119
use Vjik\TelegramBot\Api\Method\Sticker\SetStickerMaskPosition;
120
use Vjik\TelegramBot\Api\Method\Sticker\SetStickerPositionInSet;
121
use Vjik\TelegramBot\Api\Method\Sticker\SetStickerSetThumbnail;
122
use Vjik\TelegramBot\Api\Method\Sticker\SetStickerSetTitle;
123
use Vjik\TelegramBot\Api\Method\Sticker\UploadStickerFile;
124
use Vjik\TelegramBot\Api\Method\UnbanChatMember;
125
use Vjik\TelegramBot\Api\Method\UnbanChatSenderChat;
126
use Vjik\TelegramBot\Api\Method\UnhideGeneralForumTopic;
127
use Vjik\TelegramBot\Api\Method\UnpinAllChatMessages;
128
use Vjik\TelegramBot\Api\Method\UnpinAllForumTopicMessages;
129
use Vjik\TelegramBot\Api\Method\UnpinAllGeneralForumTopicMessages;
130
use Vjik\TelegramBot\Api\Method\UnpinChatMessage;
131
use Vjik\TelegramBot\Api\Method\UpdatingMessage\DeleteMessage;
132
use Vjik\TelegramBot\Api\Method\UpdatingMessage\DeleteMessages;
133
use Vjik\TelegramBot\Api\Method\UpdatingMessage\EditMessageCaption;
134
use Vjik\TelegramBot\Api\Method\UpdatingMessage\EditMessageLiveLocation;
135
use Vjik\TelegramBot\Api\Method\UpdatingMessage\EditMessageMedia;
136
use Vjik\TelegramBot\Api\Method\UpdatingMessage\EditMessageReplyMarkup;
137
use Vjik\TelegramBot\Api\Method\UpdatingMessage\EditMessageText;
138
use Vjik\TelegramBot\Api\Method\UpdatingMessage\StopMessageLiveLocation;
139
use Vjik\TelegramBot\Api\Method\UpdatingMessage\StopPoll;
140
use Vjik\TelegramBot\Api\Method\VerifyChat;
141
use Vjik\TelegramBot\Api\Method\VerifyUser;
142
use Vjik\TelegramBot\Api\Transport\Curl\CurlTransport;
143
use Vjik\TelegramBot\Api\Transport\TransportInterface;
144
use Vjik\TelegramBot\Api\Type\BotCommand;
145
use Vjik\TelegramBot\Api\Type\BotCommandScope;
146
use Vjik\TelegramBot\Api\Type\BotDescription;
147
use Vjik\TelegramBot\Api\Type\BotName;
148
use Vjik\TelegramBot\Api\Type\BotShortDescription;
149
use Vjik\TelegramBot\Api\Type\BusinessConnection;
150
use Vjik\TelegramBot\Api\Type\ChatAdministratorRights;
151
use Vjik\TelegramBot\Api\Type\ChatFullInfo;
152
use Vjik\TelegramBot\Api\Type\ChatInviteLink;
153
use Vjik\TelegramBot\Api\Type\ChatMember;
154
use Vjik\TelegramBot\Api\Type\ChatPermissions;
155
use Vjik\TelegramBot\Api\Type\File;
156
use Vjik\TelegramBot\Api\Type\ForceReply;
157
use Vjik\TelegramBot\Api\Type\ForumTopic;
158
use Vjik\TelegramBot\Api\Type\Game\GameHighScore;
159
use Vjik\TelegramBot\Api\Type\Inline\InlineQueryResult;
160
use Vjik\TelegramBot\Api\Type\Inline\InlineQueryResultsButton;
161
use Vjik\TelegramBot\Api\Type\Inline\PreparedInlineMessage;
162
use Vjik\TelegramBot\Api\Type\Inline\SentWebAppMessage;
163
use Vjik\TelegramBot\Api\Type\InlineKeyboardMarkup;
164
use Vjik\TelegramBot\Api\Type\InputFile;
165
use Vjik\TelegramBot\Api\Type\InputMedia;
166
use Vjik\TelegramBot\Api\Type\InputMediaAudio;
167
use Vjik\TelegramBot\Api\Type\InputMediaDocument;
168
use Vjik\TelegramBot\Api\Type\InputMediaPhoto;
169
use Vjik\TelegramBot\Api\Type\InputMediaVideo;
170
use Vjik\TelegramBot\Api\Type\InputPaidMedia;
171
use Vjik\TelegramBot\Api\Type\InputPollOption;
172
use Vjik\TelegramBot\Api\Type\LinkPreviewOptions;
173
use Vjik\TelegramBot\Api\Type\MenuButton;
174
use Vjik\TelegramBot\Api\Type\Message;
175
use Vjik\TelegramBot\Api\Type\MessageEntity;
176
use Vjik\TelegramBot\Api\Type\MessageId;
177
use Vjik\TelegramBot\Api\Type\Passport\PassportElementError;
178
use Vjik\TelegramBot\Api\Type\Payment\LabeledPrice;
179
use Vjik\TelegramBot\Api\Type\Payment\ShippingOption;
180
use Vjik\TelegramBot\Api\Type\Payment\StarTransactions;
181
use Vjik\TelegramBot\Api\Type\Poll;
182
use Vjik\TelegramBot\Api\Type\ReactionType;
183
use Vjik\TelegramBot\Api\Type\ReplyKeyboardMarkup;
184
use Vjik\TelegramBot\Api\Type\ReplyKeyboardRemove;
185
use Vjik\TelegramBot\Api\Type\ReplyParameters;
186
use Vjik\TelegramBot\Api\Type\Sticker\Gifts;
187
use Vjik\TelegramBot\Api\Type\Sticker\InputSticker;
188
use Vjik\TelegramBot\Api\Type\Sticker\MaskPosition;
189
use Vjik\TelegramBot\Api\Type\Sticker\Sticker;
190
use Vjik\TelegramBot\Api\Type\Sticker\StickerSet;
191
use Vjik\TelegramBot\Api\Type\User;
192
use Vjik\TelegramBot\Api\Type\UserChatBoosts;
193
use Vjik\TelegramBot\Api\Type\UserProfilePhotos;
194
use Vjik\TelegramBot\Api\Method\Update\DeleteWebhook;
195
use Vjik\TelegramBot\Api\Method\Update\GetUpdates;
196
use Vjik\TelegramBot\Api\Method\Update\GetWebhookInfo;
197
use Vjik\TelegramBot\Api\Method\Update\SetWebhook;
198
use Vjik\TelegramBot\Api\Type\Update\Update;
199
use Vjik\TelegramBot\Api\Type\Update\WebhookInfo;
200

201
use function extension_loaded;
202

203
/**
204
 * @api
205
 */
206
final class TelegramBotApi
207
{
208
    private Api $api;
209

210
    public function __construct(
855✔
211
        string $token,
212
        string $baseUrl = 'https://api.telegram.org',
213
        ?TransportInterface $transport = null,
214
        private ?LoggerInterface $logger = null,
215
    ) {
216
        if ($transport === null) {
855✔
NEW
217
            $transport = extension_loaded('curl')
×
NEW
218
                ? new CurlTransport()
×
NEW
219
                : throw new LogicException(
×
NEW
220
                    'Failed to initialize the default transport (cURL required). Provide a transport manually.',
×
NEW
221
                );
×
222
        }
223
        $this->api = new Api($token, $baseUrl, $transport);
855✔
224
    }
225

226
    public function withLogger(?LoggerInterface $logger): self
3✔
227
    {
228
        $new = clone $this;
3✔
229
        $new->logger = $logger;
3✔
230
        return $new;
3✔
231
    }
232

233
    /**
234
     * @see https://core.telegram.org/bots/api#making-requests
235
     *
236
     * @psalm-template TValue
237
     * @psalm-param MethodInterface<TValue> $method
238
     * @psalm-return TValue|FailResult
239
     */
240
    public function call(MethodInterface $method): mixed
855✔
241
    {
242
        return $this->api->call($method, $this->logger);
855✔
243
    }
244

245
    /**
246
     * @see https://core.telegram.org/bots/api#addstickertoset
247
     */
248
    public function addStickerToSet(int $userId, string $name, InputSticker $sticker): FailResult|true
3✔
249
    {
250
        return $this->call(
3✔
251
            new AddStickerToSet($userId, $name, $sticker),
3✔
252
        );
3✔
253
    }
254

255
    /**
256
     * @see https://core.telegram.org/bots/api#answercallbackquery
257
     */
258
    public function answerCallbackQuery(
3✔
259
        string $callbackQueryId,
260
        ?string $text = null,
261
        ?bool $showAlert = null,
262
        ?string $url = null,
263
        ?int $cacheTime = null,
264
    ): FailResult|true {
265
        return $this->call(
3✔
266
            new AnswerCallbackQuery($callbackQueryId, $text, $showAlert, $url, $cacheTime),
3✔
267
        );
3✔
268
    }
269

270
    /**
271
     * @see https://core.telegram.org/bots/api#answerinlinequery
272
     *
273
     * @param InlineQueryResult[] $results
274
     */
275
    public function answerInlineQuery(
3✔
276
        string $inlineQueryId,
277
        array $results,
278
        ?int $cacheTime = null,
279
        ?bool $isPersonal = null,
280
        ?string $nextOffset = null,
281
        ?InlineQueryResultsButton $button = null,
282
    ): FailResult|true {
283
        return $this->call(
3✔
284
            new AnswerInlineQuery($inlineQueryId, $results, $cacheTime, $isPersonal, $nextOffset, $button),
3✔
285
        );
3✔
286
    }
287

288
    /**
289
     * @see https://core.telegram.org/bots/api#answerprecheckoutquery
290
     */
291
    public function answerPreCheckoutQuery(
3✔
292
        string $preCheckoutQueryId,
293
        bool $ok,
294
        ?string $errorMessage = null,
295
    ): FailResult|true {
296
        return $this->call(
3✔
297
            new AnswerPreCheckoutQuery($preCheckoutQueryId, $ok, $errorMessage),
3✔
298
        );
3✔
299
    }
300

301
    /**
302
     * @see https://core.telegram.org/bots/api#answershippingquery
303
     *
304
     * @param ShippingOption[]|null $shippingOptions
305
     */
306
    public function answerShippingQuery(
3✔
307
        string $shippingQueryId,
308
        bool $ok,
309
        ?array $shippingOptions = null,
310
        ?string $errorMessage = null,
311
    ): FailResult|true {
312
        return $this->call(
3✔
313
            new AnswerShippingQuery($shippingQueryId, $ok, $shippingOptions, $errorMessage),
3✔
314
        );
3✔
315
    }
316

317
    /**
318
     * @see https://core.telegram.org/bots/api#answerwebappquery
319
     */
320
    public function answerWebAppQuery(string $webAppQueryId, InlineQueryResult $result): FailResult|SentWebAppMessage
3✔
321
    {
322
        return $this->call(
3✔
323
            new AnswerWebAppQuery($webAppQueryId, $result),
3✔
324
        );
3✔
325
    }
326

327
    /**
328
     * @see https://core.telegram.org/bots/api#approvechatjoinrequest
329
     */
330
    public function approveChatJoinRequest(int|string $chatId, int $userId): FailResult|true
3✔
331
    {
332
        return $this->call(
3✔
333
            new ApproveChatJoinRequest($chatId, $userId),
3✔
334
        );
3✔
335
    }
336

337
    /**
338
     * @see https://core.telegram.org/bots/api#banchatmember
339
     */
340
    public function banChatMember(
3✔
341
        int|string $chatId,
342
        int $userId,
343
        ?DateTimeInterface $untilDate = null,
344
        ?bool $revokeMessages = null,
345
    ): FailResult|true {
346
        return $this->call(
3✔
347
            new BanChatMember($chatId, $userId, $untilDate, $revokeMessages),
3✔
348
        );
3✔
349
    }
350

351
    /**
352
     * @see https://core.telegram.org/bots/api#banchatsenderchat
353
     */
354
    public function banChatSenderChat(int|string $chatId, int $senderChatId): FailResult|true
3✔
355
    {
356
        return $this->call(
3✔
357
            new BanChatSenderChat($chatId, $senderChatId),
3✔
358
        );
3✔
359
    }
360

361
    /**
362
     * @see https://core.telegram.org/bots/api#close
363
     */
364
    public function close(): FailResult|true
3✔
365
    {
366
        return $this->call(new Close());
3✔
367
    }
368

369
    /**
370
     * @see https://core.telegram.org/bots/api#closeforumtopic
371
     */
372
    public function closeForumTopic(int|string $chatId, int $messageThreadId): FailResult|true
3✔
373
    {
374
        return $this->call(new CloseForumTopic($chatId, $messageThreadId));
3✔
375
    }
376

377
    /**
378
     * @see https://core.telegram.org/bots/api#closegeneralforumtopic
379
     */
380
    public function closeGeneralForumTopic(int|string $chatId): FailResult|true
3✔
381
    {
382
        return $this->call(new CloseGeneralForumTopic($chatId));
3✔
383
    }
384

385
    /**
386
     * @see https://core.telegram.org/bots/api#copymessage
387
     *
388
     * @param MessageEntity[]|null $captionEntities
389
     */
390
    public function copyMessage(
3✔
391
        int|string $chatId,
392
        int|string $fromChatId,
393
        int $messageId,
394
        ?int $messageThreadId = null,
395
        ?string $caption = null,
396
        ?string $parseMode = null,
397
        ?array $captionEntities = null,
398
        ?bool $showCaptionAboveMedia = null,
399
        ?bool $disableNotification = null,
400
        ?bool $protectContent = null,
401
        ?ReplyParameters $replyParameters = null,
402
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
403
        ?bool $allowPaidBroadcast = null,
404
        ?int $videoStartTimestamp = null,
405
    ): FailResult|MessageId {
406
        return $this->call(
3✔
407
            new CopyMessage(
3✔
408
                $chatId,
3✔
409
                $fromChatId,
3✔
410
                $messageId,
3✔
411
                $messageThreadId,
3✔
412
                $caption,
3✔
413
                $parseMode,
3✔
414
                $captionEntities,
3✔
415
                $showCaptionAboveMedia,
3✔
416
                $disableNotification,
3✔
417
                $protectContent,
3✔
418
                $replyParameters,
3✔
419
                $replyMarkup,
3✔
420
                $allowPaidBroadcast,
3✔
421
                $videoStartTimestamp,
3✔
422
            ),
3✔
423
        );
3✔
424
    }
425

426
    /**
427
     * @see https://core.telegram.org/bots/api#copymessages
428
     *
429
     * @param int[] $messageIds
430
     * @return FailResult|MessageId[]
431
     */
432
    public function copyMessages(
3✔
433
        int|string $chatId,
434
        int|string $fromChatId,
435
        array $messageIds,
436
        ?int $messageThreadId = null,
437
        ?bool $disableNotification = null,
438
        ?bool $protectContent = null,
439
        ?bool $removeCaption = null,
440
    ): FailResult|array {
441
        return $this->call(
3✔
442
            new CopyMessages(
3✔
443
                $chatId,
3✔
444
                $fromChatId,
3✔
445
                $messageIds,
3✔
446
                $messageThreadId,
3✔
447
                $disableNotification,
3✔
448
                $protectContent,
3✔
449
                $removeCaption,
3✔
450
            ),
3✔
451
        );
3✔
452
    }
453

454
    /**
455
     * @see https://core.telegram.org/bots/api#createchatinvitelink
456
     */
457
    public function createChatInviteLink(
3✔
458
        int|string $chatId,
459
        ?string $name = null,
460
        ?DateTimeImmutable $expireDate = null,
461
        ?int $memberLimit = null,
462
        ?bool $createsJoinRequest = null,
463
    ): FailResult|ChatInviteLink {
464
        return $this->call(
3✔
465
            new CreateChatInviteLink($chatId, $name, $expireDate, $memberLimit, $createsJoinRequest),
3✔
466
        );
3✔
467
    }
468

469
    /**
470
     * @see https://core.telegram.org/bots/api#createchatsubscriptioninvitelink
471
     */
472
    public function createChatSubscriptionInviteLink(
3✔
473
        int|string $chatId,
474
        int $subscriptionPeriod,
475
        int $subscriptionPrice,
476
        ?string $name = null,
477
    ): FailResult|ChatInviteLink {
478
        return $this->call(
3✔
479
            new CreateChatSubscriptionInviteLink($chatId, $subscriptionPeriod, $subscriptionPrice, $name),
3✔
480
        );
3✔
481
    }
482

483
    /**
484
     * @see https://core.telegram.org/bots/api#createforumtopic
485
     */
486
    public function createForumTopic(
3✔
487
        int|string $chatId,
488
        string $name,
489
        ?int $iconColor = null,
490
        ?string $iconCustomEmojiId = null,
491
    ): FailResult|ForumTopic {
492
        return $this->call(
3✔
493
            new CreateForumTopic($chatId, $name, $iconColor, $iconCustomEmojiId),
3✔
494
        );
3✔
495
    }
496

497
    /**
498
     * @see https://core.telegram.org/bots/api#createinvoicelink
499
     *
500
     * @param LabeledPrice[] $prices
501
     * @param int[]|null $suggestedTipAmounts
502
     */
503
    public function createInvoiceLink(
3✔
504
        string $title,
505
        string $description,
506
        string $payload,
507
        string $currency,
508
        array $prices,
509
        ?string $providerToken = null,
510
        ?int $maxTipAmount = null,
511
        ?array $suggestedTipAmounts = null,
512
        ?string $providerData = null,
513
        ?string $photoUrl = null,
514
        ?int $photoSize = null,
515
        ?int $photoWidth = null,
516
        ?int $photoHeight = null,
517
        ?bool $needName = null,
518
        ?bool $needPhoneNumber = null,
519
        ?bool $needEmail = null,
520
        ?bool $needShippingAddress = null,
521
        ?bool $sendPhoneNumberToProvider = null,
522
        ?bool $sendEmailToProvider = null,
523
        ?bool $isFlexible = null,
524
        ?int $subscriptionPeriod = null,
525
        ?string $businessConnectionId = null,
526
    ): FailResult|string {
527
        return $this->call(
3✔
528
            new CreateInvoiceLink(
3✔
529
                $title,
3✔
530
                $description,
3✔
531
                $payload,
3✔
532
                $currency,
3✔
533
                $prices,
3✔
534
                $providerToken,
3✔
535
                $maxTipAmount,
3✔
536
                $suggestedTipAmounts,
3✔
537
                $providerData,
3✔
538
                $photoUrl,
3✔
539
                $photoSize,
3✔
540
                $photoWidth,
3✔
541
                $photoHeight,
3✔
542
                $needName,
3✔
543
                $needPhoneNumber,
3✔
544
                $needEmail,
3✔
545
                $needShippingAddress,
3✔
546
                $sendPhoneNumberToProvider,
3✔
547
                $sendEmailToProvider,
3✔
548
                $isFlexible,
3✔
549
                $subscriptionPeriod,
3✔
550
                $businessConnectionId,
3✔
551
            ),
3✔
552
        );
3✔
553
    }
554

555
    /**
556
     * @see https://core.telegram.org/bots/api#createnewstickerset
557
     *
558
     * @param InputSticker[] $stickers
559
     */
560
    public function createNewStickerSet(
3✔
561
        int $userId,
562
        string $name,
563
        string $title,
564
        array $stickers,
565
        ?string $stickerType = null,
566
        ?bool $needsRepainting = null,
567
    ): FailResult|true {
568
        return $this->call(
3✔
569
            new CreateNewStickerSet($userId, $name, $title, $stickers, $stickerType, $needsRepainting),
3✔
570
        );
3✔
571
    }
572

573
    /**
574
     * @see https://core.telegram.org/bots/api#declinechatjoinrequest
575
     */
576
    public function declineChatJoinRequest(int|string $chatId, int $userId): FailResult|true
3✔
577
    {
578
        return $this->call(
3✔
579
            new DeclineChatJoinRequest($chatId, $userId),
3✔
580
        );
3✔
581
    }
582

583
    /**
584
     * @see https://core.telegram.org/bots/api#deletechatphoto
585
     */
586
    public function deleteChatPhoto(int|string $chatId): FailResult|true
3✔
587
    {
588
        return $this->call(
3✔
589
            new DeleteChatPhoto($chatId),
3✔
590
        );
3✔
591
    }
592

593
    /**
594
     * @see https://core.telegram.org/bots/api#deletechatstickerset
595
     */
596
    public function deleteChatStickerSet(int|string $chatId): FailResult|true
3✔
597
    {
598
        return $this->call(
3✔
599
            new DeleteChatStickerSet($chatId),
3✔
600
        );
3✔
601
    }
602

603
    /**
604
     * @see https://core.telegram.org/bots/api#deleteforumtopic
605
     */
606
    public function deleteForumTopic(int|string $chatId, int $messageThreadId): FailResult|true
3✔
607
    {
608
        return $this->call(new DeleteForumTopic($chatId, $messageThreadId));
3✔
609
    }
610

611
    /**
612
     * @see https://core.telegram.org/bots/api#deletemessage
613
     */
614
    public function deleteMessage(int|string $chatId, int $messageId): FailResult|true
3✔
615
    {
616
        return $this->call(new DeleteMessage($chatId, $messageId));
3✔
617
    }
618

619
    /**
620
     * @see https://core.telegram.org/bots/api#deletemessages
621
     *
622
     * @param int[] $messageIds
623
     */
624
    public function deleteMessages(int|string $chatId, array $messageIds): FailResult|true
3✔
625
    {
626
        return $this->call(new DeleteMessages($chatId, $messageIds));
3✔
627
    }
628

629
    /**
630
     * @see https://core.telegram.org/bots/api#deletemycommands
631
     */
632
    public function deleteMyCommands(?BotCommandScope $scope = null, ?string $languageCode = null): FailResult|true
3✔
633
    {
634
        return $this->call(new DeleteMyCommands($scope, $languageCode));
3✔
635
    }
636

637
    /**
638
     * @see https://core.telegram.org/bots/api#deletestickerfromset
639
     */
640
    public function deleteStickerFromSet(string $sticker): FailResult|true
3✔
641
    {
642
        return $this->call(
3✔
643
            new DeleteStickerFromSet($sticker),
3✔
644
        );
3✔
645
    }
646

647
    /**
648
     * @see https://core.telegram.org/bots/api#deletestickerset
649
     */
650
    public function deleteStickerSet(string $name): FailResult|true
3✔
651
    {
652
        return $this->call(new DeleteStickerSet($name));
3✔
653
    }
654

655
    /**
656
     * @see https://core.telegram.org/bots/api#editchatinvitelink
657
     */
658
    public function editChatInviteLink(
3✔
659
        int|string $chatId,
660
        string $inviteLink,
661
        ?string $name = null,
662
        ?DateTimeImmutable $expireDate = null,
663
        ?int $memberLimit = null,
664
        ?bool $createsJoinRequest = null,
665
    ): FailResult|ChatInviteLink {
666
        return $this->call(
3✔
667
            new EditChatInviteLink($chatId, $inviteLink, $name, $expireDate, $memberLimit, $createsJoinRequest),
3✔
668
        );
3✔
669
    }
670

671
    /**
672
     * @see https://core.telegram.org/bots/api#editchatsubscriptioninvitelink
673
     */
674
    public function editChatSubscriptionInviteLink(
3✔
675
        int|string $chatId,
676
        string $inviteLink,
677
        ?string $name = null,
678
    ): FailResult|ChatInviteLink {
679
        return $this->call(
3✔
680
            new EditChatSubscriptionInviteLink($chatId, $inviteLink, $name),
3✔
681
        );
3✔
682
    }
683

684
    /**
685
     * @see https://core.telegram.org/bots/api#editforumtopic
686
     */
687
    public function editForumTopic(
3✔
688
        int|string $chatId,
689
        int $messageThreadId,
690
        ?string $name = null,
691
        ?string $iconCustomEmojiId = null,
692
    ): FailResult|true {
693
        return $this->call(
3✔
694
            new EditForumTopic($chatId, $messageThreadId, $name, $iconCustomEmojiId),
3✔
695
        );
3✔
696
    }
697

698
    /**
699
     * @see https://core.telegram.org/bots/api#editgeneralforumtopic
700
     */
701
    public function editGeneralForumTopic(int|string $chatId, string $name): FailResult|true
3✔
702
    {
703
        return $this->call(
3✔
704
            new EditGeneralForumTopic($chatId, $name),
3✔
705
        );
3✔
706
    }
707

708
    /**
709
     * @see https://core.telegram.org/bots/api#editmessagecaption
710
     *
711
     * @param MessageEntity[]|null $captionEntities
712
     */
713
    public function editMessageCaption(
3✔
714
        ?string $businessConnectionId = null,
715
        int|string|null $chatId = null,
716
        ?int $messageId = null,
717
        ?string $inlineMessageId = null,
718
        ?string $caption = null,
719
        ?string $parseMode = null,
720
        ?array $captionEntities = null,
721
        ?bool $showCaptionAboveMedia = null,
722
        ?InlineKeyboardMarkup $replyMarkup = null,
723
    ): FailResult|Message|true {
724
        return $this->call(
3✔
725
            new EditMessageCaption(
3✔
726
                $businessConnectionId,
3✔
727
                $chatId,
3✔
728
                $messageId,
3✔
729
                $inlineMessageId,
3✔
730
                $caption,
3✔
731
                $parseMode,
3✔
732
                $captionEntities,
3✔
733
                $showCaptionAboveMedia,
3✔
734
                $replyMarkup,
3✔
735
            ),
3✔
736
        );
3✔
737
    }
738

739
    /**
740
     * @see https://core.telegram.org/bots/api#editmessagelivelocation
741
     */
742
    public function editMessageLiveLocation(
3✔
743
        float $latitude,
744
        float $longitude,
745
        ?string $businessConnectionId = null,
746
        int|string|null $chatId = null,
747
        ?int $messageId = null,
748
        ?string $inlineMessageId = null,
749
        ?int $livePeriod = null,
750
        ?float $horizontalAccuracy = null,
751
        ?int $heading = null,
752
        ?int $proximityAlertRadius = null,
753
        ?InlineKeyboardMarkup $replyMarkup = null,
754
    ): FailResult|Message|true {
755
        return $this->call(
3✔
756
            new EditMessageLiveLocation(
3✔
757
                $latitude,
3✔
758
                $longitude,
3✔
759
                $businessConnectionId,
3✔
760
                $chatId,
3✔
761
                $messageId,
3✔
762
                $inlineMessageId,
3✔
763
                $livePeriod,
3✔
764
                $horizontalAccuracy,
3✔
765
                $heading,
3✔
766
                $proximityAlertRadius,
3✔
767
                $replyMarkup,
3✔
768
            ),
3✔
769
        );
3✔
770
    }
771

772
    /**
773
     * @see https://core.telegram.org/bots/api#editmessagemedia
774
     */
775
    public function editMessageMedia(
3✔
776
        InputMedia $media,
777
        ?string $businessConnectionId = null,
778
        int|string|null $chatId = null,
779
        ?int $messageId = null,
780
        ?string $inlineMessageId = null,
781
        ?InlineKeyboardMarkup $replyMarkup = null,
782
    ): FailResult|Message|true {
783
        return $this->call(
3✔
784
            new EditMessageMedia(
3✔
785
                $media,
3✔
786
                $businessConnectionId,
3✔
787
                $chatId,
3✔
788
                $messageId,
3✔
789
                $inlineMessageId,
3✔
790
                $replyMarkup,
3✔
791
            ),
3✔
792
        );
3✔
793
    }
794

795
    /**
796
     * @see https://core.telegram.org/bots/api#editmessagereplymarkup
797
     */
798
    public function editMessageReplyMarkup(
3✔
799
        ?string $businessConnectionId = null,
800
        int|string|null $chatId = null,
801
        ?int $messageId = null,
802
        ?string $inlineMessageId = null,
803
        ?InlineKeyboardMarkup $replyMarkup = null,
804
    ): FailResult|Message|true {
805
        return $this->call(
3✔
806
            new EditMessageReplyMarkup(
3✔
807
                $businessConnectionId,
3✔
808
                $chatId,
3✔
809
                $messageId,
3✔
810
                $inlineMessageId,
3✔
811
                $replyMarkup,
3✔
812
            ),
3✔
813
        );
3✔
814
    }
815

816
    /**
817
     * @see https://core.telegram.org/bots/api#editmessagetext
818
     *
819
     * @param MessageEntity[]|null $entities
820
     */
821
    public function editMessageText(
3✔
822
        string $text,
823
        ?string $businessConnectionId = null,
824
        int|string|null $chatId = null,
825
        ?int $messageId = null,
826
        ?string $inlineMessageId = null,
827
        ?string $parseMode = null,
828
        ?array $entities = null,
829
        ?LinkPreviewOptions $linkPreviewOptions = null,
830
        ?InlineKeyboardMarkup $replyMarkup = null,
831
    ): FailResult|Message|true {
832
        return $this->call(
3✔
833
            new EditMessageText(
3✔
834
                $text,
3✔
835
                $businessConnectionId,
3✔
836
                $chatId,
3✔
837
                $messageId,
3✔
838
                $inlineMessageId,
3✔
839
                $parseMode,
3✔
840
                $entities,
3✔
841
                $linkPreviewOptions,
3✔
842
                $replyMarkup,
3✔
843
            ),
3✔
844
        );
3✔
845
    }
846

847
    /**
848
     * @see https://core.telegram.org/bots/api#edituserstarsubscription
849
     */
850
    public function editUserStarSubscription(
3✔
851
        int $userId,
852
        string $telegramPaymentChargeId,
853
        bool $isCanceled,
854
    ): FailResult|true {
855
        return $this->call(
3✔
856
            new EditUserStarSubscription(
3✔
857
                $userId,
3✔
858
                $telegramPaymentChargeId,
3✔
859
                $isCanceled,
3✔
860
            ),
3✔
861
        );
3✔
862
    }
863

864
    /**
865
     * @see https://core.telegram.org/bots/api#exportchatinvitelink
866
     */
867
    public function exportChatInviteLink(int|string $chatId): FailResult|string
3✔
868
    {
869
        return $this->call(
3✔
870
            new ExportChatInviteLink($chatId),
3✔
871
        );
3✔
872
    }
873

874
    /**
875
     * @see https://core.telegram.org/bots/api#forwardmessage
876
     */
877
    public function forwardMessage(
3✔
878
        int|string $chatId,
879
        int|string $fromChatId,
880
        int $messageId,
881
        ?int $messageThreadId = null,
882
        ?bool $disableNotification = null,
883
        ?bool $protectContent = null,
884
        ?int $videoStartTimestamp = null,
885
    ): FailResult|Message {
886
        return $this->call(
3✔
887
            new ForwardMessage(
3✔
888
                $chatId,
3✔
889
                $fromChatId,
3✔
890
                $messageId,
3✔
891
                $messageThreadId,
3✔
892
                $disableNotification,
3✔
893
                $protectContent,
3✔
894
                $videoStartTimestamp,
3✔
895
            ),
3✔
896
        );
3✔
897
    }
898

899
    /**
900
     * @param int[] $messageIds
901
     * @return FailResult|MessageId[]
902
     *
903
     * @see https://core.telegram.org/bots/api#forwardmessages
904
     */
905
    public function forwardMessages(
3✔
906
        int|string $chatId,
907
        int|string $fromChatId,
908
        array $messageIds,
909
        ?int $messageThreadId = null,
910
        ?bool $disableNotification = null,
911
        ?bool $protectContent = null,
912
    ): FailResult|array {
913
        return $this->call(
3✔
914
            new ForwardMessages(
3✔
915
                $chatId,
3✔
916
                $fromChatId,
3✔
917
                $messageIds,
3✔
918
                $messageThreadId,
3✔
919
                $disableNotification,
3✔
920
                $protectContent,
3✔
921
            ),
3✔
922
        );
3✔
923
    }
924

925
    /**
926
     * @see https://core.telegram.org/bots/api#deletewebhook
927
     */
928
    public function deleteWebhook(?bool $dropPendingUpdates = null): FailResult|true
3✔
929
    {
930
        return $this->call(new DeleteWebhook($dropPendingUpdates));
3✔
931
    }
932

933
    /**
934
     * @see https://core.telegram.org/bots/api#getavailablegifts
935
     */
936
    public function getAvailableGifts(): FailResult|Gifts
3✔
937
    {
938
        return $this->call(new GetAvailableGifts());
3✔
939
    }
940

941
    /**
942
     * @see https://core.telegram.org/bots/api#getbusinessconnection
943
     */
944
    public function getBusinessConnection(string $businessConnectionId): FailResult|BusinessConnection
3✔
945
    {
946
        return $this->call(new GetBusinessConnection($businessConnectionId));
3✔
947
    }
948

949
    /**
950
     * @see https://core.telegram.org/bots/api#getchat
951
     */
952
    public function getChat(int|string $chatId): FailResult|ChatFullInfo
3✔
953
    {
954
        return $this->call(new GetChat($chatId));
3✔
955
    }
956

957
    /**
958
     * @see https://core.telegram.org/bots/api#getchatadministrators
959
     *
960
     * @return FailResult|ChatMember[]
961
     */
962
    public function getChatAdministrators(int|string $chatId): FailResult|array
3✔
963
    {
964
        return $this->call(new GetChatAdministrators($chatId));
3✔
965
    }
966

967
    /**
968
     * @see https://core.telegram.org/bots/api#getchatmembercount
969
     */
970
    public function getChatMemberCount(int|string $chatId): FailResult|int
3✔
971
    {
972
        return $this->call(new GetChatMemberCount($chatId));
3✔
973
    }
974

975
    /**
976
     * @see https://core.telegram.org/bots/api#getchatmember
977
     */
978
    public function getChatMember(int|string $chatId, int $userId): FailResult|ChatMember
3✔
979
    {
980
        return $this->call(new GetChatMember($chatId, $userId));
3✔
981
    }
982

983
    /**
984
     * @see https://core.telegram.org/bots/api#getchatmenubutton
985
     */
986
    public function getChatMenuButton(?int $chatId = null): FailResult|MenuButton
3✔
987
    {
988
        return $this->call(new GetChatMenuButton($chatId));
3✔
989
    }
990

991
    /**
992
     * @see https://core.telegram.org/bots/api#getcustomemojistickers
993
     *
994
     * @param string[] $customEmojiIds
995
     * @return FailResult|Sticker[]
996
     */
997
    public function getCustomEmojiStickers(array $customEmojiIds): FailResult|array
3✔
998
    {
999
        return $this->call(new GetCustomEmojiStickers($customEmojiIds));
3✔
1000
    }
1001

1002
    /**
1003
     * @see https://core.telegram.org/bots/api#getfile
1004
     */
1005
    public function getFile(string $fileId): FailResult|File
3✔
1006
    {
1007
        return $this->call(new GetFile($fileId));
3✔
1008
    }
1009

1010
    /**
1011
     * @see https://core.telegram.org/bots/api#getforumtopiciconstickers
1012
     *
1013
     * @return FailResult|Sticker[]
1014
     */
1015
    public function getForumTopicIconStickers(): FailResult|array
3✔
1016
    {
1017
        return $this->call(new GetForumTopicIconStickers());
3✔
1018
    }
1019

1020
    /**
1021
     * @see https://core.telegram.org/bots/api#getgamehighscores
1022
     *
1023
     * @return FailResult|GameHighScore[]
1024
     */
1025
    public function getGameHighScores(
3✔
1026
        int $userId,
1027
        ?int $chatId = null,
1028
        ?int $messageId = null,
1029
        ?string $inlineMessageId = null,
1030
    ): FailResult|array {
1031
        return $this->call(
3✔
1032
            new GetGameHighScores($userId, $chatId, $messageId, $inlineMessageId),
3✔
1033
        );
3✔
1034
    }
1035

1036
    /**
1037
     * @see https://core.telegram.org/bots/api#getchat
1038
     */
1039
    public function getMe(): FailResult|User
3✔
1040
    {
1041
        return $this->call(new GetMe());
3✔
1042
    }
1043

1044
    /**
1045
     * @see https://core.telegram.org/bots/api#getmycommands
1046
     */
1047
    public function getMyCommands(?BotCommandScope $scope = null, ?string $languageCode = null): FailResult|array
3✔
1048
    {
1049
        return $this->call(new GetMyCommands($scope, $languageCode));
3✔
1050
    }
1051

1052
    /**
1053
     * @see https://core.telegram.org/bots/api#getmydefaultadministratorrights
1054
     */
1055
    public function getMyDefaultAdministratorRights(?bool $forChannels = null): FailResult|ChatAdministratorRights
3✔
1056
    {
1057
        return $this->call(new GetMyDefaultAdministratorRights($forChannels));
3✔
1058
    }
1059

1060
    /**
1061
     * @see https://core.telegram.org/bots/api#getmydescription
1062
     */
1063
    public function getMyDescription(?string $languageCode = null): FailResult|BotDescription
3✔
1064
    {
1065
        return $this->call(new GetMyDescription($languageCode));
3✔
1066
    }
1067

1068
    /**
1069
     * @see https://core.telegram.org/bots/api#getmyname
1070
     */
1071
    public function getMyName(?string $languageCode = null): FailResult|BotName
3✔
1072
    {
1073
        return $this->call(new GetMyName($languageCode));
3✔
1074
    }
1075

1076
    /**
1077
     * @see https://core.telegram.org/bots/api#getmyshortdescription
1078
     */
1079
    public function getMyShortDescription(?string $languageCode = null): FailResult|BotShortDescription
3✔
1080
    {
1081
        return $this->call(new GetMyShortDescription($languageCode));
3✔
1082
    }
1083

1084
    /**
1085
     * @see https://core.telegram.org/bots/api#getstartransactions
1086
     */
1087
    public function getStarTransactions(?int $offset = null, ?int $limit = null): FailResult|StarTransactions
3✔
1088
    {
1089
        return $this->call(
3✔
1090
            new GetStarTransactions($offset, $limit),
3✔
1091
        );
3✔
1092
    }
1093

1094
    /**
1095
     * @see https://core.telegram.org/bots/api#getstickerset
1096
     */
1097
    public function getStickerSet(string $name): FailResult|StickerSet
3✔
1098
    {
1099
        return $this->call(
3✔
1100
            new GetStickerSet($name),
3✔
1101
        );
3✔
1102
    }
1103

1104
    /**
1105
     * @see https://core.telegram.org/bots/api#getupdates
1106
     *
1107
     * @param string[]|null $allowedUpdates
1108
     * @return FailResult|Update[]
1109
     */
1110
    public function getUpdates(
3✔
1111
        ?int $offset = null,
1112
        ?int $limit = null,
1113
        ?int $timeout = null,
1114
        ?array $allowedUpdates = null,
1115
    ): FailResult|array {
1116
        return $this->call(new GetUpdates($offset, $limit, $timeout, $allowedUpdates));
3✔
1117
    }
1118

1119
    /**
1120
     * @see https://core.telegram.org/bots/api#getuserchatboosts
1121
     */
1122
    public function getUserChatBoosts(int|string $chatId, int $userId): FailResult|UserChatBoosts
3✔
1123
    {
1124
        return $this->call(
3✔
1125
            new GetUserChatBoosts($chatId, $userId),
3✔
1126
        );
3✔
1127
    }
1128

1129
    /**
1130
     * @see https://core.telegram.org/bots/api#getuserprofilephotos
1131
     */
1132
    public function getUserProfilePhotos(
3✔
1133
        int $userId,
1134
        ?int $offset = null,
1135
        ?int $limit = null,
1136
    ): FailResult|UserProfilePhotos {
1137
        return $this->call(
3✔
1138
            new GetUserProfilePhotos($userId, $offset, $limit),
3✔
1139
        );
3✔
1140
    }
1141

1142
    /**
1143
     * @see https://core.telegram.org/bots/api#getwebhookinfo
1144
     */
1145
    public function getWebhookInfo(): FailResult|WebhookInfo
3✔
1146
    {
1147
        return $this->call(new GetWebhookInfo());
3✔
1148
    }
1149

1150
    /**
1151
     * @see https://core.telegram.org/bots/api#hidegeneralforumtopic
1152
     */
1153
    public function hideGeneralForumTopic(int|string $chatId): FailResult|true
3✔
1154
    {
1155
        return $this->call(
3✔
1156
            new HideGeneralForumTopic($chatId),
3✔
1157
        );
3✔
1158
    }
1159

1160
    /**
1161
     * @see https://core.telegram.org/bots/api#leavechat
1162
     */
1163
    public function leaveChat(int|string $chatId): FailResult|true
3✔
1164
    {
1165
        return $this->call(
3✔
1166
            new LeaveChat($chatId),
3✔
1167
        );
3✔
1168
    }
1169

1170
    /**
1171
     * @see https://core.telegram.org/bots/api#logout
1172
     */
1173
    public function logOut(): FailResult|true
3✔
1174
    {
1175
        return $this->call(new LogOut());
3✔
1176
    }
1177

1178
    /**
1179
     * @see https://core.telegram.org/bots/api#pinchatmessage
1180
     */
1181
    public function pinChatMessage(
3✔
1182
        int|string $chatId,
1183
        int $messageId,
1184
        ?bool $disableNotification = null,
1185
    ): FailResult|true {
1186
        return $this->call(
3✔
1187
            new PinChatMessage($chatId, $messageId, $disableNotification),
3✔
1188
        );
3✔
1189
    }
1190

1191
    /**
1192
     * @see https://core.telegram.org/bots/api#promotechatmember
1193
     */
1194
    public function promoteChatMember(
3✔
1195
        int|string $chatId,
1196
        int $userId,
1197
        ?bool $isAnonymous = null,
1198
        ?bool $canManageChat = null,
1199
        ?bool $canDeleteMessages = null,
1200
        ?bool $canManageVideoChats = null,
1201
        ?bool $canRestrictMembers = null,
1202
        ?bool $canPromoteMembers = null,
1203
        ?bool $canChangeInfo = null,
1204
        ?bool $canInviteUsers = null,
1205
        ?bool $canPostStories = null,
1206
        ?bool $canEditStories = null,
1207
        ?bool $canDeleteStories = null,
1208
        ?bool $canPostMessages = null,
1209
        ?bool $canEditMessages = null,
1210
        ?bool $canPinMessages = null,
1211
        ?bool $canManageTopics = null,
1212
    ): FailResult|true {
1213
        return $this->call(
3✔
1214
            new PromoteChatMember(
3✔
1215
                $chatId,
3✔
1216
                $userId,
3✔
1217
                $isAnonymous,
3✔
1218
                $canManageChat,
3✔
1219
                $canDeleteMessages,
3✔
1220
                $canManageVideoChats,
3✔
1221
                $canRestrictMembers,
3✔
1222
                $canPromoteMembers,
3✔
1223
                $canChangeInfo,
3✔
1224
                $canInviteUsers,
3✔
1225
                $canPostStories,
3✔
1226
                $canEditStories,
3✔
1227
                $canDeleteStories,
3✔
1228
                $canPostMessages,
3✔
1229
                $canEditMessages,
3✔
1230
                $canPinMessages,
3✔
1231
                $canManageTopics,
3✔
1232
            ),
3✔
1233
        );
3✔
1234
    }
1235

1236
    /**
1237
     * @see https://core.telegram.org/bots/api#refundstarpayment
1238
     */
1239
    public function refundStarPayment(int $userId, string $telegramPaymentChargeId): FailResult|true
3✔
1240
    {
1241
        return $this->call(
3✔
1242
            new RefundStarPayment($userId, $telegramPaymentChargeId),
3✔
1243
        );
3✔
1244
    }
1245

1246
    /**
1247
     * @see https://core.telegram.org/bots/api#removechatverification
1248
     */
1249
    public function removeChatVerification(int|string $chatId): FailResult|true
3✔
1250
    {
1251
        return $this->call(
3✔
1252
            new RemoveChatVerification($chatId),
3✔
1253
        );
3✔
1254
    }
1255

1256
    /**
1257
     * @see https://core.telegram.org/bots/api#removeuserverification
1258
     */
1259
    public function removeUserVerification(int $userId): FailResult|true
3✔
1260
    {
1261
        return $this->call(
3✔
1262
            new RemoveUserVerification($userId),
3✔
1263
        );
3✔
1264
    }
1265

1266
    /**
1267
     * @see https://core.telegram.org/bots/api#reopenforumtopic
1268
     */
1269
    public function reopenForumTopic(int|string $chatId, int $messageThreadId): FailResult|true
3✔
1270
    {
1271
        return $this->call(
3✔
1272
            new ReopenForumTopic($chatId, $messageThreadId),
3✔
1273
        );
3✔
1274
    }
1275

1276
    /**
1277
     * @see https://core.telegram.org/bots/api#reopengeneralforumtopic
1278
     */
1279
    public function reopenGeneralForumTopic(int|string $chatId): FailResult|true
3✔
1280
    {
1281
        return $this->call(
3✔
1282
            new ReopenGeneralForumTopic($chatId),
3✔
1283
        );
3✔
1284
    }
1285

1286
    /**
1287
     * @see https://core.telegram.org/bots/api#replacestickerinset
1288
     */
1289
    public function replaceStickerInSet(
3✔
1290
        int $userId,
1291
        string $name,
1292
        string $oldSticker,
1293
        InputSticker $sticker,
1294
    ): FailResult|true {
1295
        return $this->call(
3✔
1296
            new ReplaceStickerInSet($userId, $name, $oldSticker, $sticker),
3✔
1297
        );
3✔
1298
    }
1299

1300
    /**
1301
     * @see https://core.telegram.org/bots/api#restrictchatmember
1302
     */
1303
    public function restrictChatMember(
3✔
1304
        int|string $chatId,
1305
        int $userId,
1306
        ChatPermissions $permissions,
1307
        ?bool $useIndependentChatPermissions = null,
1308
        ?DateTimeImmutable $untilDate = null,
1309
    ): FailResult|true {
1310
        return $this->call(
3✔
1311
            new RestrictChatMember($chatId, $userId, $permissions, $useIndependentChatPermissions, $untilDate),
3✔
1312
        );
3✔
1313
    }
1314

1315
    /**
1316
     * @see https://core.telegram.org/bots/api#revokechatinvitelink
1317
     */
1318
    public function revokeChatInviteLink(int|string $chatId, string $inviteLink): FailResult|ChatInviteLink
3✔
1319
    {
1320
        return $this->call(
3✔
1321
            new RevokeChatInviteLink($chatId, $inviteLink),
3✔
1322
        );
3✔
1323
    }
1324

1325
    /**
1326
     * @see https://core.telegram.org/bots/api#savepreparedinlinemessage
1327
     */
1328
    public function savePreparedInlineMessage(
3✔
1329
        int $userId,
1330
        InlineQueryResult $result,
1331
        ?bool $allowUserChats = null,
1332
        ?bool $allowBotChats = null,
1333
        ?bool $allowGroupChats = null,
1334
        ?bool $allowChannelChats = null,
1335
    ): FailResult|PreparedInlineMessage {
1336
        return $this->call(
3✔
1337
            new SavePreparedInlineMessage(
3✔
1338
                $userId,
3✔
1339
                $result,
3✔
1340
                $allowUserChats,
3✔
1341
                $allowBotChats,
3✔
1342
                $allowGroupChats,
3✔
1343
                $allowChannelChats,
3✔
1344
            ),
3✔
1345
        );
3✔
1346
    }
1347

1348
    /**
1349
     * @param MessageEntity[]|null $captionEntities
1350
     *
1351
     * @see https://core.telegram.org/bots/api#sendanimation
1352
     */
1353
    public function sendAnimation(
3✔
1354
        int|string $chatId,
1355
        InputFile|string $animation,
1356
        ?string $businessConnectionId = null,
1357
        ?int $messageThreadId = null,
1358
        ?int $duration = null,
1359
        ?int $width = null,
1360
        ?int $height = null,
1361
        InputFile|string|null $thumbnail = null,
1362
        ?string $caption = null,
1363
        ?string $parseMode = null,
1364
        ?array $captionEntities = null,
1365
        ?bool $showCaptionAboveMedia = null,
1366
        ?bool $hasSpoiler = null,
1367
        ?bool $disableNotification = null,
1368
        ?bool $protectContent = null,
1369
        ?string $messageEffectId = null,
1370
        ?ReplyParameters $replyParameters = null,
1371
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
1372
        ?bool $allowPaidBroadcast = null,
1373
    ): FailResult|Message {
1374
        return $this->call(
3✔
1375
            new SendAnimation(
3✔
1376
                $chatId,
3✔
1377
                $animation,
3✔
1378
                $businessConnectionId,
3✔
1379
                $messageThreadId,
3✔
1380
                $duration,
3✔
1381
                $width,
3✔
1382
                $height,
3✔
1383
                $thumbnail,
3✔
1384
                $caption,
3✔
1385
                $parseMode,
3✔
1386
                $captionEntities,
3✔
1387
                $showCaptionAboveMedia,
3✔
1388
                $hasSpoiler,
3✔
1389
                $disableNotification,
3✔
1390
                $protectContent,
3✔
1391
                $messageEffectId,
3✔
1392
                $replyParameters,
3✔
1393
                $replyMarkup,
3✔
1394
                $allowPaidBroadcast,
3✔
1395
            ),
3✔
1396
        );
3✔
1397
    }
1398

1399
    /**
1400
     * @param MessageEntity[]|null $captionEntities
1401
     *
1402
     * @see https://core.telegram.org/bots/api#sendaudio
1403
     */
1404
    public function sendAudio(
3✔
1405
        int|string $chatId,
1406
        string|InputFile $audio,
1407
        ?string $businessConnectionId = null,
1408
        ?int $messageThreadId = null,
1409
        ?string $caption = null,
1410
        ?string $parseMode = null,
1411
        ?array $captionEntities = null,
1412
        ?int $duration = null,
1413
        ?string $performer = null,
1414
        ?string $title = null,
1415
        string|InputFile|null $thumbnail = null,
1416
        ?bool $disableNotification = null,
1417
        ?bool $protectContent = null,
1418
        ?string $messageEffectId = null,
1419
        ?ReplyParameters $replyParameters = null,
1420
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
1421
        ?bool $allowPaidBroadcast = null,
1422
    ): FailResult|Message {
1423
        return $this->call(
3✔
1424
            new SendAudio(
3✔
1425
                $chatId,
3✔
1426
                $audio,
3✔
1427
                $businessConnectionId,
3✔
1428
                $messageThreadId,
3✔
1429
                $caption,
3✔
1430
                $parseMode,
3✔
1431
                $captionEntities,
3✔
1432
                $duration,
3✔
1433
                $performer,
3✔
1434
                $title,
3✔
1435
                $thumbnail,
3✔
1436
                $disableNotification,
3✔
1437
                $protectContent,
3✔
1438
                $messageEffectId,
3✔
1439
                $replyParameters,
3✔
1440
                $replyMarkup,
3✔
1441
                $allowPaidBroadcast,
3✔
1442
            ),
3✔
1443
        );
3✔
1444
    }
1445

1446
    /**
1447
     * @see https://core.telegram.org/bots/api#sendchataction
1448
     */
1449
    public function sendChatAction(
3✔
1450
        int|string $chatId,
1451
        string $action,
1452
        ?string $businessConnectionId = null,
1453
        ?int $messageThreadId = null,
1454
    ): FailResult|true {
1455
        return $this->call(
3✔
1456
            new SendChatAction(
3✔
1457
                $chatId,
3✔
1458
                $action,
3✔
1459
                $businessConnectionId,
3✔
1460
                $messageThreadId,
3✔
1461
            ),
3✔
1462
        );
3✔
1463
    }
1464

1465
    /**
1466
     * @see https://core.telegram.org/bots/api#sendcontact
1467
     */
1468
    public function sendContact(
3✔
1469
        int|string $chatId,
1470
        string $phoneNumber,
1471
        string $firstName,
1472
        ?string $businessConnectionId = null,
1473
        ?int $messageThreadId = null,
1474
        ?string $lastName = null,
1475
        ?string $vcard = null,
1476
        ?bool $disableNotification = null,
1477
        ?bool $protectContent = null,
1478
        ?string $messageEffectId = null,
1479
        ?ReplyParameters $replyParameters = null,
1480
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
1481
        ?bool $allowPaidBroadcast = null,
1482
    ): FailResult|Message {
1483
        return $this->call(
3✔
1484
            new SendContact(
3✔
1485
                $chatId,
3✔
1486
                $phoneNumber,
3✔
1487
                $firstName,
3✔
1488
                $businessConnectionId,
3✔
1489
                $messageThreadId,
3✔
1490
                $lastName,
3✔
1491
                $vcard,
3✔
1492
                $disableNotification,
3✔
1493
                $protectContent,
3✔
1494
                $messageEffectId,
3✔
1495
                $replyParameters,
3✔
1496
                $replyMarkup,
3✔
1497
                $allowPaidBroadcast,
3✔
1498
            ),
3✔
1499
        );
3✔
1500
    }
1501

1502
    /**
1503
     * @see https://core.telegram.org/bots/api#senddice
1504
     */
1505
    public function sendDice(
3✔
1506
        int|string $chatId,
1507
        ?string $businessConnectionId = null,
1508
        ?int $messageThreadId = null,
1509
        ?string $emoji = null,
1510
        ?bool $disableNotification = null,
1511
        ?bool $protectContent = null,
1512
        ?string $messageEffectId = null,
1513
        ?ReplyParameters $replyParameters = null,
1514
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
1515
        ?bool $allowPaidBroadcast = null,
1516
    ): FailResult|Message {
1517
        return $this->call(
3✔
1518
            new SendDice(
3✔
1519
                $chatId,
3✔
1520
                $businessConnectionId,
3✔
1521
                $messageThreadId,
3✔
1522
                $emoji,
3✔
1523
                $disableNotification,
3✔
1524
                $protectContent,
3✔
1525
                $messageEffectId,
3✔
1526
                $replyParameters,
3✔
1527
                $replyMarkup,
3✔
1528
                $allowPaidBroadcast,
3✔
1529
            ),
3✔
1530
        );
3✔
1531
    }
1532

1533
    /**
1534
     * @param MessageEntity[]|null $captionEntities
1535
     *
1536
     * @see https://core.telegram.org/bots/api#senddocument
1537
     */
1538
    public function sendDocument(
3✔
1539
        int|string $chatId,
1540
        string|InputFile $document,
1541
        ?string $businessConnectionId = null,
1542
        ?int $messageThreadId = null,
1543
        string|InputFile|null $thumbnail = null,
1544
        ?string $caption = null,
1545
        ?string $parseMode = null,
1546
        ?array $captionEntities = null,
1547
        ?bool $disableContentTypeDetection = null,
1548
        ?bool $disableNotification = null,
1549
        ?bool $protectContent = null,
1550
        ?string $messageEffectId = null,
1551
        ?ReplyParameters $replyParameters = null,
1552
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
1553
        ?bool $allowPaidBroadcast = null,
1554
    ): FailResult|Message {
1555
        return $this->call(
3✔
1556
            new SendDocument(
3✔
1557
                $chatId,
3✔
1558
                $document,
3✔
1559
                $businessConnectionId,
3✔
1560
                $messageThreadId,
3✔
1561
                $thumbnail,
3✔
1562
                $caption,
3✔
1563
                $parseMode,
3✔
1564
                $captionEntities,
3✔
1565
                $disableContentTypeDetection,
3✔
1566
                $disableNotification,
3✔
1567
                $protectContent,
3✔
1568
                $messageEffectId,
3✔
1569
                $replyParameters,
3✔
1570
                $replyMarkup,
3✔
1571
                $allowPaidBroadcast,
3✔
1572
            ),
3✔
1573
        );
3✔
1574
    }
1575

1576
    /**
1577
     * @see https://core.telegram.org/bots/api#sendgame
1578
     */
1579
    public function sendGame(
3✔
1580
        int $chatId,
1581
        string $gameShortName,
1582
        ?string $businessConnectionId = null,
1583
        ?int $messageThreadId = null,
1584
        ?bool $disableNotification = null,
1585
        ?bool $protectContent = null,
1586
        ?string $messageEffectId = null,
1587
        ?ReplyParameters $replyParameters = null,
1588
        ?InlineKeyboardMarkup $replyMarkup = null,
1589
        ?bool $allowPaidBroadcast = null,
1590
    ): FailResult|Message {
1591
        return $this->call(
3✔
1592
            new SendGame(
3✔
1593
                $chatId,
3✔
1594
                $gameShortName,
3✔
1595
                $businessConnectionId,
3✔
1596
                $messageThreadId,
3✔
1597
                $disableNotification,
3✔
1598
                $protectContent,
3✔
1599
                $messageEffectId,
3✔
1600
                $replyParameters,
3✔
1601
                $replyMarkup,
3✔
1602
                $allowPaidBroadcast,
3✔
1603
            ),
3✔
1604
        );
3✔
1605
    }
1606

1607
    /**
1608
     * @see https://core.telegram.org/bots/api#sendgift
1609
     *
1610
     * @param MessageEntity[]|null $textEntities
1611
     */
1612
    public function sendGift(
3✔
1613
        int $userId,
1614
        string $giftId,
1615
        ?string $text = null,
1616
        ?string $textParseMode = null,
1617
        ?array $textEntities = null,
1618
        ?bool $payForUpgrade = null,
1619
        int|string|null $chatId = null,
1620
    ): FailResult|true {
1621
        return $this->call(
3✔
1622
            new SendGift(
3✔
1623
                $userId,
3✔
1624
                $giftId,
3✔
1625
                $text,
3✔
1626
                $textParseMode,
3✔
1627
                $textEntities,
3✔
1628
                $payForUpgrade,
3✔
1629
                $chatId,
3✔
1630
            ),
3✔
1631
        );
3✔
1632
    }
1633

1634
    /**
1635
     * @see https://core.telegram.org/bots/api#sendinvoice
1636
     *
1637
     * @param LabeledPrice[] $prices
1638
     * @param int[]|null $suggestedTipAmounts
1639
     */
1640
    public function sendInvoice(
3✔
1641
        int|string $chatId,
1642
        string $title,
1643
        string $description,
1644
        string $payload,
1645
        string $currency,
1646
        array $prices,
1647
        ?int $messageThreadId = null,
1648
        ?string $providerToken = null,
1649
        ?int $maxTipAmount = null,
1650
        ?array $suggestedTipAmounts = null,
1651
        ?string $startParameter = null,
1652
        ?string $providerData = null,
1653
        ?string $photoUrl = null,
1654
        ?int $photoSize = null,
1655
        ?int $photoWidth = null,
1656
        ?int $photoHeight = null,
1657
        ?bool $needName = null,
1658
        ?bool $needPhoneNumber = null,
1659
        ?bool $needEmail = null,
1660
        ?bool $needShippingAddress = null,
1661
        ?bool $sendPhoneNumberToProvider = null,
1662
        ?bool $sendEmailToProvider = null,
1663
        ?bool $isFlexible = null,
1664
        ?bool $disableNotification = null,
1665
        ?bool $protectContent = null,
1666
        ?string $messageEffectId = null,
1667
        ?ReplyParameters $replyParameters = null,
1668
        ?InlineKeyboardMarkup $replyMarkup = null,
1669
        ?bool $allowPaidBroadcast = null,
1670
    ): FailResult|Message {
1671
        return $this->call(
3✔
1672
            new SendInvoice(
3✔
1673
                $chatId,
3✔
1674
                $title,
3✔
1675
                $description,
3✔
1676
                $payload,
3✔
1677
                $currency,
3✔
1678
                $prices,
3✔
1679
                $messageThreadId,
3✔
1680
                $providerToken,
3✔
1681
                $maxTipAmount,
3✔
1682
                $suggestedTipAmounts,
3✔
1683
                $startParameter,
3✔
1684
                $providerData,
3✔
1685
                $photoUrl,
3✔
1686
                $photoSize,
3✔
1687
                $photoWidth,
3✔
1688
                $photoHeight,
3✔
1689
                $needName,
3✔
1690
                $needPhoneNumber,
3✔
1691
                $needEmail,
3✔
1692
                $needShippingAddress,
3✔
1693
                $sendPhoneNumberToProvider,
3✔
1694
                $sendEmailToProvider,
3✔
1695
                $isFlexible,
3✔
1696
                $disableNotification,
3✔
1697
                $protectContent,
3✔
1698
                $messageEffectId,
3✔
1699
                $replyParameters,
3✔
1700
                $replyMarkup,
3✔
1701
                $allowPaidBroadcast,
3✔
1702
            ),
3✔
1703
        );
3✔
1704
    }
1705

1706
    /**
1707
     * @see https://core.telegram.org/bots/api#sendlocation
1708
     */
1709
    public function sendLocation(
3✔
1710
        int|string $chatId,
1711
        float $latitude,
1712
        float $longitude,
1713
        ?string $businessConnectionId = null,
1714
        ?int $messageThreadId = null,
1715
        ?float $horizontalAccuracy = null,
1716
        ?int $livePeriod = null,
1717
        ?int $heading = null,
1718
        ?int $proximityAlertRadius = null,
1719
        ?bool $disableNotification = null,
1720
        ?bool $protectContent = null,
1721
        ?string $messageEffectId = null,
1722
        ?ReplyParameters $replyParameters = null,
1723
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
1724
        ?bool $allowPaidBroadcast = null,
1725
    ): FailResult|Message {
1726
        return $this->call(
3✔
1727
            new SendLocation(
3✔
1728
                $chatId,
3✔
1729
                $latitude,
3✔
1730
                $longitude,
3✔
1731
                $businessConnectionId,
3✔
1732
                $messageThreadId,
3✔
1733
                $horizontalAccuracy,
3✔
1734
                $livePeriod,
3✔
1735
                $heading,
3✔
1736
                $proximityAlertRadius,
3✔
1737
                $disableNotification,
3✔
1738
                $protectContent,
3✔
1739
                $messageEffectId,
3✔
1740
                $replyParameters,
3✔
1741
                $replyMarkup,
3✔
1742
                $allowPaidBroadcast,
3✔
1743
            ),
3✔
1744
        );
3✔
1745
    }
1746

1747
    /**
1748
     * @see https://core.telegram.org/bots/api#sendmediagroup
1749
     *
1750
     * @param InputMediaAudio[]|InputMediaDocument[]|InputMediaPhoto[]|InputMediaVideo[] $media
1751
     * @return FailResult|Message[]
1752
     */
1753
    public function sendMediaGroup(
3✔
1754
        int|string $chatId,
1755
        array $media,
1756
        ?string $businessConnectionId = null,
1757
        ?int $messageThreadId = null,
1758
        ?bool $disableNotification = null,
1759
        ?bool $protectContent = null,
1760
        ?string $messageEffectId = null,
1761
        ?ReplyParameters $replyParameters = null,
1762
        ?bool $allowPaidBroadcast = null,
1763
    ): FailResult|array {
1764
        return $this->call(
3✔
1765
            new SendMediaGroup(
3✔
1766
                $chatId,
3✔
1767
                $media,
3✔
1768
                $businessConnectionId,
3✔
1769
                $messageThreadId,
3✔
1770
                $disableNotification,
3✔
1771
                $protectContent,
3✔
1772
                $messageEffectId,
3✔
1773
                $replyParameters,
3✔
1774
                $allowPaidBroadcast,
3✔
1775
            ),
3✔
1776
        );
3✔
1777
    }
1778

1779
    /**
1780
     * @param MessageEntity[]|null $entities
1781
     *
1782
     * @see https://core.telegram.org/bots/api#sendmessage
1783
     */
1784
    public function sendMessage(
3✔
1785
        int|string $chatId,
1786
        string $text,
1787
        ?string $businessConnectionId = null,
1788
        ?int $messageThreadId = null,
1789
        ?string $parseMode = null,
1790
        ?array $entities = null,
1791
        ?LinkPreviewOptions $linkPreviewOptions = null,
1792
        ?bool $disableNotification = null,
1793
        ?bool $protectContent = null,
1794
        ?string $messageEffectId = null,
1795
        ?ReplyParameters $replyParameters = null,
1796
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
1797
        ?bool $allowPaidBroadcast = null,
1798
    ): FailResult|Message {
1799
        return $this->call(
3✔
1800
            new SendMessage(
3✔
1801
                $chatId,
3✔
1802
                $text,
3✔
1803
                $businessConnectionId,
3✔
1804
                $messageThreadId,
3✔
1805
                $parseMode,
3✔
1806
                $entities,
3✔
1807
                $linkPreviewOptions,
3✔
1808
                $disableNotification,
3✔
1809
                $protectContent,
3✔
1810
                $messageEffectId,
3✔
1811
                $replyParameters,
3✔
1812
                $replyMarkup,
3✔
1813
                $allowPaidBroadcast,
3✔
1814
            ),
3✔
1815
        );
3✔
1816
    }
1817

1818
    /**
1819
     * @see https://core.telegram.org/bots/api#sendpaidmedia
1820
     *
1821
     * @param InputPaidMedia[] $media
1822
     * @param MessageEntity[]|null $captionEntities
1823
     */
1824
    public function sendPaidMedia(
3✔
1825
        int|string $chatId,
1826
        int $starCount,
1827
        array $media,
1828
        ?string $caption = null,
1829
        ?string $parseMode = null,
1830
        ?array $captionEntities = null,
1831
        ?bool $showCaptionAboveMedia = null,
1832
        ?bool $disableNotification = null,
1833
        ?bool $protectContent = null,
1834
        ?ReplyParameters $replyParameters = null,
1835
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
1836
        ?string $businessConnectionId = null,
1837
        ?string $payload = null,
1838
        ?bool $allowPaidBroadcast = null,
1839
    ): FailResult|Message {
1840
        return $this->call(
3✔
1841
            new SendPaidMedia(
3✔
1842
                $chatId,
3✔
1843
                $starCount,
3✔
1844
                $media,
3✔
1845
                $caption,
3✔
1846
                $parseMode,
3✔
1847
                $captionEntities,
3✔
1848
                $showCaptionAboveMedia,
3✔
1849
                $disableNotification,
3✔
1850
                $protectContent,
3✔
1851
                $replyParameters,
3✔
1852
                $replyMarkup,
3✔
1853
                $businessConnectionId,
3✔
1854
                $payload,
3✔
1855
                $allowPaidBroadcast,
3✔
1856
            ),
3✔
1857
        );
3✔
1858
    }
1859

1860
    /**
1861
     * @param MessageEntity[]|null $captionEntities
1862
     *
1863
     * @see https://core.telegram.org/bots/api#sendphoto
1864
     */
1865
    public function sendPhoto(
3✔
1866
        int|string $chatId,
1867
        string|InputFile $photo,
1868
        ?string $businessConnectionId = null,
1869
        ?int $messageThreadId = null,
1870
        ?string $caption = null,
1871
        ?string $parseMode = null,
1872
        ?array $captionEntities = null,
1873
        ?bool $showCaptionAboveMedia = null,
1874
        ?bool $hasSpoiler = null,
1875
        ?bool $disableNotification = null,
1876
        ?bool $protectContent = null,
1877
        ?string $messageEffectId = null,
1878
        ?ReplyParameters $replyParameters = null,
1879
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
1880
        ?bool $allowPaidBroadcast = null,
1881
    ): FailResult|Message {
1882
        return $this->call(
3✔
1883
            new SendPhoto(
3✔
1884
                $chatId,
3✔
1885
                $photo,
3✔
1886
                $businessConnectionId,
3✔
1887
                $messageThreadId,
3✔
1888
                $caption,
3✔
1889
                $parseMode,
3✔
1890
                $captionEntities,
3✔
1891
                $showCaptionAboveMedia,
3✔
1892
                $hasSpoiler,
3✔
1893
                $disableNotification,
3✔
1894
                $protectContent,
3✔
1895
                $messageEffectId,
3✔
1896
                $replyParameters,
3✔
1897
                $replyMarkup,
3✔
1898
                $allowPaidBroadcast,
3✔
1899
            ),
3✔
1900
        );
3✔
1901
    }
1902

1903
    /**
1904
     * @param InputPollOption[] $options
1905
     * @param MessageEntity[]|null $questionEntities
1906
     * @param MessageEntity[]|null $explanationEntities
1907
     *
1908
     * @see https://core.telegram.org/bots/api#sendpoll
1909
     */
1910
    public function sendPoll(
3✔
1911
        int|string $chatId,
1912
        string $question,
1913
        array $options,
1914
        ?string $businessConnectionId = null,
1915
        ?int $messageThreadId = null,
1916
        ?string $questionParseMode = null,
1917
        ?array $questionEntities = null,
1918
        ?bool $isAnonymous = null,
1919
        ?string $type = null,
1920
        ?bool $allowsMultipleAnswers = null,
1921
        ?int $correctOptionId = null,
1922
        ?string $explanation = null,
1923
        ?string $explanationParseMode = null,
1924
        ?array $explanationEntities = null,
1925
        ?int $openPeriod = null,
1926
        ?DateTimeImmutable $closeDate = null,
1927
        ?bool $isClosed = null,
1928
        ?bool $disableNotification = null,
1929
        ?bool $protectContent = null,
1930
        ?string $messageEffectId = null,
1931
        ?ReplyParameters $replyParameters = null,
1932
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
1933
        ?bool $allowPaidBroadcast = null,
1934
    ): FailResult|Message {
1935
        return $this->call(
3✔
1936
            new SendPoll(
3✔
1937
                $chatId,
3✔
1938
                $question,
3✔
1939
                $options,
3✔
1940
                $businessConnectionId,
3✔
1941
                $messageThreadId,
3✔
1942
                $questionParseMode,
3✔
1943
                $questionEntities,
3✔
1944
                $isAnonymous,
3✔
1945
                $type,
3✔
1946
                $allowsMultipleAnswers,
3✔
1947
                $correctOptionId,
3✔
1948
                $explanation,
3✔
1949
                $explanationParseMode,
3✔
1950
                $explanationEntities,
3✔
1951
                $openPeriod,
3✔
1952
                $closeDate,
3✔
1953
                $isClosed,
3✔
1954
                $disableNotification,
3✔
1955
                $protectContent,
3✔
1956
                $messageEffectId,
3✔
1957
                $replyParameters,
3✔
1958
                $replyMarkup,
3✔
1959
                $allowPaidBroadcast,
3✔
1960
            ),
3✔
1961
        );
3✔
1962
    }
1963

1964
    /**
1965
     * @see https://core.telegram.org/bots/api#sendsticker
1966
     */
1967
    public function sendSticker(
3✔
1968
        int|string $chatId,
1969
        InputFile|string $sticker,
1970
        ?string $businessConnectionId = null,
1971
        ?int $messageThreadId = null,
1972
        ?string $emoji = null,
1973
        ?bool $disableNotification = null,
1974
        ?bool $protectContent = null,
1975
        ?string $messageEffectId = null,
1976
        ?ReplyParameters $replyParameters = null,
1977
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
1978
        ?bool $allowPaidBroadcast = null,
1979
    ): FailResult|Message {
1980
        return $this->call(
3✔
1981
            new SendSticker(
3✔
1982
                $chatId,
3✔
1983
                $sticker,
3✔
1984
                $businessConnectionId,
3✔
1985
                $messageThreadId,
3✔
1986
                $emoji,
3✔
1987
                $disableNotification,
3✔
1988
                $protectContent,
3✔
1989
                $messageEffectId,
3✔
1990
                $replyParameters,
3✔
1991
                $replyMarkup,
3✔
1992
                $allowPaidBroadcast,
3✔
1993
            ),
3✔
1994
        );
3✔
1995
    }
1996

1997
    /**
1998
     * @see https://core.telegram.org/bots/api#sendvenue
1999
     */
2000
    public function sendVenue(
3✔
2001
        int|string $chatId,
2002
        float $latitude,
2003
        float $longitude,
2004
        string $title,
2005
        string $address,
2006
        ?string $businessConnectionId = null,
2007
        ?int $messageThreadId = null,
2008
        ?string $foursquareId = null,
2009
        ?string $foursquareType = null,
2010
        ?string $googlePlaceId = null,
2011
        ?string $googlePlaceType = null,
2012
        ?bool $disableNotification = null,
2013
        ?bool $protectContent = null,
2014
        ?string $messageEffectId = null,
2015
        ?ReplyParameters $replyParameters = null,
2016
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
2017
        ?bool $allowPaidBroadcast = null,
2018
    ): FailResult|Message {
2019
        return $this->call(
3✔
2020
            new SendVenue(
3✔
2021
                $chatId,
3✔
2022
                $latitude,
3✔
2023
                $longitude,
3✔
2024
                $title,
3✔
2025
                $address,
3✔
2026
                $businessConnectionId,
3✔
2027
                $messageThreadId,
3✔
2028
                $foursquareId,
3✔
2029
                $foursquareType,
3✔
2030
                $googlePlaceId,
3✔
2031
                $googlePlaceType,
3✔
2032
                $disableNotification,
3✔
2033
                $protectContent,
3✔
2034
                $messageEffectId,
3✔
2035
                $replyParameters,
3✔
2036
                $replyMarkup,
3✔
2037
                $allowPaidBroadcast,
3✔
2038
            ),
3✔
2039
        );
3✔
2040
    }
2041

2042
    /**
2043
     * @param MessageEntity[]|null $captionEntities
2044
     *
2045
     * @see https://core.telegram.org/bots/api#sendvideo
2046
     */
2047
    public function sendVideo(
3✔
2048
        int|string $chatId,
2049
        string|InputFile $video,
2050
        ?string $businessConnectionId = null,
2051
        ?int $messageThreadId = null,
2052
        ?int $duration = null,
2053
        ?int $width = null,
2054
        ?int $height = null,
2055
        string|InputFile|null $thumbnail = null,
2056
        ?string $caption = null,
2057
        ?string $parseMode = null,
2058
        ?array $captionEntities = null,
2059
        ?bool $showCaptionAboveMedia = null,
2060
        ?bool $hasSpoiler = null,
2061
        ?bool $supportsStreaming = null,
2062
        ?bool $disableNotification = null,
2063
        ?bool $protectContent = null,
2064
        ?string $messageEffectId = null,
2065
        ?ReplyParameters $replyParameters = null,
2066
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
2067
        ?bool $allowPaidBroadcast = null,
2068
        string|InputFile|null $cover = null,
2069
        ?int $startTimestamp = null,
2070
    ): FailResult|Message {
2071
        return $this->call(
3✔
2072
            new SendVideo(
3✔
2073
                $chatId,
3✔
2074
                $video,
3✔
2075
                $businessConnectionId,
3✔
2076
                $messageThreadId,
3✔
2077
                $duration,
3✔
2078
                $width,
3✔
2079
                $height,
3✔
2080
                $thumbnail,
3✔
2081
                $caption,
3✔
2082
                $parseMode,
3✔
2083
                $captionEntities,
3✔
2084
                $showCaptionAboveMedia,
3✔
2085
                $hasSpoiler,
3✔
2086
                $supportsStreaming,
3✔
2087
                $disableNotification,
3✔
2088
                $protectContent,
3✔
2089
                $messageEffectId,
3✔
2090
                $replyParameters,
3✔
2091
                $replyMarkup,
3✔
2092
                $allowPaidBroadcast,
3✔
2093
                $cover,
3✔
2094
                $startTimestamp,
3✔
2095
            ),
3✔
2096
        );
3✔
2097
    }
2098

2099
    /**
2100
     * @see https://core.telegram.org/bots/api#sendvideonote
2101
     */
2102
    public function sendVideoNote(
3✔
2103
        int|string $chatId,
2104
        string|InputFile $videoNote,
2105
        ?string $businessConnectionId = null,
2106
        ?int $messageThreadId = null,
2107
        ?int $duration = null,
2108
        ?int $length = null,
2109
        string|InputFile|null $thumbnail = null,
2110
        ?bool $disableNotification = null,
2111
        ?bool $protectContent = null,
2112
        ?string $messageEffectId = null,
2113
        ?ReplyParameters $replyParameters = null,
2114
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
2115
        ?bool $allowPaidBroadcast = null,
2116
    ): FailResult|Message {
2117
        return $this->call(
3✔
2118
            new SendVideoNote(
3✔
2119
                $chatId,
3✔
2120
                $videoNote,
3✔
2121
                $businessConnectionId,
3✔
2122
                $messageThreadId,
3✔
2123
                $duration,
3✔
2124
                $length,
3✔
2125
                $thumbnail,
3✔
2126
                $disableNotification,
3✔
2127
                $protectContent,
3✔
2128
                $messageEffectId,
3✔
2129
                $replyParameters,
3✔
2130
                $replyMarkup,
3✔
2131
                $allowPaidBroadcast,
3✔
2132
            ),
3✔
2133
        );
3✔
2134
    }
2135

2136
    /**
2137
     * @param MessageEntity[]|null $captionEntities
2138
     *
2139
     * @see https://core.telegram.org/bots/api#sendvoice
2140
     */
2141
    public function sendVoice(
3✔
2142
        int|string $chatId,
2143
        string|InputFile $voice,
2144
        ?string $businessConnectionId = null,
2145
        ?int $messageThreadId = null,
2146
        ?string $caption = null,
2147
        ?string $parseMode = null,
2148
        ?array $captionEntities = null,
2149
        ?int $duration = null,
2150
        ?bool $disableNotification = null,
2151
        ?bool $protectContent = null,
2152
        ?string $messageEffectId = null,
2153
        ?ReplyParameters $replyParameters = null,
2154
        InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
2155
        ?bool $allowPaidBroadcast = null,
2156
    ): FailResult|Message {
2157
        return $this->call(
3✔
2158
            new SendVoice(
3✔
2159
                $chatId,
3✔
2160
                $voice,
3✔
2161
                $businessConnectionId,
3✔
2162
                $messageThreadId,
3✔
2163
                $caption,
3✔
2164
                $parseMode,
3✔
2165
                $captionEntities,
3✔
2166
                $duration,
3✔
2167
                $disableNotification,
3✔
2168
                $protectContent,
3✔
2169
                $messageEffectId,
3✔
2170
                $replyParameters,
3✔
2171
                $replyMarkup,
3✔
2172
                $allowPaidBroadcast,
3✔
2173
            ),
3✔
2174
        );
3✔
2175
    }
2176

2177
    /**
2178
     * @see https://core.telegram.org/bots/api#setchatadministratorcustomtitle
2179
     */
2180
    public function setChatAdministratorCustomTitle(
3✔
2181
        int|string $chatId,
2182
        int $userId,
2183
        string $customTitle,
2184
    ): FailResult|true {
2185
        return $this->call(
3✔
2186
            new SetChatAdministratorCustomTitle($chatId, $userId, $customTitle),
3✔
2187
        );
3✔
2188
    }
2189

2190
    /**
2191
     * @see https://core.telegram.org/bots/api#setchatdescription
2192
     */
2193
    public function setChatDescription(int|string $chatId, ?string $description = null): FailResult|true
3✔
2194
    {
2195
        return $this->call(
3✔
2196
            new SetChatDescription($chatId, $description),
3✔
2197
        );
3✔
2198
    }
2199

2200
    /**
2201
     * @see https://core.telegram.org/bots/api#setchatmenubutton
2202
     */
2203
    public function setChatMenuButton(?int $chatId = null, ?MenuButton $menuButton = null): FailResult|true
3✔
2204
    {
2205
        return $this->call(new SetChatMenuButton($chatId, $menuButton));
3✔
2206
    }
2207

2208
    /**
2209
     * @see https://core.telegram.org/bots/api#setchatpermissions
2210
     */
2211
    public function setChatPermissions(
3✔
2212
        int|string $chatId,
2213
        ChatPermissions $permissions,
2214
        ?bool $useIndependentChatPermissions = null,
2215
    ): FailResult|true {
2216
        return $this->call(
3✔
2217
            new SetChatPermissions($chatId, $permissions, $useIndependentChatPermissions),
3✔
2218
        );
3✔
2219
    }
2220

2221
    /**
2222
     * @see https://core.telegram.org/bots/api#setchatphoto
2223
     */
2224
    public function setChatPhoto(int|string $chatId, InputFile $photo): FailResult|true
3✔
2225
    {
2226
        return $this->call(
3✔
2227
            new SetChatPhoto($chatId, $photo),
3✔
2228
        );
3✔
2229
    }
2230

2231
    /**
2232
     * @see https://core.telegram.org/bots/api#setchatstickerset
2233
     */
2234
    public function setChatStickerSet(int|string $chatId, string $stickerSetName): FailResult|true
3✔
2235
    {
2236
        return $this->call(
3✔
2237
            new SetChatStickerSet($chatId, $stickerSetName),
3✔
2238
        );
3✔
2239
    }
2240

2241
    /**
2242
     * @see https://core.telegram.org/bots/api#setchattitle
2243
     */
2244
    public function setChatTitle(int|string $chatId, string $title): FailResult|true
3✔
2245
    {
2246
        return $this->call(
3✔
2247
            new SetChatTitle($chatId, $title),
3✔
2248
        );
3✔
2249
    }
2250

2251
    /**
2252
     * @see https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
2253
     */
2254
    public function setCustomEmojiStickerSetThumbnail(string $name, ?string $customEmojiId = null): FailResult|true
3✔
2255
    {
2256
        return $this->call(new SetCustomEmojiStickerSetThumbnail($name, $customEmojiId));
3✔
2257
    }
2258

2259
    /**
2260
     * @see https://core.telegram.org/bots/api#setgamescore
2261
     */
2262
    public function setGameScore(
3✔
2263
        int $userId,
2264
        int $score,
2265
        ?bool $force = null,
2266
        ?bool $disableEditMessage = null,
2267
        ?int $chatId = null,
2268
        ?int $messageId = null,
2269
        ?string $inlineMessageId = null,
2270
    ): FailResult|Message|true {
2271
        return $this->call(
3✔
2272
            new SetGameScore(
3✔
2273
                $userId,
3✔
2274
                $score,
3✔
2275
                $force,
3✔
2276
                $disableEditMessage,
3✔
2277
                $chatId,
3✔
2278
                $messageId,
3✔
2279
                $inlineMessageId,
3✔
2280
            ),
3✔
2281
        );
3✔
2282
    }
2283

2284
    /**
2285
     * @see https://core.telegram.org/bots/api#setmessagereaction
2286
     *
2287
     * @param ReactionType[]|null $reaction
2288
     */
2289
    public function setMessageReaction(
3✔
2290
        int|string $chatId,
2291
        int $messageId,
2292
        ?array $reaction = null,
2293
        ?bool $isBig = null,
2294
    ): FailResult|true {
2295
        return $this->call(
3✔
2296
            new SetMessageReaction($chatId, $messageId, $reaction, $isBig),
3✔
2297
        );
3✔
2298
    }
2299

2300
    /**
2301
     * @param BotCommand[] $commands
2302
     *
2303
     * @see https://core.telegram.org/bots/api#setmycommands
2304
     */
2305
    public function setMyCommands(
3✔
2306
        array $commands,
2307
        ?BotCommandScope $scope = null,
2308
        ?string $languageCode = null,
2309
    ): FailResult|true {
2310
        return $this->call(new SetMyCommands($commands, $scope, $languageCode));
3✔
2311
    }
2312

2313
    /**
2314
     * @see https://core.telegram.org/bots/api#setmydefaultadministratorrights
2315
     */
2316
    public function setMyDefaultAdministratorRights(
3✔
2317
        ?ChatAdministratorRights $rights = null,
2318
        ?bool $forChannels = null,
2319
    ): FailResult|true {
2320
        return $this->call(new SetMyDefaultAdministratorRights($rights, $forChannels));
3✔
2321
    }
2322

2323
    /**
2324
     * @see https://core.telegram.org/bots/api#setmydescription
2325
     */
2326
    public function setMyDescription(?string $description = null, ?string $languageCode = null): FailResult|true
3✔
2327
    {
2328
        return $this->call(new SetMyDescription($description, $languageCode));
3✔
2329
    }
2330

2331
    /**
2332
     * @see https://core.telegram.org/bots/api#setmyname
2333
     */
2334
    public function setMyName(?string $name = null, ?string $languageCode = null): FailResult|true
3✔
2335
    {
2336
        return $this->call(new SetMyName($name, $languageCode));
3✔
2337
    }
2338

2339
    /**
2340
     * @see https://core.telegram.org/bots/api#setmyshortdescription
2341
     */
2342
    public function setMyShortDescription(
3✔
2343
        ?string $shortDescription = null,
2344
        ?string $languageCode = null,
2345
    ): FailResult|true {
2346
        return $this->call(new SetMyShortDescription($shortDescription, $languageCode));
3✔
2347
    }
2348

2349
    /**
2350
     * @see https://core.telegram.org/bots/api#setpassportdataerrors
2351
     *
2352
     * @param PassportElementError[] $errors
2353
     */
2354
    public function setPassportDataErrors(int $userId, array $errors): FailResult|true
3✔
2355
    {
2356
        return $this->call(new SetPassportDataErrors($userId, $errors));
3✔
2357
    }
2358

2359
    /**
2360
     * @see https://core.telegram.org/bots/api#setstickeremojilist
2361
     *
2362
     * @param string[] $emojiList
2363
     */
2364
    public function setStickerEmojiList(string $sticker, array $emojiList): FailResult|true
3✔
2365
    {
2366
        return $this->call(new SetStickerEmojiList($sticker, $emojiList));
3✔
2367
    }
2368

2369
    /**
2370
     * @see https://core.telegram.org/bots/api#setstickerkeywords
2371
     *
2372
     * @param string[]|null $keywords
2373
     */
2374
    public function setStickerKeywords(string $sticker, ?array $keywords = null): FailResult|true
3✔
2375
    {
2376
        return $this->call(new SetStickerKeywords($sticker, $keywords));
3✔
2377
    }
2378

2379
    /**
2380
     * @see https://core.telegram.org/bots/api#setstickermaskposition
2381
     */
2382
    public function setStickerMaskPosition(string $sticker, ?MaskPosition $maskPosition = null): FailResult|true
3✔
2383
    {
2384
        return $this->call(new SetStickerMaskPosition($sticker, $maskPosition));
3✔
2385
    }
2386

2387
    /**
2388
     * @see https://core.telegram.org/bots/api#setstickerpositioninset
2389
     */
2390
    public function setStickerPositionInSet(string $sticker, int $position): FailResult|true
3✔
2391
    {
2392
        return $this->call(new SetStickerPositionInSet($sticker, $position));
3✔
2393
    }
2394

2395
    /**
2396
     * @see https://core.telegram.org/bots/api#setstickersetthumbnail
2397
     */
2398
    public function setStickerSetThumbnail(
3✔
2399
        string $name,
2400
        int $userId,
2401
        string $format,
2402
        InputFile|string|null $thumbnail = null,
2403
    ): FailResult|true {
2404
        return $this->call(
3✔
2405
            new SetStickerSetThumbnail(
3✔
2406
                $name,
3✔
2407
                $userId,
3✔
2408
                $format,
3✔
2409
                $thumbnail,
3✔
2410
            ),
3✔
2411
        );
3✔
2412
    }
2413

2414
    /**
2415
     * @see https://core.telegram.org/bots/api#setstickersettitle
2416
     */
2417
    public function setStickerSetTitle(string $name, string $title): FailResult|true
3✔
2418
    {
2419
        return $this->call(new SetStickerSetTitle($name, $title));
3✔
2420
    }
2421

2422
    /**
2423
     * @see https://core.telegram.org/bots/api#setuseremojistatus
2424
     */
2425
    public function setUserEmojiStatus(
3✔
2426
        int $userId,
2427
        ?string $emojiStatusCustomEmojiId = null,
2428
        ?DateTimeImmutable $emojiStatusExpirationDate = null,
2429
    ): FailResult|true {
2430
        return $this->call(
3✔
2431
            new SetUserEmojiStatus(
3✔
2432
                $userId,
3✔
2433
                $emojiStatusCustomEmojiId,
3✔
2434
                $emojiStatusExpirationDate,
3✔
2435
            ),
3✔
2436
        );
3✔
2437
    }
2438

2439
    /**
2440
     * @see https://core.telegram.org/bots/api#setwebhook
2441
     */
2442
    public function setWebhook(
3✔
2443
        string $url,
2444
        ?string $ipAddress = null,
2445
        ?int $maxConnections = null,
2446
        ?array $allowUpdates = null,
2447
        ?bool $dropPendingUpdates = null,
2448
        ?string $secretToken = null,
2449
    ): FailResult|true {
2450
        return $this->call(
3✔
2451
            new SetWebhook($url, $ipAddress, $maxConnections, $allowUpdates, $dropPendingUpdates, $secretToken),
3✔
2452
        );
3✔
2453
    }
2454

2455
    /**
2456
     * @see https://core.telegram.org/bots/api#stopmessagelivelocation
2457
     */
2458
    public function stopMessageLiveLocation(
3✔
2459
        ?string $businessConnectionId = null,
2460
        int|string|null $chatId = null,
2461
        ?int $messageId = null,
2462
        ?string $inlineMessageId = null,
2463
        ?InlineKeyboardMarkup $replyMarkup = null,
2464
    ): FailResult|Message|true {
2465
        return $this->call(
3✔
2466
            new StopMessageLiveLocation(
3✔
2467
                $businessConnectionId,
3✔
2468
                $chatId,
3✔
2469
                $messageId,
3✔
2470
                $inlineMessageId,
3✔
2471
                $replyMarkup,
3✔
2472
            ),
3✔
2473
        );
3✔
2474
    }
2475

2476
    /**
2477
     * @see https://core.telegram.org/bots/api#stoppoll
2478
     */
2479
    public function stopPoll(
3✔
2480
        int|string $chatId,
2481
        int $messageId,
2482
        ?string $businessConnectionId = null,
2483
        ?InlineKeyboardMarkup $replyMarkup = null,
2484
    ): FailResult|Poll {
2485
        return $this->call(
3✔
2486
            new StopPoll(
3✔
2487
                $chatId,
3✔
2488
                $messageId,
3✔
2489
                $businessConnectionId,
3✔
2490
                $replyMarkup,
3✔
2491
            ),
3✔
2492
        );
3✔
2493
    }
2494

2495
    /**
2496
     * @see https://core.telegram.org/bots/api#unbanchatmember
2497
     */
2498
    public function unbanChatMember(
3✔
2499
        int|string $chatId,
2500
        int $userId,
2501
        ?bool $onlyIfBanned = null,
2502
    ): FailResult|true {
2503
        return $this->call(
3✔
2504
            new UnbanChatMember($chatId, $userId, $onlyIfBanned),
3✔
2505
        );
3✔
2506
    }
2507

2508
    /**
2509
     * @see https://core.telegram.org/bots/api#unbanchatsenderchat
2510
     */
2511
    public function unbanChatSenderChat(int|string $chatId, int $senderChatId): FailResult|true
3✔
2512
    {
2513
        return $this->call(
3✔
2514
            new UnbanChatSenderChat($chatId, $senderChatId),
3✔
2515
        );
3✔
2516
    }
2517

2518
    /**
2519
     * @see https://core.telegram.org/bots/api#unhidegeneralforumtopic
2520
     */
2521
    public function unhideGeneralForumTopic(int|string $chatId): FailResult|true
3✔
2522
    {
2523
        return $this->call(
3✔
2524
            new UnhideGeneralForumTopic($chatId),
3✔
2525
        );
3✔
2526
    }
2527

2528
    /**
2529
     * @see https://core.telegram.org/bots/api#unpinchatmessage
2530
     */
2531
    public function unpinChatMessage(int|string $chatId, ?int $messageId = null): FailResult|true
3✔
2532
    {
2533
        return $this->call(
3✔
2534
            new UnpinChatMessage($chatId, $messageId),
3✔
2535
        );
3✔
2536
    }
2537

2538
    /**
2539
     * @see https://core.telegram.org/bots/api#unpinallchatmessages
2540
     */
2541
    public function unpinAllChatMessages(int|string $chatId): FailResult|true
3✔
2542
    {
2543
        return $this->call(
3✔
2544
            new UnpinAllChatMessages($chatId),
3✔
2545
        );
3✔
2546
    }
2547

2548
    /**
2549
     * @see https://core.telegram.org/bots/api#unpinallforumtopicmessages
2550
     */
2551
    public function unpinAllForumTopicMessages(int|string $chatId, int $messageThreadId): FailResult|true
3✔
2552
    {
2553
        return $this->call(
3✔
2554
            new UnpinAllForumTopicMessages($chatId, $messageThreadId),
3✔
2555
        );
3✔
2556
    }
2557

2558
    /**
2559
     * @see https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
2560
     */
2561
    public function unpinAllGeneralForumTopicMessages(int|string $chatId): FailResult|true
3✔
2562
    {
2563
        return $this->call(
3✔
2564
            new UnpinAllGeneralForumTopicMessages($chatId),
3✔
2565
        );
3✔
2566
    }
2567

2568
    /**
2569
     * @see https://core.telegram.org/bots/api#uploadstickerfile
2570
     */
2571
    public function uploadStickerFile(int $userId, InputFile $sticker, string $stickerFormat): FailResult|File
3✔
2572
    {
2573
        return $this->call(
3✔
2574
            new UploadStickerFile($userId, $sticker, $stickerFormat),
3✔
2575
        );
3✔
2576
    }
2577

2578
    /**
2579
     * @see https://core.telegram.org/bots/api#verifychat
2580
     */
2581
    public function verifyChat(int|string $chatId, ?string $customDescription = null): FailResult|true
3✔
2582
    {
2583
        return $this->call(
3✔
2584
            new VerifyChat($chatId, $customDescription),
3✔
2585
        );
3✔
2586
    }
2587

2588
    /**
2589
     * @see https://core.telegram.org/bots/api#verifyuser
2590
     */
2591
    public function verifyUser(int $userId, ?string $customDescription = null): FailResult|true
3✔
2592
    {
2593
        return $this->call(
3✔
2594
            new VerifyUser($userId, $customDescription),
3✔
2595
        );
3✔
2596
    }
2597
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc