{"id":19013003,"url":"https://github.com/ntk148v/rocketbot","last_synced_at":"2025-04-13T07:16:27.981Z","repository":{"id":87351466,"uuid":"586826053","full_name":"ntk148v/rocketbot","owner":"ntk148v","description":"Python framework to build RocketChat bot","archived":false,"fork":false,"pushed_at":"2023-01-12T08:12:58.000Z","size":33,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T07:16:20.432Z","etag":null,"topics":["bot","bot-framework","python-3","rocketchat","rocketchat-bot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ntk148v.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},"funding":{"github":"ntk148v","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-01-09T10:20:22.000Z","updated_at":"2024-06-21T17:57:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f634436-7493-4b01-ac7b-776dc2a29c89","html_url":"https://github.com/ntk148v/rocketbot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntk148v%2Frocketbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntk148v%2Frocketbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntk148v%2Frocketbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntk148v%2Frocketbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ntk148v","download_url":"https://codeload.github.com/ntk148v/rocketbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248675392,"owners_count":21143768,"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","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","bot-framework","python-3","rocketchat","rocketchat-bot"],"created_at":"2024-11-08T19:21:15.759Z","updated_at":"2025-04-13T07:16:27.948Z","avatar_url":"https://github.com/ntk148v.png","language":"Python","funding_links":["https://github.com/sponsors/ntk148v"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003erocketbot\u003c/h1\u003e\n  \u003cblockquote align=\"center\"\u003e\n    Python framework to build RocketChat bot\n  \u003c/blockquote\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/ntk148v/rocketbot/blob/master/LICENSE\"\u003e\n      \u003cimg\n        alt=\"GitHub license\"\n        src=\"https://img.shields.io/github/license/ntk148v/rocketbot?style=for-the-badge\"\n      /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ntk148v/rocketbot/stargazers\"\u003e\n      \u003cimg\n        alt=\"GitHub stars\"\n        src=\"https://img.shields.io/github/stars/ntk148v/rocketbot?style=for-the-badge\"\n      /\u003e\n    \u003c/a\u003e\n    \u003cbr /\u003e\n  \u003c/p\u003e\n  \u003cbr /\u003e\n\u003c/div\u003e\n\nTable of contents\n\n- [1. Installation](#1-installation)\n- [2. Usage](#2-usage)\n  - [2.1. Create new bot](#21-create-new-bot)\n  - [2.2. Create a new plugin (command)](#22-create-a-new-plugin-command)\n  - [2.3. Custom logger configuration](#23-custom-logger-configuration)\n  - [2.4. Run it](#24-run-it)\n- [3. Credits](#3-credits)\n\n## 1. Installation\n\n```shell\npip install git+https://github.com/ntk148v/rocketbot.git\n```\n\n## 2. Usage\n\nCheck out the [sample](./sample.py).\n\n### 2.1. Create new bot\n\n```python\nimport os\n\nfrom rocketbot import RocketBot\n\nusername = os.environ.get('ROCKET_USERNAME')\npassword = os.environ.get('ROCKET_PASSWORD')\nserver_url = os.environ.get('ROCKET_SERVER_URL')\n\nrocket = RocketBot(user=username, password=password,\n                   server_url=server_url, ssl_verify=False,\n                   session=requests.sessions.Session(),\n                   threading_updates=True)\n\n\n```\n\n### 2.2. Create a new plugin (command)\n\nYou can add a new plugin to initialized bot by using decorator `add_command`. `add_command` requires 2 arguments:\n\n- The regex that bot will respond if matching.\n- The bot's usage.\n\n```python\n@rocket.add_command(r'/start', usage='Start working with bot')\ndef start(message, *args):\n    rocket.send_message(\n        message['rid'], f\"hi @{message['u']['username']}, let's start\")\n```\n\n### 2.3. Custom logger configuration\n\nBy default, RocketBot writes log to stderr with default level is \"INFO\". You can customize it by passing a configuration dict. You can refer to [loguru's offical document](https://loguru.readthedocs.io/en/stable/api/logger.html#loguru._logger.Logger.configure).\n\n```python\nrocket = RocketBot(user=username, password=password,\n                   server_url=server_url, ssl_verify=False,\n                   session=requests.sessions.Session(),\n                   logger_config={\n                       \"handlers\": [\n                           {\"sink\": sys.stdout, \"format\": \"{time} - {message}\"},\n                           {\"sink\": \"/tmp/file.log\", \"serialize\": True},\n                       ],\n                   },\n                   threading_updates=True)\n```\n\n### 2.4. Run it\n\n```python\nrocket.run(sleep=10)\n```\n\n## 3. Credits\n\nThis library is highly inspired by:\n\n- [seyed-dev/rocketchatbot](https://github.com/seyed-dev/rocketchatbot)\n- [jadolg/RocketChatBot](https://github.com/jadolg/RocketChatBot)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntk148v%2Frocketbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fntk148v%2Frocketbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntk148v%2Frocketbot/lists"}