> For the complete documentation index, see [llms.txt](https://eliang.gitbook.io/rsaw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eliang.gitbook.io/rsaw/master.md).

# Random Stuff Api Wrapper

{% hint style="danger" %}
DEBUG MODE IS BROKEN. KEEP IT ON FALSEEEEEEEE
{% endhint %}

## Set-Up

Installing library:

```
pip install rsaw==0.8
```

Set-Up client:

{% code title="cookie.py" %}

```bash
from rsaw.v5.rsa import *
client = RandomStuff(key="Remote Control", server="main")
```

{% endcode %}

In the client there are multiple options, `key` define your key, `server` server you want data from main/backup, `plan` what plan you are, `debug` if set to false (defaults to True) it will ignore all errors and send a random backup message (more on that below).&#x20;

### Backup Messages:

Backup messages will ignore errors and send a random message from a list.

```bash
from rsaw.v5.rsa import *

client = RandomStuff(key="Remote Control", server="main")
client.set_backups(ai=['ai broke man','ai cant think'], joke=['joke failed'])

joke = client.get_joke(joke_type='invalid joke type')
print(joke) # then this would print joke failed because thats our backup
```

If you set `debug` to true in the client then it will normally give errors so you can fix your bug.

### Response Type:

the `res_type` is how you want your response, if set to `json`(or anything else but text) it will return all the response data witch looks like this: `{response: "The response", server: "main/backup", uid: 69}` for AI. If set to `text` it will index it and return just the response message (or joke)&#x20;

```bash
from rsaw.v5.rsa import *

client = RandomStuff(key="Remote Control", server="main")
client.set_backups(ai=['ai broke man','ai cant think'], joke=['joke failed'])

joke_text = client.get_joke(res_type='text')
print(joke_text)

joke_json = client.get_joke(res_type='json')
print(joke_json)
```

### Error's:

UNDER CONSTRUCTION... ERRORS ARE REALLY BROKEN RIGHT NOW
