# Joke

Represents a Joke returned in [`get_joke()`](https://nerdguyahmad.gitbook.io/randomstuff/clients/client#get_joke) method.

|      **Attributes**     |
| :---------------------: |
| [`category`](#category) |
|     [`type`](#type)     |
|     [`joke`](#joke)     |
|    [`flags`](#flags)    |
|       [`id`](#id)       |
|     [`safe`](#safe)     |
|     [`lang`](#lang)     |
| [`language`](#language) |

## Attributes

### `category`

The category of the joke.

**Type:** [`str`](https://www.w3schools.com/python/python_strings.asp)

### `type`

The type of joke. Can either be `single` or `twopart`.&#x20;

**Type:** [`str`](https://www.w3schools.com/python/python_strings.asp)

### `joke`

The actual joke. This can be `dict` or `str` depending on what the type of joke is. If the type if `single` this will be `str` otherwise this will be `dict` having two values, `setup` and `delivery`. Read [Jokes 101](https://nerdguyahmad.gitbook.io/randomstuff/brief/joke-101) page to see how joke object works.

**Type:** [`str`](https://www.w3schools.com/python/python_strings.asp) or [`dict`](https://www.w3schools.com/python/python_dictionary.asp)

### `flags`

The flags a joke has. These are useful to filter the jokes.

**Type:** [`JokeFlags`](https://nerdguyahmad.gitbook.io/randomstuff/data-classes/flags)

### `id`

The joke's unique ID.

**Type:** [`int`](https://www.w3schools.com/python/python_strings.asp)

### `safe`

Determines if the joke is marked safe or not.

{% hint style="info" %}
This is very helpful to see if the joke is safe or not because if this is True, most of the explicit flags are usually False.
{% endhint %}

**Type:** [`bool`](https://www.w3schools.com/python/python_strings.asp)

### `lang`

The language of the joke. Mostly it is `en`

**Type:** [`str`](https://www.w3schools.com/python/python_strings.asp)

### `language`

An alias for [`lang`](#lang) attribute

**Type:** [`dict`](https://www.w3schools.com/python/python_dictionary.asp)
