mariocard
This is simple maker for level card in discord bot in discord.py or pycord.
Installing
Python 3.8 or higher is required
# Linux/macOS
pip3 install mariocard
# Windows
pip install mariocard
Default Card Example
import discord
from discord.ext import commands
from mariocard import create_card, create_custom_card
client = commands.Bot(command_prefix="!")
#level from datebase
level = 2
#xp from datebase
xp = 10
#required xp for next level (from datebese or calculated)
reqxp = 20
@client.command()
async def card(ctx):
img = await create_card(level, xp, reqxp, ctx.message.author.name, ctx.message.author.avatar_url, "red")
await ctx.send(file=img)
client.run("token")
Custom Card Example
You must have create folder assets in your bot files and put there bg.png file.
import discord
from discord.ext import commands
from mariocard import create_card, create_custom_card
client = commands.Bot(command_prefix="!")
#level from datebase
level = 2
#xp from datebase
xp = 10
#required xp for next level (from datebese or calculated)
reqxp = 20
@client.command()
async def card(ctx):
img = await create_custom_card(level, xp, reqxp, ctx.message.author.name, ctx.message.author.avatar_url, "red")
await ctx.send(file=img)
client.run("token")