Skip to content

feat: Add various keyboard button types to Keyboard\Make #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 0.x.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions src/Keyboard/Make.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,142 @@ public static function row(...$col): array
return [...$col];
}

public static function webApp(
$text,
$web_app,
): array
{
return [
'text' => $text,
'web_app' => $web_app,
];
}

public static function url(
$text,
$url
): array
{
return [
'text' => $text,
'url' => $url,
];
}
public static function callbackData(
$text,
$callback_data
): array
{
return [
'text' => $text,
'callback_data' => $callback_data,
];
}

public static function loginUrl(
$text,
$login_url
): array
{
return [
'text' => $text,
'login_url' => $login_url,
];
}

public static function switchInlineQuery(
$text,
$switch_inline_query = null,
$switch_inline_query_current_chat = null,
$switch_inline_query_chosen_chat = null
): array
{
return [
'text' => $text,
'switch_inline_query' => $switch_inline_query,
'switch_inline_query_current_chat' => $switch_inline_query_current_chat,
'switch_inline_query_chosen_chat' => $switch_inline_query_chosen_chat,
];
}

public static function callbackGame(
$text,
$callback_game = null
): array
{
return [
'text' => $text,
'callback_game' => $callback_game,
];
}

public static function pay(
$text,
$pay = null
): array
{
return [
'text' => $text,
'pay' => $pay,
];
}

public static function requestUser(
$text,
$request_user = null
): array
{
return [
'text' => $text,
'request_user' => $request_user,
];
}

public static function requestChat(
$text,
$request_chat = null
): array
{
return [
'text' => $text,
'request_chat' => $request_chat,
];
}

public static function requestContact(
$text,
$request_contact = null
): array
{
return [
'text' => $text,
'request_contact' => $request_contact,
];
}

public static function requestLocation(
$text,
$request_location = null
): array
{
return [
'text' => $text,
'request_location' => $request_location,
];
}

public static function requestPoll(
$text,
$request_poll = null
): array
{
return [
'text' => $text,
'request_poll' => $request_poll,
];
}


public static function col(
$text,
$url = null,
Expand Down