📁
randomstuff.py
  • randomstuff.py
  • Clients
    • Client
    • AsyncClient
  • Data Classes
    • AIResponse
    • Joke
    • JokeFlags
    • Waifu
    • Weather
    • WeatherLocation
    • CurrentWeather
    • WeatherForecast
  • Sub modules
    • utils
  • Errors tree
    • Forbidden
      • BadAPIKey
      • PlanNotAllowed
    • ArgumentError
      • InvalidPlanError
      • InvalidVersionError
      • InvalidServerError
      • InvalidType
      • InvalidCityError
    • HTTPError
  • Brief
    • Warnings
    • Lists
    • Unique ID
    • Joke 101
    • FAQ
    • Changelogs
Powered by GitBook
On this page
  • Attributes
  • api_key
  • version
  • suppress_warnings
  • Methods
  • get_ai_response
  • get_image
  • get_joke
  • get_waifu
  • get_weather
  • close

Was this helpful?

  1. Clients

Client

Previousrandomstuff.pyNextAsyncClient

Last updated 3 years ago

Was this helpful?

The main class to interact with API.

Attributes/Parameters

Methods

Attributes

api_key

This your API authentication key.

Type:

As of version 3, The API key is required to use the API. Get one from .

version

The version of API to use. This defaults to "4"

Type:

suppress_warnings

Determines if version or other warnings will be shown in console or not. Set this to True to stop warnings.

Methods

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

The message to which the response is required.

plan (Optional)

The plan to use for AI response.

language (Optional)

The language of returned response. This defaults to en.

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.

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.

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.

uid (Optional)

Above parameters are version 4 specific. If you're using version 3, See next tab.

Below arguments are specific to version 3.

message

The message to which the response is required.

plan (Optional)

The plan to use for AI response.

lang (Optional)

The language of returned response. This defaults to en.

type (Optional)

The server from which the response should be received. This defaults to stable. Don't use unstable as it is quiet unstable.

dev_name (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.

bot_name (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.

unique_id (Optional)

Above parameters are version 3 specific. If you're using version 4, See previous tab.

The response as a AI response object.

To get the response message, Use AIResponse.message

randomstuff.InvalidPlanError: Provided plan was invalid

randomstuff.InvalidServerError: The server is either not responding or invalid.

get_image

Gets a random image.

type(Optional)

The image imgur link as a string.

get_joke

Gets a random joke.

type(Optional)

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

plan

get_weather

Gets the weather of provided city.

This is only available on version 4.

city

The city of which weather is required.

close

Closes a session.

It is always recommended to close a session after usage.

are usually printed on outdated versions of API.

Type:

Type:

Type:

This must be one of from the .

Type:

Type:

Type:

Type:

The unique ID. This is used to create a separate session. Read page for more info.

Type:

Type:

Type:

This must be one of from the .

Type:

Type:

Type:

Type:

The unique ID. This is used to create a separate session. Read page for more info.

Type:

Type:

: The API key provided was invalid.

: The plan is not available on your account because you haven't bought it.

The type of image. This is one of the types from . Defaults to any.

Type:

Type:

: The API key provided was invalid.: The image type was not valid.

The type of joke. This is one of the types from . Defaults to any.

Type:

The random joke as object.

Type:

: The API key provided was invalid.

: The joke type was not valid.

The type of anime. Can be one from

Type:

The plan to use. Can be one from

Type:

The random anime as object.

Type:

: The API key provided was invalid.

: The waifu type was not valid.

: The plan is not available on your API key.

Type:

str
here
str
Warnings
bool
str
str
str
str
str
str
Unique ID
str
str
str
str
str
str
str
Unique ID
str
AIResponse
randomstuff.BadAPIKey
randomstuff.PlanNotAllowed
str
str
randomstuff.AuthError
randomstuff.InvalidArgument
joke types
str
Joke
Joke
randomstuff.BadAPIKey
randomstuff.InvalidArgument
str
str
Waifu
Waifu
randomstuff.BadAPIKey
randomstuff.InvalidArgument
randomstuff.PlanNotAllowed
str
api_key
get_ai_response
version
get_image
suppress_warnings
get_joke
close
plans list
plans list
image types
Anime Types
Plan Types