Skip to main content

Kurimod.helpers

function Kurimod.array_chunk(input_array, size)

Split an array into chunks.

Parameters

ParameterTypeDescription
input_arraylistThe array to split.
sizeintThe size of each chunk.

Return

A list of chunks.

function Kurimod.bki(keyboard)

Deserialize an InlineKeyboardMarkup to a list of lists of buttons.

Parameters

ParameterTypeDescription
keyboardInlineKeyboardMarkupAn InlineKeyboardMarkup.

Return

A list of lists of buttons.

function Kurimod.btn(text, value, type='callback_data')

Create an InlineKeyboardButton.

Parameters

ParameterTypeDescription
textstrThe text of the button.
valuestrThe value of the button.
typestrThe type of the button.

Return

An InlineKeyboardButton.

function Kurimod.force_reply(selective=True)

Create a ForceReply.

Parameters

ParameterTypeDescription
selectiveboolWhether the reply should be selective.

Return

A ForceReply.

function Kurimod.ikb(rows=None)

Create an InlineKeyboardMarkup from a list of lists of buttons.

Parameters

ParameterTypeDescription
rowslist[list[InlineKeyboardButton]]A list of lists of buttons.

Return

An InlineKeyboardMarkup.

function Kurimod.kb(rows=None, **kwargs)

Create a ReplyKeyboardMarkup from a list of lists of buttons.

Parameters

ParameterTypeDescription
rowslist[list[KeyboardButton]]A list of lists of buttons.
**kwargsdictKeyword arguments to pass to ReplyKeyboardMarkup.

Return

A ReplyKeyboardMarkup.

function Kurimod.kbtn

alias of KeyboardButton

function Kurimod.ntb(button)

Deserialize an InlineKeyboardButton to btn() format.

Parameters

ParameterTypeDescription
buttonInlineKeyboardButtonAn InlineKeyboardButton.

Return

A btn() format button.