Comments (7)
I tried using the library myself and it seems to work for me. can you give me some reproducible code. where exactly are you using the library?
from discordlevelingcard.
Sry for my late reply I refreshed my browser every day but it didnt show your comment.
Below you can see the image Im using:
import discord
from discord.ext import commands
from DiscordLevelingCard import RankCard, Settings
bot = commands.Bot(command_prefix="/", intents=discord.Intents.all())
@bot.event
async def on_ready():
await bot.tree.sync()
@bot.tree.command(name="level", description="Shows you your level")
async def level(interaction:discord.Interaction):
await interaction.response.defer(thinking=True)
level = 1
xp = 0
maxxp = 100
card_tpye = 1
card_settings = Settings(
background="C:/Users/Administrator/Documents/background.png",
text_color="#FFFFFF",
bar_color="#FFFFFF",
background_color="#36393F"
)
card = RankCard(
settings=card_settings,
avatar=interaction.user.display_avatar.url,
level=level,
current_exp=xp,
max_exp=maxxp,
username=interaction.user.display_name
)
if card_tpye == 1:
image = await card.card1()
elif card_tpye == 2:
image = await card.card2()
elif card_tpye == 3:
image = await card.card3()
await interaction.followup.send(file=discord.File(image, filename="rank.png"))
bot.run("TOKEN")
from discordlevelingcard.
since you said that you are using a host then it somewhat makes sense that the line background="C:/Users/Administrator/Documents/background.png",
won't actually work. try giving it a relative path than the absolute path and save the background image in your project folder.
If the error still persists then please do let me know
from discordlevelingcard.
It still crashes. I also have other resources that I use in the documents folder, which all can be found.
from discordlevelingcard.
try running the code on your local laptop/PC and check if the error still exists. I still don't truly understand the error since the library works properly for me. It could be a version mismatch as well (library is created for 3.9x and not for anything >3.10). There isn't an error message which is weird as well.
from discordlevelingcard.
Thank you. It was a version mismatch, I used 3.12 on the new host machine and it works now after I switched back to 3.9.
Could you please add a quick version check with an error message to it?
Keep up the amazing work :D
from discordlevelingcard.
I will definitely add the version check. If you have any other feature you want me to add or implement please do tell.
Thank you!
from discordlevelingcard.
Related Issues (10)
- Syntaxt issue HOT 1
- More customization options? HOT 11
- doesnt work HOT 2
- Background Path not working HOT 3
- Error with PIL HOT 1
- Image keeps rendering weird HOT 2
- xp bar background not transparent HOT 2
- Subtract xp from previous level HOT 5
- 0 xp still show the progressbar HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discordlevelingcard.