{"id":32396195,"url":"https://github.com/alirn76/rubika-bot","last_synced_at":"2025-10-25T06:59:08.845Z","repository":{"id":233407999,"uuid":"475787051","full_name":"AliRn76/rubika-bot","owner":"AliRn76","description":"Rubika Bot Library","archived":false,"fork":false,"pushed_at":"2022-05-09T07:12:02.000Z","size":218,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-24T22:40:54.865Z","etag":null,"topics":["bot","rubika","rubika-bot"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/rubika-bot/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AliRn76.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-30T08:26:25.000Z","updated_at":"2024-10-07T11:47:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"4fa4ef09-b934-47de-8070-9fe010127706","html_url":"https://github.com/AliRn76/rubika-bot","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"203da2e585f03d6b2cef96cbd7a68b471e010db7"},"previous_names":["alirn76/rubika-bot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AliRn76/rubika-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliRn76%2Frubika-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliRn76%2Frubika-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliRn76%2Frubika-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliRn76%2Frubika-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AliRn76","download_url":"https://codeload.github.com/AliRn76/rubika-bot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliRn76%2Frubika-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280917366,"owners_count":26413206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","rubika","rubika-bot"],"created_at":"2025-10-25T06:58:49.116Z","updated_at":"2025-10-25T06:59:08.837Z","avatar_url":"https://github.com/AliRn76.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Rubika has created APIs for you that you can use to build your own \"bot\".\n\n## Requirements\n```\npython3.8 +\n```\n\n## Installation\n```\n$ pip install rubika-bot\n```\n\n## Steps of use\n- First you have to create a bot for yourself with \u003cb/\u003eBot Father\u003c/b\u003e.\n- Hold the token it gives you and use it the following methods.\n\n\n## Description\n\nAfter 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.\n \n- Endpoint/``receiveUpdate``\n- Endpoint/``receiveInlineMessage``\n\n\u003cbr/\u003e\n\n### receiveUpdate\n\nWhenever a user \u003cb\u003e sends a message \u003c/b\u003e or taps on a \u003cb\u003e keypad \u003c/b\u003e, you will receive this type of request.\n\n\u003cbr/\u003e\n\u003ci\u003esample body :\u003c/i\u003e\n\n```json\n{\n    \"inline_message\": {\n        \"sender_id\": \"u0QFtn01dd26d72abc5c77b8e116cd79\",\n        \"text\": \"custom text\",\n        \"location\": null,\n        \"aux_data\": {\n            \"start_id\": null,\n            \"button_id\": \"61f674bd0abcd57b5b816a7c\"\n        },\n        \"message_id\": \"204216801381244279\",\n        \"chat_id\": \"b0QFtabc1I02214b529f1d60c9ce5b08\"\n    }\n}\n```\n\n  - \u003cb\u003e sender_id: \u003c/b\u003e Unique identifier assigned to the user.\n  - \u003cb\u003e text: \u003c/b\u003e The text of the sent button.\n  - \u003cb\u003e button_id: \u003c/b\u003e The ID you set for the button.\n  - \u003cb\u003e message_id: \u003c/b\u003e The unique identifier assigned to the message.\n  - \u003cb\u003e chat_id: \u003c/b\u003e Unique identifier for the conversation between the user and the bot \u003cb\u003e (you must continue to use this identifier.) \u003c/b\u003e\n\n\n\u003cbr/\u003e\n\n### receiveInlineMessage\nWhenever the user taps on the \u003cb\u003einline keypad\u003c/b\u003e, you receive this type of request.\n\n\u003cbr/\u003e\n\u003ci\u003esample body :\u003c/i\u003e\n\n```json \n{\n  \"update\": {\n      \"type\": \"NewMessage\",\n      \"chat_id\": \"b0QFtn0C1I022abcd29f1d60c9ce5b08\",\n      \"new_message\": {\n          \"message_id\": 204215121115944300,\n          \"text\": \"custom text\",\n          \"time\": \"1643122902\",\n          \"is_edited\": false,\n          \"sender_type\": \"User\",\n          \"sender_id\": \"u0QFtn0abcded727585c77b8e116cd79\",\n          \"aux_data\": {\n              \"start_id\": null,\n              \"button_id\": \"61f674bd0abcd57b5b816a7c\"\n          }\n      }\n  }\n}\n```\n\n  - \u003cb\u003e type: \u003c/b\u003e can be \u003cb\u003e NewMessage \u003c/b\u003e, \u003cb\u003e StartedBot \u003c/b\u003e, \u003cb\u003e StoppedBot \u003c/b\u003e and ....\n  - \u003cb\u003e text: \u003c/b\u003e The text of the sent button.\n  - \u003cb\u003e button_id: \u003c/b\u003e is the identifier you set for the button.\n  - \u003cb\u003e message_id: \u003c/b\u003e The unique identifier assigned to the message.\n  - \u003cb\u003e chat_id: \u003c/b\u003e Unique identifier for the conversation between the user and the bot \u003cb\u003e (you must continue to use this identifier.) \u003c/b\u003e\n\n## Usage\n\n- #### Get Your Bot Information\n\n```python\nfrom rubika_bot.requests import get_me\nfrom rubika_bot.models import Bot\n\nbot: Bot = get_me(token=...)\n```\n\n- #### Send Start Keypad\n\n```python\nfrom rubika_bot.requests import send_message\nfrom rubika_bot.models import Keypad, KeypadRow, Button\n\nb1 = Button(id='100', type='Simple', button_text='Add Account')\nb2 = Button(id='101', type='Simple', button_text='Edit Account')\nb3 = Button(id='102', type='Simple', button_text='Remove Account')\nkeypad = Keypad(\n    rows=[\n        KeypadRow(buttons=[b1]),\n        KeypadRow(buttons=[b2, b3])\n    ],\n    resize_keyboard=True,\n    on_time_keyboard=False\n)\nsend_message(\n    token=...,\n    chat_id=...,\n    text='Welcome',\n    chat_keypad_type='New',\n    chat_keypad=keypad\n)\n```\n\n- #### Send Inline Keypad\n\n```python\nfrom rubika_bot.requests import send_message\nfrom rubika_bot.models import Keypad, KeypadRow, Button\n\nb1 = Button(id='100', type='Simple', button_text='Add Account')\nb2 = Button(id='101', type='Simple', button_text='Edit Account')\nb3 = Button(id='102', type='Simple', button_text='Remove Account')\nkeypad = Keypad(\n    rows=[\n        KeypadRow(buttons=[b1]),\n        KeypadRow(buttons=[b2, b3])\n    ],\n)\nsend_message(\n    token=...,\n    chat_id=...,\n    text='Welcome',\n    inline_keypad=keypad\n)\n```\n\n- #### Send Message\n\n```python\nfrom rubika_bot.requests import send_message\n\nsend_message(\n    token=...,\n    chat_id=...,\n    text='Hello World',\n)\n```\n\n- #### Send Poll\n\n```python\nfrom rubika_bot.requests import send_poll\n\nsend_poll(\n    token=...,\n    chat_id=...,\n    question='Do you have any question?',\n    options=['yes', 'no']\n)\n```\n\n- #### Send Location\n\n```python\nfrom rubika_bot.requests import send_location\n\nsend_location(\n    token=...,\n    chat_id=...,\n    latitude='35.759662741892626',\n    longitude='51.4036344416759'\n)\n```\n\n- #### Send Contact\n\n```python\nfrom rubika_bot.requests import send_contact\n\nsend_contact(\n    token=...,\n    chat_id=...,\n    first_name='Ali',\n    last_name='Rn',\n    phone_number='09038754321'\n)\n```\n\n- #### Get Chat Information\n\n```python\nfrom rubika_bot.requests import get_chat\nfrom rubika_bot.models import Chat\n\nchat: Chat = get_chat(\n    token=...,\n    chat_id=...,\n)   \n```\n\n- #### Get Last 10 Updates\n\n```python\nfrom rubika_bot.requests import get_updates\nfrom rubika_bot.models import Update\n\nupdates, _ = get_updates(\n    token=...,\n    limit=10,\n)\n```\n\n- #### Forward Message\n\n```python\nfrom rubika_bot.requests import forward_message\n\nforward_message(\n    token=...,\n    from_chat_id=...,\n    message_id=...,\n    to_chat_id=...\n)\n```\n\n- #### Edit Message Text\n\n```python\nfrom rubika_bot.requests import edit_message_text\n\nedit_message_text(\n    token=...,\n    chat_id=...,\n    message_id=...,\n    text='New Message Text'\n)\n```\n\n- #### Edit Inline Keypad\n\n```python\nfrom rubika_bot.requests import edit_message_keypad\nfrom rubika_bot.models import Button, Keypad, KeypadRow\n\nb1 = Button(id='100', type='Simple', button_text='Add Account')\nb2 = Button(id='101', type='Simple', button_text='Edit Account')\nb3 = Button(id='102', type='Simple', button_text='Remove Account')\nnew_keypad = Keypad(\n    rows=[\n        KeypadRow(buttons=[b1]),\n        KeypadRow(buttons=[b2, b3])\n    ],\n)\n\nedit_message_keypad(\n    token=...,\n    chat_id=...,\n    message_id=...,\n    inline_keypad=new_keypad\n)\n```\n\n- #### Delete Message\n\n```python\nfrom rubika_bot.requests import delete_message\n\ndelete_message(\n    token=...,\n    chat_id=...,\n    message_id=...,\n)\n```\n\n\u003c/div\u003e\n\n## TODO:\n- [x] Change the required python version from 3.10 to 3.8 \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falirn76%2Frubika-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falirn76%2Frubika-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falirn76%2Frubika-bot/lists"}