Skip to main content

Rubika Bot Library

Project description

Rubika has created APIs for you that you can use to build your own "bot".

Requirements

  • python3.8 +

Steps of use

  • First you have to create a bot for yourself with Bot Father.
  • Hold the token it gives you and use it in the rest of the steps.
  • Using your desired method and token, create your URL in the following format and request POST.
https://messengerg2b1.iranlms.ir/v3/{token}/{method}
  • If you use the python language, you can also use the rubika-bot package.

Description

After you have built your bot in Bot Father and defined your endpoint, the system will send any event or message sent to your bot to your Endpoint in one of the following two ways.

  • Endpoint/receiveUpdate
  • Endpoint/receiveInlineMessage

receiveUpdate

Whenever a user sends a message or taps on a keypad , you will receive this type of request.


sample body :
{
    "inline_message": {
        "sender_id": "u0QFtn01dd26d72abc5c77b8e116cd79",
        "text": "custom text",
        "location": null,
        "aux_data": {
            "start_id": null,
            "button_id": "61f674bd0abcd57b5b816a7c"
        },
        "message_id": "204216801381244279",
        "chat_id": "b0QFtabc1I02214b529f1d60c9ce5b08"
    }
}
  • sender_id: Unique identifier assigned to the user.
  • text: The text of the sent button.
  • button_id: The ID you set for the button.
  • message_id: The unique identifier assigned to the message.
  • chat_id: Unique identifier for the conversation between the user and the bot (you must continue to use this identifier.)

receiveInlineMessage

Whenever the user taps on the inline keypad, you receive this type of request.


sample body :
{
  "update": {
      "type": "NewMessage",
      "chat_id": "b0QFtn0C1I022abcd29f1d60c9ce5b08",
      "new_message": {
          "message_id": 204215121115944300,
          "text": "custom text",
          "time": "1643122902",
          "is_edited": false,
          "sender_type": "User",
          "sender_id": "u0QFtn0abcded727585c77b8e116cd79",
          "aux_data": {
              "start_id": null,
              "button_id": "61f674bd0abcd57b5b816a7c"
          }
      }
  }
}
  • type: can be NewMessage , StartedBot , StoppedBot and ....
  • text: The text of the sent button.
  • button_id: is the identifier you set for the button.
  • message_id: The unique identifier assigned to the message.
  • chat_id: Unique identifier for the conversation between the user and the bot (you must continue to use this identifier.)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rubika-bot-1.0.7.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

rubika_bot-1.0.7-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file rubika-bot-1.0.7.tar.gz.

File metadata

  • Download URL: rubika-bot-1.0.7.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for rubika-bot-1.0.7.tar.gz
Algorithm Hash digest
SHA256 70f159b801f5a755b9f52ac9312bbb1e94104f0d6cae40ca2aface4205317cbd
MD5 65dcc4abfa19453be5e8f457d1cdb7a0
BLAKE2b-256 d00a7e7dc19101c4ddb1a24a4176bf43fdeacb8851d886de6ed5854df13fe987

See more details on using hashes here.

Provenance

File details

Details for the file rubika_bot-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: rubika_bot-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for rubika_bot-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7a78cc47d3fd150b4f4ea2ec98af1bfbfe92c7fdb8cbd4d44524ec623e6e1da3
MD5 ec7fa5b1ce0c4686fcb284d63731b439
BLAKE2b-256 18617b4fd591b9893779aef0cbc9051613e9913028ef7911db4e7a60ad7a9b60

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page