35
35
public function __construct (
36
36
private TransportClientInterface $ client ,
37
37
private ApiSerializerInterface $ serializer ,
38
- ) {}
39
-
40
- public function setToken (string $ token ): void
41
- {
42
- $ this ->client ->setToken ($ token );
38
+ private string $ token ,
39
+ ) {
43
40
}
44
41
45
42
public function getWebhookUpdate (string $ requestBody ): Update
@@ -81,7 +78,7 @@ public function getUpdates(
81
78
int $ timeout = null ,
82
79
array $ allowed_updates = []
83
80
): array {
84
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Update::class . '[] ' );
81
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Update::class . '[] ' );
85
82
}
86
83
87
84
/**
@@ -112,7 +109,7 @@ public function setWebhook(
112
109
bool $ drop_pending_updates = null ,
113
110
string $ secret_token = null ,
114
111
): bool {
115
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), multipartField: 'certificate ' );
112
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), multipartField: 'certificate ' );
116
113
}
117
114
118
115
/**
@@ -125,7 +122,7 @@ public function setWebhook(
125
122
*/
126
123
public function deleteWebhook (bool $ drop_pending_updates = null ): bool
127
124
{
128
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args ());
125
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args ());
129
126
}
130
127
131
128
/**
@@ -136,7 +133,7 @@ public function deleteWebhook(bool $drop_pending_updates = null): bool
136
133
*/
137
134
public function getWebhookInfo (): WebhookInfo
138
135
{
139
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), WebhookInfo::class);
136
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), WebhookInfo::class);
140
137
}
141
138
142
139
/**
@@ -146,7 +143,7 @@ public function getWebhookInfo(): WebhookInfo
146
143
*/
147
144
public function getMe (): User
148
145
{
149
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), User::class);
146
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), User::class);
150
147
}
151
148
152
149
/**
@@ -180,7 +177,7 @@ public function sendMessage(
180
177
bool $ allow_sending_without_reply = null ,
181
178
InlineKeyboardMarkup |ReplyKeyboardMarkup |ReplyKeyboardRemove |ForceReply $ reply_markup = null ,
182
179
): Message {
183
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class);
180
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class);
184
181
}
185
182
186
183
/**
@@ -204,7 +201,7 @@ public function forwardMessage(
204
201
bool $ disable_notification = null ,
205
202
bool $ protect_content = null ,
206
203
): Message {
207
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class);
204
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class);
208
205
}
209
206
210
207
/**
@@ -242,7 +239,7 @@ public function copyMessage(
242
239
bool $ allow_sending_without_reply = null ,
243
240
InlineKeyboardMarkup |ReplyKeyboardMarkup |ReplyKeyboardRemove |ForceReply $ reply_markup = null ,
244
241
): MessageId {
245
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), MessageId::class);
242
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), MessageId::class);
246
243
}
247
244
248
245
/**
@@ -279,7 +276,7 @@ public function sendPhoto(
279
276
bool $ allow_sending_without_reply = null ,
280
277
InlineKeyboardMarkup |ReplyKeyboardMarkup |ReplyKeyboardRemove |ForceReply $ reply_markup = null ,
281
278
): Message {
282
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class, 'photo ' );
279
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class, 'photo ' );
283
280
}
284
281
285
282
/**
@@ -324,7 +321,7 @@ public function sendAudio(
324
321
bool $ allow_sending_without_reply = null ,
325
322
InlineKeyboardMarkup |ReplyKeyboardMarkup |ReplyKeyboardRemove |ForceReply $ reply_markup = null ,
326
323
): Message {
327
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class, 'audio ' );
324
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class, 'audio ' );
328
325
}
329
326
330
327
/**
@@ -364,7 +361,7 @@ public function sendDocument(
364
361
bool $ allow_sending_without_reply = null ,
365
362
InlineKeyboardMarkup |ReplyKeyboardMarkup |ReplyKeyboardRemove |ForceReply $ reply_markup = null ,
366
363
): Message {
367
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class, 'document ' );
364
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class, 'document ' );
368
365
}
369
366
370
367
/**
@@ -412,7 +409,7 @@ public function sendVideo(
412
409
bool $ allow_sending_without_reply = null ,
413
410
InlineKeyboardMarkup |ReplyKeyboardMarkup |ReplyKeyboardRemove |ForceReply $ reply_markup = null ,
414
411
): Message {
415
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class, 'video ' );
412
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class, 'video ' );
416
413
}
417
414
418
415
/**
@@ -458,7 +455,7 @@ public function sendAnimation(
458
455
bool $ allow_sending_without_reply = null ,
459
456
InlineKeyboardMarkup |ReplyKeyboardMarkup |ReplyKeyboardRemove |ForceReply $ reply_markup = null ,
460
457
): Message {
461
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class, 'animation ' );
458
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class, 'animation ' );
462
459
}
463
460
464
461
/**
@@ -497,7 +494,7 @@ public function sendVoice(
497
494
bool $ allow_sending_without_reply = null ,
498
495
InlineKeyboardMarkup |ReplyKeyboardMarkup |ReplyKeyboardRemove |ForceReply $ reply_markup = null ,
499
496
): Message {
500
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class, 'voice ' );
497
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class, 'voice ' );
501
498
}
502
499
503
500
/**
@@ -533,7 +530,7 @@ public function sendVideoNote(
533
530
bool $ allow_sending_without_reply = null ,
534
531
InlineKeyboardMarkup |ReplyKeyboardMarkup |ReplyKeyboardRemove |ForceReply $ reply_markup = null ,
535
532
): Message {
536
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class, 'video_note ' );
533
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class, 'video_note ' );
537
534
}
538
535
539
536
/**
@@ -561,7 +558,7 @@ public function sendMediaGroup(
561
558
int $ reply_to_message_id = null ,
562
559
bool $ allow_sending_without_reply = null ,
563
560
): array {
564
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class . '[] ' , true );
561
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class . '[] ' , true );
565
562
}
566
563
567
564
/**
@@ -600,7 +597,7 @@ public function sendLocation(
600
597
bool $ allow_sending_without_reply = null ,
601
598
InlineKeyboardMarkup |ReplyKeyboardMarkup |ReplyKeyboardRemove |ForceReply $ reply_markup = null ,
602
599
): Message {
603
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class);
600
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class);
604
601
}
605
602
606
603
/**
@@ -643,7 +640,7 @@ public function sendVenue(
643
640
bool $ allow_sending_without_reply = null ,
644
641
InlineKeyboardMarkup |ReplyKeyboardMarkup |ReplyKeyboardRemove |ForceReply $ reply_markup = null ,
645
642
): Message {
646
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class);
643
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class);
647
644
}
648
645
649
646
/**
@@ -678,7 +675,7 @@ public function sendContact(
678
675
bool $ allow_sending_without_reply = null ,
679
676
InlineKeyboardMarkup |ReplyKeyboardMarkup |ReplyKeyboardRemove |ForceReply $ reply_markup = null ,
680
677
): Message {
681
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class);
678
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class);
682
679
}
683
680
684
681
/**
@@ -729,7 +726,7 @@ public function sendPoll(
729
726
bool $ allow_sending_without_reply = null ,
730
727
InlineKeyboardMarkup |ReplyKeyboardMarkup |ReplyKeyboardRemove |ForceReply $ reply_markup = null ,
731
728
): Message {
732
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class);
729
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class);
733
730
}
734
731
735
732
/**
@@ -758,7 +755,7 @@ public function sendDice(
758
755
bool $ allow_sending_without_reply = null ,
759
756
InlineKeyboardMarkup |ReplyKeyboardMarkup |ReplyKeyboardRemove |ForceReply $ reply_markup = null ,
760
757
): Message {
761
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class);
758
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class);
762
759
}
763
760
764
761
/**
@@ -778,7 +775,7 @@ public function sendChatAction(
778
775
ChatActionEnum $ action ,
779
776
int $ message_thread_id = null ,
780
777
): bool {
781
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args ());
778
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args ());
782
779
}
783
780
784
781
/**
@@ -807,7 +804,7 @@ public function editMessageText(
807
804
bool $ disable_web_page_preview = null ,
808
805
InlineKeyboardMarkup $ reply_markup = null ,
809
806
): Message |bool {
810
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class);
807
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class);
811
808
}
812
809
813
810
/**
@@ -834,7 +831,7 @@ public function editMessageCaption(
834
831
array $ caption_entities = null ,
835
832
InlineKeyboardMarkup $ reply_markup = null ,
836
833
): Message |bool {
837
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class);
834
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class);
838
835
}
839
836
840
837
/**
@@ -866,7 +863,7 @@ public function editMessageLiveLocation(
866
863
int $ proximity_alert_radius = null ,
867
864
InlineKeyboardMarkup $ reply_markup = null ,
868
865
): Message |bool {
869
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class);
866
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class);
870
867
}
871
868
872
869
/**
@@ -887,7 +884,7 @@ public function stopMessageLiveLocation(
887
884
string $ inline_message_id = null ,
888
885
InlineKeyboardMarkup $ reply_markup = null ,
889
886
): Message |bool {
890
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class);
887
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class);
891
888
}
892
889
893
890
/**
@@ -908,7 +905,7 @@ public function editMessageReplyMarkup(
908
905
int $ inline_message_id = null ,
909
906
InlineKeyboardMarkup $ reply_markup = null ,
910
907
): Message |bool {
911
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Message::class);
908
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Message::class);
912
909
}
913
910
914
911
/**
@@ -927,7 +924,7 @@ public function stopPoll(
927
924
int $ message_id ,
928
925
InlineKeyboardMarkup $ reply_markup = null ,
929
926
): Poll {
930
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args (), Poll::class);
927
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args (), Poll::class);
931
928
}
932
929
933
930
/**
@@ -952,6 +949,6 @@ public function deleteMessage(
952
949
int |string $ chat_id ,
953
950
int $ message_id ,
954
951
): bool {
955
- return $ this ->client ->executeMethod (__METHOD__ , func_get_args ());
952
+ return $ this ->client ->executeMethod ($ this -> token , __METHOD__ , func_get_args ());
956
953
}
957
954
}
0 commit comments