1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +00:00

update kdocs of buttons creation shortcuts

This commit is contained in:
InsanusMokrassar 2023-06-04 12:38:09 +06:00
parent e6dbf2bde9
commit d4e11494e8
2 changed files with 26 additions and 104 deletions

View File

@ -5,20 +5,14 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.*
import dev.inmo.tgbotapi.types.webapps.WebAppInfo
/**
* Creates and put [PayInlineKeyboardButton]
*
* @see inlineKeyboard
* @see InlineKeyboardBuilder.row
* Creates [PayInlineKeyboardButton]
*/
inline fun payInlineButton(
text: String
) = PayInlineKeyboardButton(text)
/**
* Creates and put [CallbackDataInlineKeyboardButton]
*
* @see inlineKeyboard
* @see InlineKeyboardBuilder.row
* Creates [CallbackDataInlineKeyboardButton]
*/
inline fun dataInlineButton(
text: String,
@ -26,20 +20,14 @@ inline fun dataInlineButton(
) = CallbackDataInlineKeyboardButton(text, data)
/**
* Creates and put [CallbackGameInlineKeyboardButton]
*
* @see inlineKeyboard
* @see InlineKeyboardBuilder.row
* Creates [CallbackGameInlineKeyboardButton]
*/
inline fun gameInlineButton(
text: String
) = CallbackGameInlineKeyboardButton(text)
/**
* Creates and put [LoginURLInlineKeyboardButton]
*
* @see inlineKeyboard
* @see InlineKeyboardBuilder.row
* Creates [LoginURLInlineKeyboardButton]
*/
inline fun loginInlineButton(
text: String,
@ -47,10 +35,7 @@ inline fun loginInlineButton(
) = LoginURLInlineKeyboardButton(text, loginUrl)
/**
* Creates and put [SwitchInlineQueryCurrentChatInlineKeyboardButton]
*
* @see inlineKeyboard
* @see InlineKeyboardBuilder.row
* Creates [SwitchInlineQueryCurrentChatInlineKeyboardButton]
*/
inline fun inlineQueryInCurrentChatInlineButton(
text: String,
@ -58,10 +43,7 @@ inline fun inlineQueryInCurrentChatInlineButton(
) = SwitchInlineQueryCurrentChatInlineKeyboardButton(text, data)
/**
* Creates and put [SwitchInlineQueryChosenChatInlineKeyboardButton]
*
* @see inlineKeyboard
* @see InlineKeyboardBuilder.row
* Creates [SwitchInlineQueryChosenChatInlineKeyboardButton]
*/
inline fun inlineQueryInCurrentChatInlineButton(
text: String,
@ -69,10 +51,7 @@ inline fun inlineQueryInCurrentChatInlineButton(
) = SwitchInlineQueryChosenChatInlineKeyboardButton(text, parameters)
/**
* Creates and put [SwitchInlineQueryChosenChatInlineKeyboardButton]
*
* @see inlineKeyboard
* @see InlineKeyboardBuilder.row
* Creates [SwitchInlineQueryChosenChatInlineKeyboardButton]
*/
inline fun inlineQueryInCurrentChatInlineButton(
text: String,
@ -93,10 +72,7 @@ inline fun inlineQueryInCurrentChatInlineButton(
)
/**
* Creates and put [SwitchInlineQueryChosenChatInlineKeyboardButton]
*
* @see inlineKeyboard
* @see InlineKeyboardBuilder.row
* Creates [SwitchInlineQueryChosenChatInlineKeyboardButton]
*/
inline fun inlineQueryInAnyCurrentChatInlineButton(
text: String,
@ -104,10 +80,7 @@ inline fun inlineQueryInAnyCurrentChatInlineButton(
) = inlineQueryInCurrentChatInlineButton(text, query, allowUsers = true, allowBots = true, allowGroups = true, allowChannels = true)
/**
* Creates and put [SwitchInlineQueryInlineKeyboardButton]
*
* @see inlineKeyboard
* @see InlineKeyboardBuilder.row
* Creates [SwitchInlineQueryInlineKeyboardButton]
*/
inline fun inlineQueryInlineButton(
text: String,
@ -115,10 +88,7 @@ inline fun inlineQueryInlineButton(
) = SwitchInlineQueryInlineKeyboardButton(text, data)
/**
* Creates and put [URLInlineKeyboardButton]
*
* @see inlineKeyboard
* @see InlineKeyboardBuilder.row
* Creates [URLInlineKeyboardButton]
*/
inline fun urlInlineButton(
text: String,
@ -126,10 +96,7 @@ inline fun urlInlineButton(
) = URLInlineKeyboardButton(text, url)
/**
* Creates and put [WebAppInlineKeyboardButton]. Please, remember that this button is available in private chats only
*
* @see inlineKeyboard
* @see InlineKeyboardBuilder.row
* Creates [WebAppInlineKeyboardButton]. Please, remember that this button is available in private chats only
*/
inline fun webAppInlineButton(
text: String,
@ -137,10 +104,7 @@ inline fun webAppInlineButton(
) = WebAppInlineKeyboardButton(text, webApp)
/**
* Creates and put [WebAppInlineKeyboardButton]. Please, remember that this button is available in private chats only
*
* @see inlineKeyboard
* @see InlineKeyboardBuilder.row
* Creates [WebAppInlineKeyboardButton]. Please, remember that this button is available in private chats only
*/
inline fun webAppInlineButton(
text: String,

View File

@ -8,40 +8,28 @@ import dev.inmo.tgbotapi.types.webapps.WebAppInfo
/**
* Creates and put [SimpleKeyboardButton]
*
* @see replyKeyboard
* @see ReplyKeyboardBuilder.row
* Creates [SimpleKeyboardButton]
*/
inline fun simpleReplyButton(
text: String
) = SimpleKeyboardButton(text)
/**
* Creates and put [RequestContactKeyboardButton]
*
* @see replyKeyboard
* @see ReplyKeyboardBuilder.row
* Creates [RequestContactKeyboardButton]
*/
inline fun requestContactReplyButton(
text: String
) = RequestContactKeyboardButton(text)
/**
* Creates and put [RequestLocationKeyboardButton]
*
* @see replyKeyboard
* @see ReplyKeyboardBuilder.row
* Creates [RequestLocationKeyboardButton]
*/
inline fun requestLocationReplyButton(
text: String
) = RequestLocationKeyboardButton(text)
/**
* Creates and put [RequestPollKeyboardButton]
*
* @see replyKeyboard
* @see ReplyKeyboardBuilder.row
* Creates [RequestPollKeyboardButton]
*/
inline fun requestPollReplyButton(
text: String,
@ -49,10 +37,7 @@ inline fun requestPollReplyButton(
) = RequestPollKeyboardButton(text, pollType)
/**
* Creates and put [WebAppKeyboardButton]
*
* @see replyKeyboard
* @see ReplyKeyboardBuilder.row
* Creates [WebAppKeyboardButton]
*/
inline fun webAppReplyButton(
text: String,
@ -60,10 +45,7 @@ inline fun webAppReplyButton(
) = WebAppKeyboardButton(text, webApp)
/**
* Creates and put [WebAppKeyboardButton]
*
* @see replyKeyboard
* @see ReplyKeyboardBuilder.row
* Creates [WebAppKeyboardButton]
*/
inline fun webAppReplyButton(
text: String,
@ -72,10 +54,7 @@ inline fun webAppReplyButton(
/**
* Creates and put [RequestUserKeyboardButton]
*
* @see replyKeyboard
* @see ReplyKeyboardBuilder.row
* Creates [RequestUserKeyboardButton]
*/
inline fun requestUserReplyButton(
text: String,
@ -86,10 +65,7 @@ inline fun requestUserReplyButton(
)
/**
* Creates and put [RequestUserKeyboardButton] with [KeyboardButtonRequestUser.Bot]
*
* @see replyKeyboard
* @see ReplyKeyboardBuilder.row
* Creates [RequestUserKeyboardButton] with [KeyboardButtonRequestUser.Bot]
*/
inline fun requestBotReplyButton(
text: String,
@ -100,10 +76,7 @@ inline fun requestBotReplyButton(
)
/**
* Creates and put [RequestUserKeyboardButton] with [KeyboardButtonRequestUser.Common]
*
* @see replyKeyboard
* @see ReplyKeyboardBuilder.row
* Creates [RequestUserKeyboardButton] with [KeyboardButtonRequestUser.Common]
*/
inline fun requestUserReplyButton(
text: String,
@ -115,10 +88,7 @@ inline fun requestUserReplyButton(
)
/**
* Creates and put [RequestUserKeyboardButton] with [KeyboardButtonRequestUser.Any]
*
* @see replyKeyboard
* @see ReplyKeyboardBuilder.row
* Creates [RequestUserKeyboardButton] with [KeyboardButtonRequestUser.Any]
*/
inline fun requestUserOrBotReplyButton(
text: String,
@ -130,10 +100,7 @@ inline fun requestUserOrBotReplyButton(
/**
* Creates and put [RequestChatKeyboardButton]
*
* @see replyKeyboard
* @see ReplyKeyboardBuilder.row
* Creates [RequestChatKeyboardButton]
*/
inline fun requestChatReplyButton(
text: String,
@ -144,10 +111,7 @@ inline fun requestChatReplyButton(
)
/**
* Creates and put [RequestChatKeyboardButton] with [KeyboardButtonRequestChat]
*
* @see replyKeyboard
* @see ReplyKeyboardBuilder.row
* Creates [RequestChatKeyboardButton] with [KeyboardButtonRequestChat]
*/
inline fun requestChatReplyButton(
text: String,
@ -174,10 +138,7 @@ inline fun requestChatReplyButton(
)
/**
* Creates and put [RequestChatKeyboardButton] with [KeyboardButtonRequestChat.Channel]
*
* @see replyKeyboard
* @see ReplyKeyboardBuilder.row
* Creates [RequestChatKeyboardButton] with [KeyboardButtonRequestChat.Channel]
*/
inline fun requestChannelReplyButton(
text: String,
@ -201,10 +162,7 @@ inline fun requestChannelReplyButton(
/**
* Creates and put [RequestChatKeyboardButton] with [KeyboardButtonRequestChat.Group]
*
* @see replyKeyboard
* @see ReplyKeyboardBuilder.row
* Creates [RequestChatKeyboardButton] with [KeyboardButtonRequestChat.Group]
*/
inline fun requestChannelReplyButton(
text: String,