Skip to main content

A library with leveling cards for your discord bot.

Project description

DiscordLevelingCard

A library with Rank cards for your discord bot.

card preview

card1

card1


How To Use

If you don't provide path then the method will return bytes which can directly be used in discord.py/disnake/pycord/nextcord 's File class.


Example

from disnake.ext import commands
from DiscordLevelingCard import RankCard
import disnake

client = commands.Bot()

@client.slash_command(name="rank")
async def user_rank_card(ctx, user:disnake.Member):
    await ctx.response.defer()
    a = RankCard(
        background="./my_cool_background.png",
        avatar=user.display_avatar.url,
        level=1,
        current_exp=1,
        max_exp=1,
        username="cool username",
        type="disnake"
    )
    image = await a.card1()
    await ctx.edit_original_message(file=image)

or you can use no type

@client.slash_command(name="rank")
async def user_rank_card(ctx, user:disnake.Member):
    await ctx.response.defer()
    a = RankCard(
        background=user.banner.url,
        avatar=user.display_avatar.url,
        level=1,
        current_exp=1,
        max_exp=1,
        username="cool username"
    )
    image = await a.card1()
    await ctx.edit_original_message(file=disnake.File(image))

if you want to use path

@client.slash_command(name="rank")
async def user_rank_card(ctx, user:disnake.Member):
    await ctx.response.defer()
    a = RankCard(
        background=user.banner.url,
        avatar=user.display_avatar.url,
        level=1,
        current_exp=1,
        max_exp=1,
        username="cool username",
        bar_color="red",
        text_color="white",
        path="./user_cards/rank_card.png"
    )
    # image return the path provided i.e. "./user_cards/rank_card.png"
    image = await a.card1()
    await ctx.edit_original_message(file=disnake.File(image))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

discordlevelingcard-0.1.6.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

discordlevelingcard-0.1.6-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file discordlevelingcard-0.1.6.tar.gz.

File metadata

  • Download URL: discordlevelingcard-0.1.6.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.4 Windows/10

File hashes

Hashes for discordlevelingcard-0.1.6.tar.gz
Algorithm Hash digest
SHA256 44aea0403117a2049677655472d49fee111a04d179040d806327feb521caeb04
MD5 903d482ca652baad3fde959263ae9255
BLAKE2b-256 7739a83fd5baaec05a0f05565c70edb0d56815f610227709ab8e6980cb50db75

See more details on using hashes here.

File details

Details for the file discordlevelingcard-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for discordlevelingcard-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 45066bac5d2fa064408b41d0ca52e3f9779760a0df96733842ad2e96e5d68257
MD5 24847e5311d322198eedd1607b67300b
BLAKE2b-256 db08e4ea0836aefc5023977a6f13365cdb5d5189ec4dbca884a48a3596a3d173

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page