peyk.platforms.rubika.types

Rubika API types, one public type per module.

class peyk.platforms.rubika.types.File(file_id: str = '', file_name: str | None = None, size: str | None = None)[source]

Bases: object

Represent the Rubika Bot API File type.

The class preserves the existing public fields and wire-format behavior.

file_id: str = ''
file_name: str | None = None
classmethod from_dict(data: dict | None) File | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

size: str | None = None
class peyk.platforms.rubika.types.Location(latitude: str | None = None, longitude: str | None = None)[source]

Bases: object

Represent the Rubika Bot API Location type.

The class preserves the existing public fields and wire-format behavior.

classmethod from_dict(data: dict | None) Location | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

latitude: str | None = None
longitude: str | None = None
class peyk.platforms.rubika.types.Chat(chat_id: str = '', chat_type: str = '', user_id: str | None = None, first_name: str | None = None, last_name: str | None = None, title: str | None = None, username: str | None = None)[source]

Bases: object

Represent the Rubika Bot API Chat type.

The class preserves the existing public fields and wire-format behavior.

chat_id: str = ''
chat_type: str = ''
first_name: str | None = None
classmethod from_dict(data: dict | None) Chat | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

last_name: str | None = None
title: str | None = None
user_id: str | None = None
username: str | None = None
class peyk.platforms.rubika.types.Bot(bot_id: str = '', bot_title: str = '', avatar: File | None = None, description: str | None = None, username: str | None = None, start_message: str | None = None, share_url: str | None = None)[source]

Bases: object

Represent the Rubika Bot API Bot type.

The class preserves the existing public fields and wire-format behavior.

avatar: File | None = None
bot_id: str = ''
bot_title: str = ''
description: str | None = None
classmethod from_dict(data: dict | None) Bot | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

share_url: str | None = None
start_message: str | None = None
username: str | None = None
class peyk.platforms.rubika.types.BotCommand(command: str = '', description: str = '')[source]

Bases: object

Represent the Rubika Bot API BotCommand type.

The class preserves the existing public fields and wire-format behavior.

command: str = ''
description: str = ''
classmethod from_dict(data: dict | None) BotCommand | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

to_dict() Dict[str, object][source]

Performs the to dict operation for the Rubika client.

Returns:

Result produced by the Rubika operation.

class peyk.platforms.rubika.types.Sticker(sticker_id: str = '', file: File | None = None, emoji_character: str | None = None)[source]

Bases: object

Represent the Rubika Bot API Sticker type.

The class preserves the existing public fields and wire-format behavior.

emoji_character: str | None = None
file: File | None = None
classmethod from_dict(data: dict | None) Sticker | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

sticker_id: str = ''
class peyk.platforms.rubika.types.ContactMessage(phone_number: str | None = None, first_name: str | None = None, last_name: str | None = None)[source]

Bases: object

Represent the Rubika Bot API ContactMessage type.

The class preserves the existing public fields and wire-format behavior.

first_name: str | None = None
classmethod from_dict(data: dict | None) ContactMessage | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

last_name: str | None = None
phone_number: str | None = None
class peyk.platforms.rubika.types.PollStatus(state: str = 'Open', selection_index: int = -1, percent_vote_options: List[int] | None = None, total_vote: int = 0, show_total_votes: bool = False)[source]

Bases: object

Represent the Rubika Bot API PollStatus type.

The class preserves the existing public fields and wire-format behavior.

classmethod from_dict(data: dict | None) PollStatus | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

percent_vote_options: List[int] | None = None
selection_index: int = -1
show_total_votes: bool = False
state: str = 'Open'
total_vote: int = 0
class peyk.platforms.rubika.types.Poll(question: str = '', options: List[str] | None = None, poll_status: PollStatus | None = None)[source]

Bases: object

Represent the Rubika Bot API Poll type.

The class preserves the existing public fields and wire-format behavior.

classmethod from_dict(data: dict | None) Poll | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

