Changelogs
v1.6.0
Redesigned the objects
Removed
BaseObjectclassFlagsobject has been renamed toJokeFlagsAdded
languagealias forJoke.langAll objects are now frozen dataclasses which means they are now immutable and are read-only.
All objects now have proper
__repr__attributes
Entire library is now properly typehinted. Thanks to @MarzaElise for their contributions in typehinting the library.
Moved
get_safe_jokefrom utils module toClientandAsyncClientclasses. Thanks to @MarzaEliseClient now works with async context manager. Thanks to @MarzaElise
AsyncClientnow raises a new errorUnsupportedUsageon exiting context manager. Thanks to @MarzaEliseAdded support for
/weatherendpoint. You can now fetch weathers easily usingget_weathermethods.Added
get_weatherin both client classesAdded four new classes
Weather,CurrentWeather,WeatherLocation,WeatherForecastAdded new error,
InvalidCityErrorraised upon invalid city provided inget_weathermethod.
v1.4.2
Restructured the library's data classes
All the data classes now inherit from a super class called
BaseObjectAI response now is wrapped into a class called
AIResponseto stay even with new responses from version 4 AI response endpoint.
Restructured the Exceptions hierarchy
New Exception sub class:
HTTPErrorfor 500s errors. Credits to @Creepy-Creeper3625Added new Exception sub class:
ArgumentError.VersionError,PlanErrorandServerErrorare changed toInvalidVersionError,InvalidPlanErrorandInvalidServerErrorthat are now inherited fromArgumentError.Added
Exceptionclass:ForbiddenAdded two sub-classes of
Forbidden:PlanNotAllowedandBadAPIKey
Restructured library files
All data classes are now in a single module
object
AsyncClientnow has proper default version. (GH-7)utils.generate_unique_idnow is calledgenerate_uid(As per version 4.) (GH-8)Added
errors.HTTPErrorclass for 500s statuses. (GH-6)AsyncClientnow properly inherits fromClient(GH-9)Added
utils.format_jokemethod to format a "two-part" joke into custom (human readable) format.Added
utils.get_safe_jokemethod to filter or ignore any unsafe joke.Warnings now have certain colours using Unicode. Credits to @Creepy-Creeper3625
v1.4.0
Deprecated version 2 of API
Added support for version 4
Version 3 usage now triggers console warnings
AI method now uses kwargs due to change in parameters for version 4 and 3.
v1.3.2
Added initial support for v4 beta
get_ai_response_beta()argument added with different parameters names as default method. This is use able only with v4 beta. See thisget_joke methods in both Client and AsyncClient classes now return correct link.
Warning added for v4 beta.
v1.3.1
Added support for
unique_keyquery on/ai/response.get_ai_response()take optional argumentunique_idwhich is used to chat with a certain key. See Unique Key page for more info.New module
randomstuff.utilsutils.generate_unique_idis a new method used to generate secure unique IDs.
v1.3.0
Added support for
bot_nameanddev_namequeries on/ai/response.get_ai_response()take optional argumentsdev_nameandbot_namewhich determines developer name and bot name respectively.Added warnings.
You are now warned when initialising client with
version='2'.Add
suppress_warningsoptional argument in clients that determines whether you get console warnings or not.
v1.2.2
All methods and classes now raise
errors.AuthErrorwhen invalid API key is passed.Same for unauthorised plan in
get_ai_response()
v1.2.1
get_joke()works properly now.
v1.2.0
Add support for v2
ClientandAsyncClientnow takeversionargument that determines the API versionAdded support for plans
get_ai_response()now takesplanargument which determines the plan to use.
v1.0.2
Fixed minor bugs
v1.0.1
Initial Release
Last updated
Was this helpful?