Weeb.sh API Wrapper, customised for use in discord.py
Project description
# weebapi
![img](https://img.shields.io/pypi/v/weebapi.svg) ![img2](https://img.shields.io/pypi/pyversions/weebapi.svg)
## Pluggable Weeb.sh API Wrapper
### How to install:
**1. With pip**
`pip install -U weebapi`
**2. From GitHub**
`pip install -U git+https://github.com/AndyTempel/weebapi#egg=weebapi`
### Usage:
**With bot integration:**
```python
from discord.ext.commands import Bot
from weebapi import Client
bot = Bot(command_prefix="+")
Client.pluggable(bot=bot, api_key="VeryNiceKey123")
@bot.command()
async def owo(ctx):
image = await bot.weebsh.get_random(image_type="owo")
await ctx.send(str(image))
>>> https://cdn.weeb.sh/images/SklMOkytDb.jpeg
```
**or without bot integration:**
```python
from discord.ext.commands import Bot
from weebapi import Client
bot = Bot(command_prefix="+")
weeb = Client(api_key="VeryNiceKey123")
@bot.command()
async def owo(ctx):
image = await bot.weebsh.get_random(image_type="owo")
await ctx.send(str(image))
>>> https://cdn.weeb.sh/images/SklMOkytDb.jpeg
```
![img](https://img.shields.io/pypi/v/weebapi.svg) ![img2](https://img.shields.io/pypi/pyversions/weebapi.svg)
## Pluggable Weeb.sh API Wrapper
### How to install:
**1. With pip**
`pip install -U weebapi`
**2. From GitHub**
`pip install -U git+https://github.com/AndyTempel/weebapi#egg=weebapi`
### Usage:
**With bot integration:**
```python
from discord.ext.commands import Bot
from weebapi import Client
bot = Bot(command_prefix="+")
Client.pluggable(bot=bot, api_key="VeryNiceKey123")
@bot.command()
async def owo(ctx):
image = await bot.weebsh.get_random(image_type="owo")
await ctx.send(str(image))
>>> https://cdn.weeb.sh/images/SklMOkytDb.jpeg
```
**or without bot integration:**
```python
from discord.ext.commands import Bot
from weebapi import Client
bot = Bot(command_prefix="+")
weeb = Client(api_key="VeryNiceKey123")
@bot.command()
async def owo(ctx):
image = await bot.weebsh.get_random(image_type="owo")
await ctx.send(str(image))
>>> https://cdn.weeb.sh/images/SklMOkytDb.jpeg
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
weebapi-0.1.2b0.tar.gz
(4.5 kB
view hashes)
Built Distributions
weebapi-0.1.2b0-py3.6.egg
(13.9 kB
view hashes)
Close
Hashes for weebapi-0.1.2b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0743d50720972299f8ad81fb9038c78857afebf098d5a2d9ca9649fa722ed9d8 |
|
MD5 | eee2e99c253ebd9e7f1c88323e1020c0 |
|
BLAKE2b-256 | 72a2935d13428c91edadebee373ca4748794ca01b56cb8b1866ca3023f2ba1fc |