{"id":13718573,"url":"https://github.com/Ewpratten/drbot","last_synced_at":"2025-05-07T10:33:13.011Z","repository":{"id":57423977,"uuid":"196737546","full_name":"ewpratten/drbot","owner":"ewpratten","description":"A Python3 library for easily building devRant bots","archived":false,"fork":false,"pushed_at":"2019-08-30T17:31:17.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-09T20:41:33.119Z","etag":null,"topics":["devrant-bots"],"latest_commit_sha":null,"homepage":null,"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/ewpratten.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}},"created_at":"2019-07-13T15:34:39.000Z","updated_at":"2020-03-16T22:43:54.000Z","dependencies_parsed_at":"2022-09-14T07:24:01.503Z","dependency_job_id":null,"html_url":"https://github.com/ewpratten/drbot","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/ewpratten%2Fdrbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewpratten%2Fdrbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewpratten%2Fdrbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewpratten%2Fdrbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ewpratten","download_url":"https://codeload.github.com/ewpratten/drbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224124703,"owners_count":17259741,"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":["devrant-bots"],"created_at":"2024-08-03T01:00:33.156Z","updated_at":"2024-11-14T08:30:35.139Z","avatar_url":"https://github.com/ewpratten.png","language":"Python","readme":"# drbot\nA Python3 library for easily building devRant bots\n\n## Using\nTo make a bot, all you need to do is extend the `BotBuilder` class and define an `onNotif()` method\n\n```python\nfrom drbot.botbuilder import BotBuilder, NotifType\n\n# Testing setup\nclass MyBot(BotBuilder):\n        \n    onNotif(self, type, content):\n        # Handle notifs here\n        pass\n\n# Create a bot\nmy_bot = MyBot(\"username\", \"password\")\n\n# Set how long the bot should wait between notif queries (in seconds)\ninterval = 10\n\n# Start the bot\nmy_bot.start(interval)\n```\n\nThat's it!\n\n## Using the API\nEvery `BotBuilder` class has a built in API wrapper. This can be accessed through `self.api`, and contains the following methods:\n```python\ngetUserInfo(username: str) -\u003e dict\n\ngetUsername(user_id: int) -\u003e str\n\npostRant(body: str, tags: str) -\u003e None\n\npostComment(rant_id: int, content: str) -\u003e None\n\ngetComment(comment_id: int) -\u003e dict\n```\n\nThe `BotBuilder` automatically handles login, sessions, notif management, and some data parsing. If you are looking to override these, you may be interested in the following API methods:\n```python\nlogin(username: str, password: str) -\u003e None\n\nhasAuthExpired() -\u003e bool\n\ngetNotifs() -\u003e list\n\nclearNotifs() -\u003e None\n\ngetUserId(username: str) -\u003e int\n```\n\n## Installing\nThis library is avalible on PYPI. \n\nWith `python3.7` and `python3-pip` installed, run:\n```\npip3 install drbot\n```\n\nto install `drbot`","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEwpratten%2Fdrbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEwpratten%2Fdrbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEwpratten%2Fdrbot/lists"}