options: List[str] | None = None
poll_status: PollStatus | None = None
question: str = ''
class peyk.platforms.rubika.types.ForwardedFrom(type_from: str | None = None, message_id: str | None = None, from_chat_id: str | None = None, from_sender_id: str | None = None)[source]

Bases: object

Represent the Rubika Bot API ForwardedFrom type.

The class preserves the existing public fields and wire-format behavior.

from_chat_id: str | None = None
classmethod from_dict(data: dict | None) ForwardedFrom | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

from_sender_id: str | None = None
message_id: str | None = None
type_from: str | None = None
class peyk.platforms.rubika.types.AuxData(start_id: str | None = None, button_id: str | None = None)[source]

Bases: object

Callback data – carries the button that was pressed.

Confirmed from the docs’ receiveUpdate/receiveInlineMessage example bodies.

button_id: str | None = None
classmethod from_dict(data: dict | None) AuxData | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

start_id: str | None = None
class peyk.platforms.rubika.types.MetadataPart(type: str = '', from_index: int = 0, length: int = 0, link_url: str | None = None, mention_text_user_id: str | None = None)[source]

Bases: object

Represent the Rubika Bot API MetadataPart type.

The class preserves the existing public fields and wire-format behavior.

classmethod from_dict(data: dict | None) MetadataPart | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

from_index: int = 0
length: int = 0
mention_text_user_id: str | None = None
to_dict() Dict[str, object][source]

Performs the to dict operation for the Rubika client.

Returns:

Result produced by the Rubika operation.

type: str = ''
class peyk.platforms.rubika.types.Metadata(meta_data_parts: List[MetadataPart] = <factory>)[source]

Bases: object

Represent the Rubika Bot API Metadata type.

The class preserves the existing public fields and wire-format behavior.

classmethod from_dict(data: dict | None) Metadata | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

to_dict() Dict[str, object][source]

Performs the to dict operation for the Rubika client.

Returns:

Result produced by the Rubika operation.

meta_data_parts: List[MetadataPart]
class peyk.platforms.rubika.types.ButtonSelectionItem(text: str = '', image_url: str | None = None, type: str | None = None)[source]

Bases: object

Represent the Rubika Bot API ButtonSelectionItem type.

The class preserves the existing public fields and wire-format behavior.

classmethod from_dict(data: dict | None) ButtonSelectionItem | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

image_url: str | None = None
text: str = ''
to_dict() Dict[str, object][source]

Performs the to dict operation for the Rubika client.

Returns:

Result produced by the Rubika operation.

type: str | None = None
class peyk.platforms.rubika.types.ButtonSelection(selection_id: str = '', search_type: str = 'None', get_type: str = 'Local', items: List[ButtonSelectionItem] = <factory>, is_multi_selection: bool = False, columns_count: str = '1', title: Optional[str] = None)[source]

Bases: object

Represent the Rubika Bot API ButtonSelection type.

The class preserves the existing public fields and wire-format behavior.

columns_count: str = '1'
classmethod from_dict(data: dict | None) ButtonSelection | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

get_type: str = 'Local'
is_multi_selection: bool = False
search_type: str = 'None'
selection_id: str = ''
title: str | None = None
to_dict() Dict[str, object][source]

Performs the to dict operation for the Rubika client.

Returns:

Result produced by the Rubika operation.

items: List[ButtonSelectionItem]
class peyk.platforms.rubika.types.ButtonCalendar(default_value: str | None = None, type: str = 'DatePersian', min_year: str = '1300', max_year: str = '1450', title: str = '')[source]

Bases: object

Represent the Rubika Bot API ButtonCalendar type.

The class preserves the existing public fields and wire-format behavior.

default_value: str | None = None
classmethod from_dict(data: dict | None) ButtonCalendar | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

max_year: str = '1450'
min_year: str = '1300'
title: str = ''
to_dict() Dict[str, object][source]

Performs the to dict operation for the Rubika client.

