# Random

{% hint style="danger" %}
Please make sure you do not instantiate this class. You can access it though `const something = require('some-random-cat').Random`
{% endhint %}

## Methods

### `.getAdvice()` `STATIC`

Random method to generate an advice.

| Type | Description                 |
| ---- | --------------------------- |
| any  | The string with the advice. |

{% hint style="success" %}
Returns: [`Promise<Pending>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\`\`
{% endhint %}

### `.getCat()`  `STATIC`

Random method to generate a random cat image.

| Type | Description        |
| ---- | ------------------ |
| any  | URL for the image. |

{% hint style="success" %}
Returns: [`Promise<Pending>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
{% endhint %}

### `.getDog()` `STATIC`

Random method to generate a random dog image.

| Type | Description        |
| ---- | ------------------ |
| any  | URL for the image. |

{% hint style="success" %}
Returns: [`Promise<Pending>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
{% endhint %}

### `.getFact()` `STATIC`

Random method to generate a random fact.

| Type | Description              |
| ---- | ------------------------ |
| any  | The string for the fact. |

{% hint style="success" %}
Returns: [`Promise<Pending>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\`\`
{% endhint %}

### `.getJoke()` `STATIC`

Random method to generate a random joke.

| Type | Description                                   |
| ---- | --------------------------------------------- |
| any  | An object with the title, description and URL |

{% hint style="success" %}
Returns: [`Promise<Pending>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
{% endhint %}

### `.getMeme(sub)` `STATIC`

Random method to generate a meme.

| Parameters | Type   | Optional | Description                         |
| ---------- | ------ | -------- | ----------------------------------- |
| sub        | String | ❌        | The subreddit to get the meme from. |

{% hint style="success" %}
Returns: [`Promise<Pending>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\`\`
{% endhint %}

### `.getString(number)` `STATIC`

| Parameters | Type   | Optional | Description               |
| ---------- | ------ | -------- | ------------------------- |
| number     | Number | ❌        | The length of the string. |

{% hint style="success" %}
Returns: [`Promise<Pending>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\`\`
{% endhint %}

### `.getTopic()` `STATIC`

Random method to generate a topic.

| Type | Description                |
| ---- | -------------------------- |
| any  | The string with the topic. |

{% hint style="success" %}
Returns:[`Promise<Pending>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\`\`
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://somerandomcat.js.org/main/docs/classes/random.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
