peyk.platforms.rubika.methods

Rubika client methods, one module per method.

async peyk.platforms.rubika.methods.close(self) None[source]

Performs the close operation for the Rubika client.

async peyk.platforms.rubika.methods.get_me(self) Bot[source]

Retrieves me from the Rubika API.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.send_message(self, chat_id: str, text: str, *, metadata: Metadata | Dict[str, object] | None = None, chat_keypad: Keypad | Dict[str, object] | None = None, inline_keypad: Keypad | Dict[str, object] | None = None, chat_keypad_type: str | None = None, reply_to_message_id: str | None = None, disable_notification: bool | None = None) Message[source]

Sends message through the Rubika API.

Parameters:
  • chat_id – Identifier of the target chat.

  • text – Text content supplied to the operation.

  • metadata – Value used by this operation.

  • chat_keypad – Value used by this operation.

  • inline_keypad – Value used by this operation.

  • chat_keypad_type – Value used by this operation.

  • reply_to_message_id – Value used by this operation.

  • disable_notification – Value used by this operation.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.send_poll(self, chat_id: str, question: str, options: List[str]) Message[source]

Sends poll through the Rubika API.

Parameters:
  • chat_id – Identifier of the target chat.

  • question – Value used by this operation.

  • options – Value used by this operation.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.send_location(self, chat_id: str, latitude: str, longitude: str, *, chat_keypad: Keypad | Dict[str, object] | None = None, inline_keypad: Keypad | Dict[str, object] | None = None, chat_keypad_type: str | None = None, reply_to_message_id: str | None = None, disable_notification: bool | None = None) Message[source]

Sends location through the Rubika API.

Parameters:
  • chat_id – Identifier of the target chat.

  • latitude – Value used by this operation.

  • longitude – Value used by this operation.

  • chat_keypad – Value used by this operation.

  • inline_keypad – Value used by this operation.

  • chat_keypad_type – Value used by this operation.

  • reply_to_message_id – Value used by this operation.

  • disable_notification – Value used by this operation.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.send_contact(self, chat_id: str, first_name: str, last_name: str, phone_number: str, *, chat_keypad: Keypad | Dict[str, object] | None = None, inline_keypad: Keypad | Dict[str, object] | None = None, chat_keypad_type: str | None = None, reply_to_message_id: str | None = None, disable_notification: bool | None = None) Message[source]

Sends contact through the Rubika API.

Parameters:
  • chat_id – Identifier of the target chat.

  • first_name – Value used by this operation.

  • last_name – Value used by this operation.

  • phone_number – Value used by this operation.

  • chat_keypad – Value used by this operation.

  • inline_keypad – Value used by this operation.

  • chat_keypad_type – Value used by this operation.

  • reply_to_message_id – Value used by this operation.

  • disable_notification – Value used by this operation.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.get_chat(self, chat_id: str) Chat[source]

Retrieves chat from the Rubika API.

Parameters:

chat_id – Identifier of the target chat.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.get_updates(self, *, offset_id: str | None = None, limit: int | None = None) Tuple[List[Update], str | None][source]

Retrieves updates from the Rubika API.

Parameters:
  • offset_id – Value used by this operation.

  • limit – Maximum number of results requested.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.forward_message(self, from_chat_id: str, message_id: str, to_chat_id: str, *, disable_notification: bool | None = None) str[source]

Performs the forward message operation for the Rubika client.

Parameters:
  • from_chat_id – Value used by this operation.

  • message_id – Identifier of the target message.

  • to_chat_id – Value used by this operation.

  • disable_notification – Value used by this operation.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.edit_message_text(self, chat_id: str, message_id: str, text: str) bool[source]

Edits message text through the Rubika API.

Parameters:
  • chat_id – Identifier of the target chat.

  • message_id – Identifier of the target message.

  • text – Text content supplied to the operation.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.edit_message_keypad(self, chat_id: str, message_id: str, inline_keypad: Keypad | Dict[str, object]) bool[source]

Edits message keypad through the Rubika API.

Parameters:
  • chat_id – Identifier of the target chat.

  • message_id – Identifier of the target message.

  • inline_keypad – Value used by this operation.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.delete_message(self, chat_id: str, message_id: str) bool[source]

Removes message through the Rubika API.

Parameters:
  • chat_id – Identifier of the target chat.

  • message_id – Identifier of the target message.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.set_commands(self, commands: List[BotCommand | Dict[str, object]]) bool[source]

Updates commands through the Rubika API.

Parameters:

commands – Value used by this operation.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.update_bot_endpoints(self, url: str, type: str = UpdateEndpointTypeEnum.RECEIVE_UPDATE) bool[source]

Performs the update bot endpoints operation for the Rubika client.

Parameters:
  • url – Target URL.

  • type – Value used by this operation.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.edit_chat_keypad(self, chat_id: str, chat_keypad: Keypad | Dict[str, object] | None = None, *, chat_keypad_type: str = ChatKeypadTypeEnum.NEW) bool[source]