Returns:

Result produced by the Rubika operation.

type: str = 'DatePersian'
class peyk.platforms.rubika.types.ButtonNumberPicker(min_value: str = '0', max_value: str = '100', default_value: str | None = None, title: str = '')[source]

Bases: object

Represent the Rubika Bot API ButtonNumberPicker type.

The class preserves the existing public fields and wire-format behavior.

default_value: str | None = None
classmethod from_dict(data: dict | None) ButtonNumberPicker | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

max_value: str = '100'
min_value: str = '0'
title: str = ''
to_dict() Dict[str, object][source]

Performs the to dict operation for the Rubika client.

Returns:

Result produced by the Rubika operation.

class peyk.platforms.rubika.types.ButtonStringPicker(items: ~typing.List[str] = <factory>, default_value: str | None = None, title: str | None = None)[source]

Bases: object

Represent the Rubika Bot API ButtonStringPicker type.

The class preserves the existing public fields and wire-format behavior.

default_value: str | None = None
classmethod from_dict(data: dict | None) ButtonStringPicker | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

title: str | None = None
to_dict() Dict[str, object][source]

Performs the to dict operation for the Rubika client.

Returns:

Result produced by the Rubika operation.

items: List[str]
class peyk.platforms.rubika.types.ButtonTextbox(type_line: str = 'SingleLine', type_keypad: str = 'String', place_holder: str | None = None, title: str | None = None, default_value: str | None = None)[source]

Bases: object

Represent the Rubika Bot API ButtonTextbox type.

The class preserves the existing public fields and wire-format behavior.

default_value: str | None = None
classmethod from_dict(data: dict | None) ButtonTextbox | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

place_holder: str | None = None
title: str | None = None
to_dict() Dict[str, object][source]

Performs the to dict operation for the Rubika client.

Returns:

Result produced by the Rubika operation.

type_keypad: str = 'String'
type_line: str = 'SingleLine'
class peyk.platforms.rubika.types.ButtonLocation(default_pointer_location: Location | None = None, default_map_location: Location | None = None, type: str = 'Picker', title: str | None = None)[source]

Bases: object

Represent the Rubika Bot API ButtonLocation type.

The class preserves the existing public fields and wire-format behavior.

default_map_location: Location | None = None
default_pointer_location: Location | None = None
classmethod from_dict(data: dict | None) ButtonLocation | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

title: str | None = None
to_dict() Dict[str, object][source]

Performs the to dict operation for the Rubika client.

Returns:

Result produced by the Rubika operation.

type: str = 'Picker'
class peyk.platforms.rubika.types.Button(id: str = '', type: str = 'Simple', button_text: str = '', button_selection: ButtonSelection | None = None, button_calendar: ButtonCalendar | None = None, button_number_picker: ButtonNumberPicker | None = None, button_string_picker: ButtonStringPicker | None = None, button_location: ButtonLocation | None = None, button_textbox: ButtonTextbox | None = None)[source]

Bases: object

A single button.

Structure per the official docs: base fields (id, type, button_text) plus exactly one nested button_* object whose name depends on the type.

button_calendar: ButtonCalendar | None = None
button_location: ButtonLocation | None = None
button_number_picker: ButtonNumberPicker | None = None
button_selection: ButtonSelection | None = None
button_string_picker: ButtonStringPicker | None = None
button_text: str = ''
button_textbox: ButtonTextbox | None = None
classmethod from_dict(data: dict | None) Button | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

id: str = ''
to_dict() Dict[str, object][source]

Performs the to dict operation for the Rubika client.

Returns:

Result produced by the Rubika operation.

type: str = 'Simple'
class peyk.platforms.rubika.types.KeypadRow(buttons: List[Button] = <factory>)[source]

Bases: object

Represent the Rubika Bot API KeypadRow type.

The class preserves the existing public fields and wire-format behavior.

classmethod from_dict(data: dict | None) KeypadRow | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

