pilcord
status: new image gen everyday!
A library rich with many image generation funcitons powered by PIL for your discord bot such as leveling, welcome card and meme generation!
ranking card preview
card1
card2
card3 same as card2 but with background
meme generation preview
fight_under_this_flag
uwu_discord
rip
installation
for pypi version
pip install pilcord
for github developement version
pip install git+https://github.com/ResetXD/pilcord
How To Use
The method will return bytes which can directly be used in discord.py/disnake/pycord/nextcord 's File class.
Documentation
rank card docs
RankCard class
__init__ method
RankCard(
settings: CardSettings,
avatar:str,
level:int,
current_exp:int,
max_exp:int,
username:str,
rank: Optional[int] = None
)
-
settings- Settings class from DiscordLevelingCard. -
avatar- avatar image url. -
level- level of the user. -
current_exp- current exp of the user. -
max_exp- max exp of the user. -
username- username of the user. -
rank- rank of the user. (optional)
CardSettings class
__init__ method
CardSettings(
background: Union[PathLike, BufferedIOBase, str],
bar_color: Optional[str] = 'white',
text_color: Optional[str] = 'white',
background_color: Optional[str]= "#36393f"
)
-
background- background image url or file-object inrbmode.4:1aspect ratio recommended.
-
bar_color- color of the bar [example: "white" or "#000000"] -
text_color- color of the text [example: "white" or "#000000"] -
background_color- color of the background [example: "white" or "#000000"]
card1 method
RankCard.card1()
returns - bytes which can directly be used within discord.File class.
card2 method
RankCard.card2()
returns - bytes which can directly be used within discord.File class.
card3 method
RankCard.card3()
returns - bytes which can directly be used within discord.File class.
example
It returns bytes which can directly be used in discord.py and its fork's File class.
from disnake.ext import commands
from DiscordLevelingCard import RankCard, CardSettings
import disnake
client = commands.Bot()
# define background, bar_color, text_color at one place
card_settings = CardSettings(
background="url or path to background image",
text_color="white",
bar_color="#000000"
)
@client.slash_command(name="rank")
async def user_rank_card(ctx, user:disnake.Member):
await ctx.response.defer()
a = RankCard(
settings=card_settings,
avatar=user.display_avatar.url,
level=1,
current_exp=1,
max_exp=1,
username="cool username",
rank=1
)
image = await a.card1()
await ctx.edit_original_message(file=disnake.File(image, filename="rank.png")) # providing filename is very important
rank card docs
Meme class
__init__ method
Meme(
avatar: str
)
avatar- image url.
fight_under_this_flag method
Meme.fight_under_this_flag()
returns - bytes which can directly be used within discord.File class.
uwu_discord method
Meme.uwu_discord()
returns - bytes which can directly be used within discord.File class.
rip method
Meme.rip()
returns - bytes which can directly be used within discord.File class.
example
It returns bytes which can directly be used in discord.py and its fork's File class.
from disnake.ext import commands
from DiscordLevelingCard import Meme
import disnake
client = commands.Bot()
@client.slash_command(name="fight_under_this_flag")
async def fight_under_this_flag_meme(ctx, user:disnake.Member):
await ctx.response.defer()
a = Meme(
avatar=user.display_avatar.url
)
image = await a.fight_under_this_flag()
await ctx.edit_original_message(file=disnake.File(image, filename="fight.png")) # providing filename is very important
Metadata
Release files for pilcord 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pilcord-1.0.1.tar.gz | 383.3 kB | Without provenance | Details for pilcord-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pilcord-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for pilcord-1.0.1-py3-none-any.whl |
Total release size: 766.7 kB
Release files / pilcord-1.0.1.tar.gz
| Download URL | pilcord-1.0.1.tar.gz |
|---|---|
| Size | 383.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c1bc4f5d5cfa8f81734079f3246579bdf8da28fa8e805c27d76f73ce2d37b2a
|
|
BLAKE2b-256 checksum How to use checksums |
ff29b12e44bfe364dbf11ed5b8932db1411c22d884a76a333e36ee13c4f103c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.9.4 Windows/10
|
Release files / pilcord-1.0.1-py3-none-any.whl
| Download URL | pilcord-1.0.1-py3-none-any.whl |
|---|---|
| Size | 383.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e4deefdb0a62e3b2f5e898f8418fc55e187fb6312763e01383031b560a17a027
|
|
BLAKE2b-256 checksum How to use checksums |
6e04e4d41e59cd2e51aaec5f54ae705c5feedc6000a6941e80577cbc8bdcaa17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.9.4 Windows/10
|
Security for pilcord 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.