Client
The main class to interact with API.
Attributes/Parameters
Methods
Attributes
api_key
api_key
This your API authentication key.
Type: str
As of version 3, The API key is required to use the API. Get one from here.
version
version
The version of API to use. This defaults to "4"
Type: str
suppress_warnings
suppress_warnings
Determines if version or other warnings will be shown in console or not. Set this to True
to stop warnings.
Warnings are usually printed on outdated versions of API.
Type: bool
Methods
get_ai_response
get_ai_response
Gets random AI response.
This method takes version specific parameters. It is recommended to use version 4 to avoid timeout errors as version 3 AI endpoint was unstable.
These are parameters for version 4.
message
message
The message to which the response is required.
Type: str
plan
(Optional)
plan
(Optional)The plan to use for AI response.
Type: str
This must be one of from the plans list.
language
(Optional)
language
(Optional)The language of returned response. This defaults to en
.
Type: str
server
(Optional)
server
(Optional)The server from which the response should be received. This defaults to primary
. Set it to backup
if the primary is down. Don't use unstable
as it is quiet unstable.
Type: str
master
(Optional)
master
(Optional)The developer's name. Used in responses. Defaults to PGamerX
This is basically what bot will say on "Who is your creator?" or related questions.
Type: str
bot
(Optional)
bot
(Optional)The bot's name. This is used in responses. Defaults to RSA
. This is basically what bot will say on "Who are you?" or "What is your name?" or related questions.
Type:str
uid
(Optional)
uid
(Optional)The unique ID. This is used to create a separate session. Read Unique ID page for more info.
Type: str
Above parameters are version 4 specific. If you're using version 3, See next tab.
get_image
get_image
Gets a random image.
type
(Optional)
type
(Optional)The type of image. This is one of the types from image types. Defaults to any
.
Type: str
get_joke
get_joke
Gets a random joke.
get_waifu
get_waifu
Gets a random waifu/anime image URL.
This is only available on version 4.
This requires at least pro plan or higher to access.
type
type
The type of anime. Can be one from Anime Types
Type: str
plan
plan
The plan to use. Can be one from Plan Types
Type: str
get_weather
get_weather
Gets the weather of provided city.
This is only available on version 4.
close
close
Closes a session.
It is always recommended to close a session after usage.
Last updated
Was this helpful?