to_dict() Dict[str, object][source]

Performs the to dict operation for the Rubika client.

Returns:

Result produced by the Rubika operation.

buttons: List[Button]
class peyk.platforms.rubika.types.Keypad(rows: List[KeypadRow] = <factory>, resize_keyboard: Optional[bool] = None, one_time_keyboard: Optional[bool] = None)[source]

Bases: object

Represent the Rubika Bot API Keypad type.

The class preserves the existing public fields and wire-format behavior.

classmethod from_dict(data: dict | None) Keypad | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

one_time_keyboard: bool | None = None
resize_keyboard: bool | None = None
to_dict() Dict[str, object][source]

Performs the to dict operation for the Rubika client.

Returns:

Result produced by the Rubika operation.

rows: List[KeypadRow]
class peyk.platforms.rubika.types.Message(message_id: str = '', text: str | None = None, time: int | None = None, is_edited: bool = False, sender_type: str | None = None, sender_id: str | None = None, aux_data: AuxData | None = None, file: File | None = None, reply_to_message_id: str | None = None, forwarded_from: ForwardedFrom | None = None, forwarded_no_link: str | None = None, location: Location | None = None, sticker: Sticker | None = None, contact_message: ContactMessage | None = None, poll: Poll | None = None)[source]

Bases: object

Represent the Rubika Bot API Message type.

The class preserves the existing public fields and wire-format behavior.

aux_data: AuxData | None = None
contact_message: ContactMessage | None = None
file: File | None = None
forwarded_from: ForwardedFrom | None = None
classmethod from_dict(data: dict | None) Message | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

is_edited: bool = False
location: Location | None = None
message_id: str = ''
poll: Poll | None = None
reply_to_message_id: str | None = None
sender_id: str | None = None
sender_type: str | None = None
sticker: Sticker | None = None
text: str | None = None
time: int | None = None
class peyk.platforms.rubika.types.Event(type: str | None = None, access_list: List[str] | None = None, join_type: str | None = None)[source]

Bases: object

Represent the Rubika Bot API Event type.

The class preserves the existing public fields and wire-format behavior.

access_list: List[str] | None = None
classmethod from_dict(data: dict | None) Event | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

join_type: str | None = None
type: str | None = None
class peyk.platforms.rubika.types.Update(type: str | None = None, chat_id: str | None = None, removed_message_id: str | None = None, new_message: Message | None = None, updated_message: Message | None = None, event_data: Event | None = None)[source]

Bases: object

Represent the Rubika Bot API Update type.

The class preserves the existing public fields and wire-format behavior.

chat_id: str | None = None
event_data: Event | None = None
classmethod from_dict(data: dict | None) Update | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

new_message: Message | None = None
removed_message_id: str | None = None
type: str | None = None
updated_message: Message | None = None
class peyk.platforms.rubika.types.InlineMessage(sender_id: str = '', text: str | None = None, file: File | None = None, location: Location | None = None, aux_data: AuxData | None = None, message_id: str = '', chat_id: str = '')[source]

Bases: object

Represent the Rubika Bot API InlineMessage type.

The class preserves the existing public fields and wire-format behavior.

aux_data: AuxData | None = None
chat_id: str = ''
file: File | None = None
classmethod from_dict(data: dict | None) InlineMessage | None[source]

Performs the from dict operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

location: Location | None = None
message_id: str = ''
sender_id: str = ''
text: str | None = None
class peyk.platforms.rubika.types.GetUpdatesResult(updates: List[Update] = <factory>, next_offset_id: Optional[str] = None)[source]

Bases: object

Wrapper for the getUpdates response payload.

Confirmed from the official docs: the data field carries both updates (list) and next_offset_id (the offset to pass on the next call).

classmethod from_data(data: object) GetUpdatesResult[source]

Performs the from data operation for the Rubika client.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the Rubika operation.

next_offset_id: str | None = None
updates: List[Update]

Modules