Package: rsap
RSAP.... well it is not a proper acronym, but you can think of it asRandom Stuff API Python.. It makes use ofPGamerX's Random Stuff API to provide you features such as jokes, memes, images and also anAI CHATBOT!!The installation is also very very very simple.pip install rsapThis will installrsapwith onlyrequestsmodule.. You need to installaioHTTPfor AsyncRSAP anddiscord.pyfor DisRSAPThe module uses theloggingmodule of python to print logs to console. Addlogging.basicConfig(level=logging.NOTSET)to the top of your code and all the the logs would get printed to the consoleThe 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.)ASYNC USAGETo use this module asynchronously, RSAP provides you with theAsyncRSAPclass of the module... It uses theaioHTTPmodule to send GET request to the API... A small example for the same is shown belowfromrsapimportAsyncRSAPimportasynciobot=AsyncRSAP("api_key_here","other_kwargs_here")# For AI Responseresponse=asyncio.run(bot.ai_response("message_here","unique_id"))print(response)# For Jokesresponse=asyncio.run(bot.jokes("type"))print(response)# For Imagesresponse=asyncio.run(bot.image("type"))print(response)The code above would use theaioHTTPmodule..SYNC USAGETo use this module synchronously, RSAP provides you with theRSAPclass of the module... It uses therequestsmodule to send the GET request to the API... A small example for the same is shown belowfromrsapimportRSAPbot=RSAP("api_key_here","other_kwargs_here")# For AI Responseresponse=bot.ai_response("message","unique_id")print(response)# For Jokesresponse=bot.joke("type")print(response)# For Imagesresponse=bot.image("type")print(response)# For Closingbot.close()The code above would use therequestsmodule..So last of all that, we have that other so-called "class" known asDisRSAPclass.. It is just an extension of the RSAP module, which uses the discord.py'scommands.Botmodule to send the bot responses in a particular Text Channel. It uses theon_messagetrigger to check for messages in the chat channel.. The example for the same is shown belowfromrsapimportDisRSAPbot=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.bot.run("bot_token_here")So the above code would simply run your bot and the bot would reply toevery single messagesent in that channel!!So lemme guess, you are now thinking what are even those `kwargs` mentioned above 😁So here is a list of kwargs that you can add to your code!!!👉 api_key (str): The API key which you can get fromhttps://api-info.pgamerx.com/register👉 dev_name (str, optional): The name of the developer who coded the chatbot. Used in responses. Defaults to Hunter.👉 unique_id (str, optional): The Unique ID to create custom sessions for each user. Defaults to a randomuuid.uuid4string.👉 bot_name (str, optional): The name of the chatbot. Used in responses. Defaults to PyChat.👉 type (str, optional): The type of API to use. Stable is recommended but can also beunstable. Defaults to "stable".👉 language (str, optional): The language to chat with the chatbot in. Defaults to "en".👉 plan (str, optional): The plan, if any, that you have subscribed to. Defaults toNoneList of Types of Jokes😆any😆dev😆spooky😆punList of Types of Images📸aww📸duck📸dog📸cat📸memes📸dankmemes📸holup📸art📸harrypottermemes📸facepalmList of Plans📝pro📝ultra📝biz📝megaCONTACT MENeed some help for some things?? Jointhis discord(is of a friend), and you can always find me here or add me on discordнυηтєя#8785:DAlso, if you want to buy the pro plans of the API, be sure to checkthis out!