# AsyncClient

Same as [`Client`](client) but this is completely async class. This class is suitable for async programs like discord bots etc.

{% hint style="info" %}
All the parameters, attributes and methods are same as [`Client`](client) except all methods are coroutine and need to be awaited. For example:

`await AsyncClient.get_ai_response('Hi')`
{% endhint %}

## Simple example

Just to assure, This is a simple example for you using this class.

```python
import randomstuff
import asyncio

client = randomstuff.AsyncClient(api_key="api-key")

async def coro():
    ai = await client.get_ai_response("hi")
    image = await client.get_image("any")
    joke = await client.get_joke("any")
    weather = await client.get_weather("new york")
    await client.close()
    print("AI: ", ai.message)
    print("Joke: ", joke.joke)
    print("Image: ", image)
    print("Temprature in NY: ", weather.current.temperature)

loop = asyncio.get_event_loop()
loop.run_until_complete(coro())    
```

