{"id":20946194,"url":"https://github.com/hunter2809/rsap","last_synced_at":"2026-03-17T16:37:26.694Z","repository":{"id":51149869,"uuid":"369199512","full_name":"Hunter2809/RSAP","owner":"Hunter2809","description":"A simple wrapper for the Random Stuff API","archived":false,"fork":false,"pushed_at":"2021-12-17T16:02:12.000Z","size":582,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-07T22:03:26.213Z","etag":null,"topics":["programming","programming-language","prsaw","python","python-3","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hunter2809.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":"2021-05-20T12:24:43.000Z","updated_at":"2021-12-17T16:02:15.000Z","dependencies_parsed_at":"2022-09-11T01:12:35.661Z","dependency_job_id":null,"html_url":"https://github.com/Hunter2809/RSAP","commit_stats":null,"previous_names":["hunter2807/rsap"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hunter2809%2FRSAP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hunter2809%2FRSAP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hunter2809%2FRSAP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hunter2809%2FRSAP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hunter2809","download_url":"https://codeload.github.com/Hunter2809/RSAP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225269930,"owners_count":17447612,"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":["programming","programming-language","prsaw","python","python-3","python3"],"created_at":"2024-11-18T23:52:21.370Z","updated_at":"2025-10-24T21:10:41.261Z","avatar_url":"https://github.com/Hunter2809.png","language":"Python","readme":"[![Maintenance](https://img.shields.io/badge/Maintained%3F-Nope-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity)\r\n![Maintaner](https://img.shields.io/badge/Maintainer-Hunter-blue)\r\n[![Open Source? Yes!](https://badgen.net/badge/Open%20Source%20%3F/Yes%21/blue?icon=github)](https://github.com/Naereen/badges/)\r\n\r\n[![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/)\r\n\r\n\r\n#### RSAP.... well it is not a proper acronym, but you can think of it as `Random Stuff API Python`.. It makes use of [PGamerX](https://github.com/pgamerxdev)'s Random Stuff API to provide you features such as jokes, memes, images and also an **AI CHATBOT!!**\r\n\r\n### The installation is also very very very simple.\r\n```\r\npip install rsap\r\n```\r\n### This will install `rsap` **with only** [requests](https://docs.python-requests.org/en/master/) module.. You need to install [aioHTTP](https://docs.aiohttp.org/en/stable/) for AsyncRSAP and [discord.py](https://discordpy.readthedocs.io/en/latest/) for DisRSAP\r\n\r\n\u003cbr\u003e\u003cbr\u003e\r\nThe module uses the [logging](https://docs.python.org/3/library/logging.html) module of python to print logs to console. Add `logging.basicConfig(level=logging.NOTSET)` to the top of your code and all the the logs would get printed to the console\r\n\r\n\u003cbr\u003e\u003cbr\u003e\r\n### The usage is very very very simple.. There are mainly two classes of this module (well there are three but I would consider two because third, you can't say that it is a proper \"class\" of the module.)\r\n\r\n\u003cbr\u003e\u003cbr\u003e\r\n# ASYNC USAGE\r\nTo use this module asynchronously, RSAP provides you with the `AsyncRSAP` class of the module... It uses the [aioHTTP](https://docs.aiohttp.org/en/stable/) module to send GET request to the API... A small example for the same is shown below\r\n\r\n\u003cbr\u003e\r\n\r\n```python\r\nfrom rsap import AsyncRSAP\r\nimport asyncio\r\n\r\nbot = AsyncRSAP(\"api_key_here\", \"other_kwargs_here\")\r\n\r\n# For AI Response\r\nresponse = asyncio.run(bot.ai_response(\"message_here\", \"unique_id\"))\r\nprint(response)\r\n\r\n# For Jokes\r\nresponse = asyncio.run(bot.jokes(\"type\"))\r\nprint(response)\r\n\r\n# For Images\r\nresponse = asyncio.run(bot.image(\"type\"))\r\nprint(response)\r\n```\r\nThe code above would use the [aioHTTP](https://docs.aiohttp.org/en/stable/) module..\r\n\r\n\u003cbr\u003e\u003cbr\u003e\r\n# SYNC USAGE\r\nTo use this module synchronously, RSAP provides you with the `RSAP` class of the module... It uses the [requests](https://docs.python-requests.org/en/master/) module to send the GET request to the API... A small example for the same is shown below\r\n```python\r\nfrom rsap import RSAP\r\n\r\nbot = RSAP(\"api_key_here\", \"other_kwargs_here\")\r\n\r\n# For AI Response\r\nresponse = bot.ai_response(\"message\", \"unique_id\") \r\nprint(response)\r\n\r\n# For Jokes\r\nresponse = bot.joke(\"type\")\r\nprint(response)\r\n\r\n# For Images\r\nresponse = bot.image(\"type\")\r\nprint(response)\r\n\r\n# For Closing\r\nbot.close()\r\n```\r\nThe code above would use the [requests](https://docs.python-requests.org/en/master/) module..\r\n\r\n\u003cbr\u003e\u003cbr\u003e\r\nSo last of all that, we have that other so-called \"class\" known as `DisRSAP` class.. It is just an extension of the RSAP module, which uses the discord.py's [commands.Bot](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html?highlight=bot#discord.ext.commands.Bot) module to send the bot responses in a particular Text Channel. It uses the `on_message` trigger to check for messages in the chat channel.. The example for the same is shown below\r\n\r\n```python\r\nfrom rsap import DisRSAP\r\nbot = DisRSAP(\"api_key_here\", text_channel_id_here, command_prefix=\"!\", \"other_kwargs_here\") #Don't specify any intents because \"discord.Intents.all()\" is already enabled in the source code.\r\n\r\nbot.run(\"bot_token_here\")\r\n\r\n```\r\n### So the above code would simply run your bot and the bot would reply to **every single message** sent in that channel!!\r\n\r\n\u003cbr\u003e\r\nSo lemme guess, you are now thinking what are even those `kwargs` mentioned above 😁\r\n\r\nSo here is a list of kwargs that you can add to your code!!!\r\n\r\n👉 api_key ([str](https://docs.python.org/3/library/stdtypes.html#str)): The API key which you can get from https://api-info.pgamerx.com/register\r\n\u003cbr\u003e\u003cbr\u003e\r\n👉 dev_name ([str](https://docs.python.org/3/library/stdtypes.html#str), optional): The name of the developer who coded the chatbot. Used in responses. Defaults to Hunter.\r\n\u003cbr\u003e\u003cbr\u003e\r\n👉 unique_id ([str](https://docs.python.org/3/library/stdtypes.html#str), optional): The Unique ID to create custom sessions for each user. Defaults to a random [uuid.uuid4](https://docs.python.org/3/library/uuid.html#uuid.uuid4) string.\r\n\u003cbr\u003e\u003cbr\u003e\r\n👉 bot_name ([str](https://docs.python.org/3/library/stdtypes.html#str), optional): The name of the chatbot. Used in responses. Defaults to PyChat.\r\n\u003cbr\u003e\u003cbr\u003e\r\n👉 type ([str](https://docs.python.org/3/library/stdtypes.html#str), optional): The type of API to use. Stable is recommended but can also be `unstable`. Defaults to \"stable\".\r\n\u003cbr\u003e\u003cbr\u003e\r\n👉 language ([str](https://docs.python.org/3/library/stdtypes.html#str), optional): The language to chat with the chatbot in. Defaults to \"en\".\r\n\u003cbr\u003e\u003cbr\u003e\r\n👉 plan ([str](https://docs.python.org/3/library/stdtypes.html#str), optional): The plan, if any, that you have subscribed to. Defaults to `None`\r\n\r\n\r\n## List of Types of Jokes \r\n\r\n😆 `any` \r\n\r\n😆 `dev`\r\n\r\n😆 `spooky`\r\n\r\n😆 `pun`\r\n\r\n\r\n# List of Types of Images\r\n\r\n📸 `aww`\r\n\r\n📸 `duck`\r\n\r\n📸 `dog`\r\n\r\n📸 `cat`\r\n\r\n📸 `memes`\r\n\r\n📸 `dankmemes`\r\n\r\n📸 `holup`\r\n\r\n📸 `art`\r\n\r\n📸 `harrypottermemes`\r\n\r\n📸 `facepalm`\r\n\r\n# List of Plans\r\n\r\n📝 `pro`\r\n\r\n📝 `ultra`\r\n\r\n📝 `biz`\r\n\r\n📝 `mega`\r\n\r\n\r\n# CONTACT ME\r\nNeed some help for some things?? Join [this discord](https://discord.gg/GWugD56QnE) (is of a friend), and you can always find me here or add me on discord `нυηтєя#8785` :D\r\n\u003cbr\u003e\u003cbr\u003e\r\n## Also, if you want to buy the pro plans of the API, be sure to check [this out](https://form.jotform.com/211240494443449)!\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunter2809%2Frsap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhunter2809%2Frsap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunter2809%2Frsap/lists"}