Skip to main content

pyromod.helpers

function pyromod.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 pyromod.bki(keyboard)​

Deserialize an InlineKeyboardMarkup to a list of lists of buttons.

Parameters​

ParameterTypeDescription
keyboardInlineKeyboardMarkupAn InlineKeyboardMarkup.

Return​

A list of lists of buttons.

function pyromod.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 pyromod.force_reply(selective=True)​

Create a ForceReply.

Parameters​

ParameterTypeDescription
selectiveboolWhether the reply should be selective.

Return​

A ForceReply.

function pyromod.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 pyromod.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 pyromod.kbtn​

alias of KeyboardButton

function pyromod.ntb(button)​

Deserialize an InlineKeyboardButton to btn() format.

Parameters​

ParameterTypeDescription
buttonInlineKeyboardButtonAn InlineKeyboardButton.

Return​

A btn() format button.