Skip to content

Commit 1e04bf8

Browse files
committed
Added web_app for Bot API 6.0
1 parent a4ad3db commit 1e04bf8

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

src/InlineKeyboard/InlineKeyboardButton.php

+14-1
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,26 @@ public static function make(string $text = null): static
2424
{
2525
$data = [];
2626

27-
if ($text !== null) {
27+
if ($text !== null) {
2828
$data['text'] = $text;
2929
}
3030

3131
return new static($data);
3232
}
3333

34+
public function webApp(array|string $web_app): self
35+
{
36+
if (is_string($web_app)) {
37+
$web_app = [
38+
'url' => $web_app,
39+
];
40+
}
41+
42+
$this->data['web_app'] = $web_app;
43+
44+
return $this;
45+
}
46+
3447
public function loginUrl(array|string $login_url): self
3548
{
3649
if (is_string($login_url)) {

src/ReplyKeyboard/KeyboardButton.php

+13
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,17 @@ public static function make(string $text = null): static
2929

3030
return new static($data);
3131
}
32+
33+
public function webApp(array|string $web_app): self
34+
{
35+
if (is_string($web_app)) {
36+
$web_app = [
37+
'url' => $web_app,
38+
];
39+
}
40+
41+
$this->data['web_app'] = $web_app;
42+
43+
return $this;
44+
}
3245
}

0 commit comments

Comments
 (0)