Random Stuff Api Wrapper
DEBUG MODE IS BROKEN. KEEP IT ON FALSEEEEEEEE
Set-Up
Installing library:
pip install rsaw==0.8
Set-Up client:
from rsaw.v5.rsa import *
client = RandomStuff(key="Remote Control", server="main")
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).
Backup Messages:
Backup messages will ignore errors and send a random message from a list.
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)
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
Last updated
Was this helpful?