Skip to content

Commit

Permalink
Merge pull request #8 from eitozx/development
Browse files Browse the repository at this point in the history
Added Roleplay class
  • Loading branch information
eitozx authored Oct 5, 2022
2 parents 22f6e0a + acdf937 commit c9b3e64
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 42 deletions.
3 changes: 2 additions & 1 deletion animu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
__version__ = "0.1.0"


from animu.client import Client, AsyncClient
from animu.client import Client, AsyncClient
from animu.roleplay import Roleplay
5 changes: 3 additions & 2 deletions animu/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import requests

from animu import model
from .roleplay import Roleplay

class Client:
def __init__(self, token: str):
Expand All @@ -25,7 +26,7 @@ def quote(self):
data = self._endpoint('quote')
return model.Quote(data)

def roleplay(self, query: str):
def roleplay(self, query: Roleplay):
data = self._endpoint(query)
return model.Roleplay(data)

Expand Down Expand Up @@ -57,7 +58,7 @@ async def quote(self):
data = await self._endpoint('quote')
return model.Quote(data)

async def roleplay(self, query: str):
async def roleplay(self, query: Roleplay):
data = await self._endpoint(query)
return model.Roleplay(data)

Expand Down
65 changes: 65 additions & 0 deletions animu/roleplay.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
class Roleplay:
angry = 'angry'
baka = 'baka'
bite = 'bite'
blush = 'blush'
bonk = 'bonk'
bored = 'bored'
bully = 'bully'
bye = 'bye'
chase = 'chase'
cheer = 'cheer'
cringe = 'cringe'
cry = 'cry'
cuddle = 'cuddle'
dab = 'dab'
dance = 'dance'
die = 'die'
disgust = 'disgust'
facepalm = 'facepalm'
feed = 'feed'
glomp = 'glomp'
happy = 'happy'
hi = 'hi'
highfive = 'highfive'
hold = 'hold'
hug = 'hug'
kick = 'kick'
kill = 'kill'
kiss = 'kiss'
laugh = 'laugh'
lick = 'lick'
love = 'love'
lurk = 'lurk'
midfing = 'midfing'
nervous = 'nervous'
nom = 'nom'
nope = 'nope'
nuzzle = 'nuzzle'
panic = 'panic'
pat = 'pat'
peck = 'peck'
poke = 'poke'
pout = 'pout'
punch = 'punch'
run = 'run'
sad = 'sad'
shoot = 'shoot'
shrug = 'shrug'
sip = 'sip'
slap = 'slap'
sleepy = 'sleepy'
smile = 'smile'
smug = 'smug'
stab = 'stab'
stare = 'stare'
suicide = 'suicide'
tease = 'tease'
think = 'think'
thumbsup = 'thumbsup'
tickle = 'tickle'
triggered = 'triggered'
wag = 'wag'
wave = 'wave'
wink = 'wink'
yes = 'yes'
18 changes: 4 additions & 14 deletions examples/roleplay.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
token = 'ANIMU API TOKEN'

import animu
import asyncio

async def test():

client = animu.Client(token)
object = await client.roleplay("angry")
"""
Here 'angry' is the endpoint, to get the list of roleplay endpoitns
Please give a look at the API docs
"""
print(object)

asyncio.get_event_loop().run_until_complete(test())
TOKEN = "ANIMU API TOKEN HERE"
client = animu.Client(TOKEN)
roleplay = client.roleplay(animu.Roleplay.angry)
print(roleplay)
25 changes: 0 additions & 25 deletions examples/waifu.py

This file was deleted.

0 comments on commit c9b3e64

Please sign in to comment.