Edits chat keypad through the Rubika API.

Parameters:
  • chat_id – Identifier of the target chat.

  • chat_keypad – Value used by this operation.

  • chat_keypad_type – Value used by this operation.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.remove_chat_keypad(self, chat_id: str) bool[source]

Removes chat keypad through the Rubika API.

Parameters:

chat_id – Identifier of the target chat.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.get_file(self, file_id: str) str[source]

Retrieves file from the Rubika API.

Parameters:

file_id – Identifier of the file.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.send_file(self, chat_id: str, file_id: str, *, text: str | None = None, chat_keypad: Keypad | Dict[str, object] | None = None, inline_keypad: Keypad | Dict[str, object] | None = None, chat_keypad_type: str | None = None, reply_to_message_id: str | None = None, disable_notification: bool | None = None) Message[source]

Sends file through the Rubika API.

Parameters:
  • chat_id – Identifier of the target chat.

  • file_id – Identifier of the file.

  • text – Text content supplied to the operation.

  • chat_keypad – Value used by this operation.

  • inline_keypad – Value used by this operation.

  • chat_keypad_type – Value used by this operation.

  • reply_to_message_id – Value used by this operation.

  • disable_notification – Value used by this operation.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.request_send_file(self, type: str = FileTypeEnum.FILE) str[source]

Performs the request send file operation for the Rubika client.

Parameters:

type – Value used by this operation.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.upload_file(self, upload_url: str, file_bytes: bytes, *, filename: str = 'file', content_type: str = 'application/octet-stream') str[source]

Performs the upload file operation for the Rubika client.

Parameters:
  • upload_url – Value used by this operation.

  • file_bytes – Value used by this operation.

  • filename – Value used by this operation.

  • content_type – Value used by this operation.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.upload_and_send_file(self, chat_id: str, file_bytes: bytes, *, file_type: str = FileTypeEnum.FILE, filename: str = 'file', content_type: str = 'application/octet-stream', text: str | None = None, **send_kwargs: object) Message[source]

Performs the upload and send file operation for the Rubika client.

Parameters:
  • chat_id – Identifier of the target chat.

  • file_bytes – Value used by this operation.

  • file_type – Value used by this operation.

  • filename – Value used by this operation.

  • content_type – Value used by this operation.

  • text – Text content supplied to the operation.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.ban_chat_member(self, chat_id: str, user_id: str) bool[source]

Performs the ban chat member operation for the Rubika client.

Parameters:
  • chat_id – Identifier of the target chat.

  • user_id – Identifier of the target user.

Returns:

Result produced by the Rubika operation.

async peyk.platforms.rubika.methods.unban_chat_member(self, chat_id: str, user_id: str) bool[source]

Performs the unban chat member operation for the Rubika client.

Parameters:
  • chat_id – Identifier of the target chat.

  • user_id – Identifier of the target user.

Returns:

Result produced by the Rubika operation.

Modules

ban_chat_member(self, chat_id, user_id)

Performs the ban chat member operation for the Rubika client.

close(self)

Performs the close operation for the Rubika client.

delete_message(self, chat_id, message_id)

Removes message through the Rubika API.

edit_chat_keypad(self, chat_id[, ...])

Edits chat keypad through the Rubika API.

edit_message_keypad(self, chat_id, ...)

Edits message keypad through the Rubika API.

edit_message_text(self, chat_id, message_id, ...)

Edits message text through the Rubika API.

forward_message(self, from_chat_id, ...[, ...])

Performs the forward message operation for the Rubika client.

get_chat(self, chat_id)

Retrieves chat from the Rubika API.

get_file(self, file_id)

Retrieves file from the Rubika API.

get_me(self)

Retrieves me from the Rubika API.

get_updates(self, *[, offset_id, limit])

Retrieves updates from the Rubika API.

remove_chat_keypad(self, chat_id)

Removes chat keypad through the Rubika API.

request_send_file(self[, type])

Performs the request send file operation for the Rubika client.

send_contact(self, chat_id, first_name, ...)

Sends contact through the Rubika API.

send_file(self, chat_id, file_id, *[, text, ...])

Sends file through the Rubika API.

send_location(self, chat_id, latitude, ...)

Sends location through the Rubika API.

send_message(self, chat_id, text, *[, ...])

Sends message through the Rubika API.

send_poll(self, chat_id, question, options)

Sends poll through the Rubika API.

set_commands(self, commands)

Updates commands through the Rubika API.

unban_chat_member(self, chat_id, user_id)

Performs the unban chat member operation for the Rubika client.

update_bot_endpoints(self, url[, type])

Performs the update bot endpoints operation for the Rubika client.

upload_and_send_file(self, chat_id, ...[, ...])

Performs the upload and send file operation for the Rubika client.

upload_file(self, upload_url, file_bytes, *)

Performs the upload file operation for the Rubika client.