Utils#
Helper Functions#
Support functions for the Client
methods.
- yarsaw.format_joke()#
Support function for
Client.get_joke()
. Auto-format a joke. If its a single type of joke, it returns the joke itself. If its a two-part joke, it returns the setup and delivery, separated by a newline or a character you choose.
- yarsaw.generate_uid()#
Support function for
Client.get_ai_response()
. Generates a random string of characters to be used as a unique identifier for a user.- Parameters
- Returns
The generated UID.
- Return type
Data Classes#
- class yarsaw.BotDetails(bot_name: str, bot_master: str, bot_age: str, bot_location: str, bot_company: str, bot_birth_year: str, bot_birth_date: str, bot_birth_place: str)#
- class yarsaw.AIResponse(response: str, bot_details: yarsaw.data_classes.BotDetails, api_info: yarsaw.data_classes.APIInfo)#
- class yarsaw.Joke(joke: str, tags: list, api_info: yarsaw.data_classes.APIInfo)#
- class yarsaw.RedditPost(id: str, type: str, title: str, author: str, url: str, image: str, gallery: bool, text: str, thumbnail: str, subreddit: str, nsfw: bool, spoiler: bool, created_at: int, upvotes: int, downvotes: int, upvote_ratio: float, api_info: yarsaw.data_classes.APIInfo)#
- class yarsaw.AnimalImage(images: list, api_info: yarsaw.data_classes.APIInfo)#
- class yarsaw.AnimeGIF(title: str, thumbnail: str, image: str, api_info: yarsaw.data_classes.APIInfo)#
- class yarsaw.CanvasResponse(base64: str, decoded_base64: str, api_info: yarsaw.data_classes.APIInfo)#
- class yarsaw.Fact(fact: str, api_info: yarsaw.data_classes.APIInfo)#
Exceptions#
- exception yarsaw.InvalidPlan#
- exception yarsaw.InvalidAPIKey#
- exception yarsaw.RateLimited#
- exception yarsaw.BadGateway#
Documentation Last Updated on Mar 27, 2022