A Wrapper for vacefron.nl/api written in Python.
For any questions and support, you can join VAC Efron's server
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
After that, you will have to create the client:
import vacefron
vac_api = vacefron.Client()
For future reference in this documentation: when referring to 'vac_api' we refer to that above.
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 = None, xp_color = None, is_boosting = False)
Generate a Rank card for Discord bots!
Parameters:
- username
string
| The user's name. - avatar
string
| The user's avatar - level
int
| The user's current level. - rank
int
| The user's position on the board. - current_xp
int
| The user's current XP amount. - next_level_xp
int
| The user's next XP amount. - previous_level_xp
int
| The user's previous XP amount. - custom_background
string
| An optional image url or hex color for the background. - xp_color
string
| The hex 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: RankCard
Generate that batman slapping meme with custom texts and images.
Parameters:
- text
string
| Text 1. - text2
string
| Text 2. - batman
string
| Optional avatar for Batman. - robin
string
| Optional avatar for Robin.
Return type: Image
Generate that "distracted boyfriend" meme with your images.
Parameters:
- boyfriend
string
| Avatar of user. - girlfriend
string
| Avatar of user. - woman
string
| Avatar of user.
Return type: Image
Generate that "dock of shame" meme with your avatar.
Parameters:
- user
string
| Avatar of user.
Return type: Image
Generate that "car reverse" meme with your own text.
Parameters:
- text
string
| Your text.
Return type: Image
Generate that "change my mind" meme with your own text.
Parameters:
- text
string
| Your text.
Return type: Image
Generate your own Among Us "Emergency Meeting" Meme!
Parameters:
- text
string
| The reason to call an emergency meeting.
Return type: Image
Create your own custom Among Us "... Was not The impostor" image!
Available colors: black
, blue
, brown
, cyan
, darkgreen
, lime
,
orange
, pink
, purple
, red
, white
, yellow
, random
,
CrewMateColors enum, number from 1 to 13.
Parameters:
- name
string
| Name of the person that got ejected. - crewmate
string
| Color of the person that got ejected, see Available colors. This is optional and defaults to color red - impostor
string
| Determine if the person was the impostor or not. This is optional and defaults to False
Return type: Image
Generate that "first time" meme with someone's avatar.
Parameters:
- user
string
| Avatar of user.
Return type: Image
Generate a Grave stone with someone's avatar.
Parameters:
- user
string
| Avatar of user.
Return type: Image
Generate that "I am speed" meme with someone's avatar.
Parameters:
- user
string
| Avatar of user.
Return type: Image
Generate that "I can milk you" meme from Markiplier with someone's avatar.
Parameters:
- user
string
| Avatar of user.on Markiplier - user1
string
| Optional Avatar of user.on the Cow
Return type: Image
Generate that heaven meme with someone's avatar.
Parameters:
- user
string
| Avatar of user.
Return type: Image
Generate that "npc" meme with your own text.
Parameters:
- text
string
| Your text. - text2
string
| Your text.
Return type: Image
Generate that "Stonks 〽" meme with someone's avatar.
Parameters:
- user
string
| Avatar of user. - not_stonks
bool
| Determine if it was Stonks or Not Stonks. Defaults to False.
Return type: Image
Generate that "Table flip" meme with someone's avatar.
Parameters:
- user
string
| Avatar of user.
Return type: Image
Generate that "water" meme with your own text.
Parameters:
- text
string
| Your Text
Return type: Image
Make someone's avatar a little bit wider.
Parameters:
- user
string
| Avatar of user.
Return type: Image
Generate that "wolverine looking at a picture" meme with your own avatar.
Parameters:
- user
string
| Avatar of user.
Return type: Image
Generate that "woman yelling at cat" meme with your images.
Parameters:
- woman
string
| Avatar of user.For woman. - cat
string
| Avatar of user.For cat.
Return type: Image
Get an invitation to the VAC Efron's server (or and the creator of this wrapper.)
Parameters:
- creator
boolean
| To also get an invitation to the server of creator of this wrapper.
Return type: string or tuple when creator
is True
See here some examples
Generate a Rank card with discord.py:
import vacefron
import json
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix = "!")
vac_api = vacefron.Client()
@bot.command()
async def rank(ctx, member: discord.Member = None):
member = member or ctx.author
with open("ranks.json") as f:
ranks = json.load(f)
info = ranks[str(member.id)]
boosting = True if member.premium_since else False
gen_card = await vac_api.rank_card(
username = str(member),
avatar = member.avatar_url_as(format = "png"), # converting avatar to .png, including .gif
level = int(info['level']),
rank = int(info['rank']),
current_xp = int(info['current_xp']),
next_level_xp = 500,
previous_level_xp = 50,
xp_color = "666666", # optional
is_boosting = boosting # optional
)
rank_image = discord.File(fp = await gen_card.read(), filename = f"{member.name}_rank.png")
await ctx.send(f"{member.name}'s rank in {ctx.guild.name}", file = rank_image)
# custom_background, is_boosting and xp_color are optional, see more in the docs.
ejected with discord.py:
import vacefron
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix = "!")
vac_api = vacefron.Client()
@bot.command()
async def eject(ctx, name, crewmate, impostor):
image = await vac_api.ejected(name, crewmate, impostor)
image_out = discord.File(fp = await image.read(), filename = "ejected.png")
await ctx.send(file = image_out)
Here is explained what attributes the returned objects have
This object gets returned from every endpoint.
The url of the image
This will return a io.BytesIO object, which can be passed to discord.File() with a filename for discord.py:
npc_meme = await vac_api.npc("ah yes", "no u")
npc_bytes = await npc_meme.read() # <_io.BytesIO object at 0x0438DFC8> - BytesIO object.
await ctx.send(file = discord.File(npc_bytes, filename = "npc.png"))
You can set bytesio
to False
if you want the bytes instead of an io.BytesIO
object.
This object gets returned from .rank_card()
The url of the card
This will return a io.BytesIO object, which can be passed to discord.File() with a filename for discord.py:
card = await vac_api.rank_card(....)
card_bytes = await card.read() # <_io.BytesIO object at 0x0438DFC8> - BytesIO object.
await ctx.send(file = discord.File(card_bytes, filename = "rank_card.png"))
You can set bytesio
to False
if you want the bytes instead of an io.BytesIO
object.
The user's username, you provided but #
replaced with %23
The user's avatar, you provided
The user's current level you provided
The user's position, you provided
The user's current XP amount, you provided
The user's next XP amount, you provided
The user's previous XP amount, you provided
An optional background for the rank card, if you provided one else None
The color for the XP bar but #
replaced with %23
, if you provided one else None
Bool, True if you set it to True else False
Enum for .ejected()
.
Black color for the crewmate.
Black color for the crewmate.
Brown color for the crewmate.
Cyan color for the crewmate.
Dark green color for the crewmate.
Lime color for the crewmate.
Orange color for the crewmate.
Pink color for the crewmate.
Purple color for the crewmate.
Red color for the crewmate.
White color for the crewmate.
Yellow color for the crewmate.
Random color from above for the crewmate.