Skip to content

Commit

Permalink
docs.md and README.md improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Soheab committed Aug 12, 2020
1 parent d82aeba commit 784849f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 28 deletions.
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
[![Downloads](https://pepy.tech/badge/vacefron-py)](https://pepy.tech/project/vacefron-py)
[![MIT License](https://img.shields.io/apm/l/atomic-design-ui.svg?)](https://github.com/tterb/atomic-design-ui/blob/master/LICENSEs)


# VACEfron.py
A Wrapper for [vacefron.nl/api](https://vacefron.nl/api/) written in Python.

Expand All @@ -26,7 +25,7 @@ See the changelog for each [version here](https://github.com/Soheab/vacefron.py/

# Examples

Generate a [Rank card](https://github.com/Soheab/vacefron.py/blob/master/docs.md#await-vac_apirank_cardusername-avatar--level-rank-current_xp-next_level_xp-previous_level_xp-custom_background-xp_color-is_boosting) with [discord.py](https://github.com/Rapptz/discord.py):
Generate a [Rank card](docs.md#rank-card) with [discord.py](https://github.com/Rapptz/discord.py):
```python
import vacefron
import json
Expand All @@ -42,7 +41,7 @@ async def rank(ctx):
with open("ranks.json") as f:
ranks = json.load(f)

info = ranks[f"{ctx.author.id}"]
info = ranks[str(ctx.author.id)]
boosting = True if ctx.author.premium_since else False
gen_card = await vac_api.rank_card(
username = ctx.author,
Expand All @@ -54,15 +53,13 @@ async def rank(ctx):
previous_level_xp = 50,
is_boosting = boosting
)
rank_bytes = await gen_card.read()
await ctx.send(f"{ctx.author.name}'s rank in {ctx.guild.name}",
file = discord.File(rank_bytes, "rank.png")
)
rank_image = discord.File(fp = await gen_card.read(), filename = f"{ctx.author}_rank.png")
await ctx.send(f"{ctx.author.name}'s rank in {ctx.guild.name}", file = rank_image)

# is_boosting, custom_background and xp_color are optional, see more in the docs.
```

[I can milk you meme](https://github.com/Soheab/vacefron.py/blob/master/docs.md#await-vac_apii_can_milk_youuser-user2) with [discord.py](https://github.com/Rapptz/discord.py):
[I can milk you meme](docs.md#await-vac_apii_can_milk_youuser-user2) with [discord.py](https://github.com/Rapptz/discord.py):
```python
import vacefron
import discord
Expand All @@ -73,9 +70,9 @@ vac_api = vacefron.Client()

@bot.command()
async def icanmilkyou(ctx, face: discord.Member, cow: discord.Member):
yes = await vac_api.i_can_milk_you(face.avatar_url, cow.avatar_url)
yes_bytes = discord.File(await yes.read(), "yes.png")
await ctx.send(file=yes_bytes)
meme = await vac_api.i_can_milk_you(face.avatar_url, cow.avatar_url)
meme_image = discord.File(fp = await meme.read(), filename = "let_me_milk_you.png")
await ctx.send(file=meme_image)
```

# Made by
Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# VACEfron.py | Changelog
See here what changed or broke each version.

## v1.0.2
- docs.md and README.md improvements. New version to update it on PyPi.

## v1.0.1
- Added an optional `session` param to `vacefron.Client()`.
- Renamed `_session` to `session`
Expand Down
24 changes: 14 additions & 10 deletions docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ For any questions and support, you can join [VAC Efron's server](https://discord

## Getting Started:

To begin with, you'll have
===============================
to install the package by doing one of the following commands:
To begin with, you'll have to install the package by doing one of the following commands:
- `pip install -U vacefron.py`
- `python -m pip -U install vacefron.py`

Expand All @@ -17,14 +15,19 @@ import vacefron

vac_api = vacefron.Client()
```
For future reference in this documentation: when referring to 'vac_api' we refer to that above!

For future reference in this documentation: when referring to 'vac_api' we refer to that above.


## Using the wrapper:
All available endpoints you can use.
All available endpoints you can use.

### await vac_api.rank_card(username, avatar, level, rank, current_xp, next_level_xp, previous_level_xp, custom_background, xp_color, is_boosting)
Generate a custom Rank card for Discord bots!
### Rank card

---
#### await vac_api.rank_card(username, avatar, level, rank, current_xp, next_level_xp, previous_level_xp, custom_background, xp_color, is_boosting)
Generate a Rank card for Discord bots!

**Parameters**:
- username `string` | The user's name.
Expand All @@ -35,15 +38,16 @@ Generate a custom Rank card for Discord bots!
- next_level_xp `int` | The user's next XP amount.
- previous_level_xp `int` | The user's previous XP amount.
- custom_background `string` | A optional background for the rank card.
- xp_color `string` | The color for the XP bar. Default to #FCBA41.
- is_boosting `bool` | If True, a boost badge will be displayed next to user's name
- xp_color `string` | The color for the XP bar. Defaults to #FCBA41.
- is_boosting `bool` | If True, a boost badge will be displayed next to user's name. Defaults to False.

**Return type**: [Image](docs.md#image "Image object attributes")

---
### await vac_api.car_reverse(text)
Generate that "car reverse" meme with your own text.



**Parameters**:
- text `string` | Your text.

Expand Down Expand Up @@ -88,7 +92,7 @@ Generate that "I am speed" meme with someone's avatar.
---
### await vac_api.i_can_milk_you(user, user2)
Generate that "I can milk you" meme from Markiplier with someone's avatar.

**Parameters**:
- user `string` | Avatar of user. ~~on Markiplier~~
- user1 `string` | Avatar of user. ~~on the Cow~~
Expand Down
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
description = 'A Wrapper for vacefron.nl/api written in Python.',
long_description = readme,
long_description_content_type = 'text/markdown',
version = '1.0.1',
version = '1.0.2',
packages = ['vacefron'],
url = 'https://github.com/Soheab/vacefron.py',
download_url = 'https://github.com/Soheab/vacefron.py/archive/v1.0.1.tar.gz',
download_url = 'https://github.com/Soheab/vacefron.py/archive/v1.0.2.tar.gz',
license = 'MIT',
author = 'Soheab_',
install_requires = ['aiohttp'],
keywords = ['vacefron', 'discord', 'api'],
project_urls = {
"Discord": "https://discord.gg/xJ2HRxZ",
"Source": "https://github.com/Soheab/vacefron.py",
"Discord": "https://discord.gg/xJ2HRxZ",
"Source": "https://github.com/Soheab/vacefron.py",
"Documentation": "https://github.com/Soheab/vacefron.py/blob/master/docs.md",
"Issue tracker": "https://github.com/Soheab/vacefron.py/issues",
},
},

python_requires = '>=3.6',
)
)
2 changes: 1 addition & 1 deletion vacefron/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _parse_text(text: str) -> str:
"^": "%CB%86",
"_": "%5F",
"©": "%C2%A9"
}
}
return text.translate(str.maketrans(replacements))


Expand Down

0 comments on commit 784849f

Please sign in to comment.