Giter VIP home page Giter VIP logo

Comments (7)

krishsharma411 avatar krishsharma411 commented on May 19, 2024

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.

Melmacker avatar Melmacker commented on May 19, 2024

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:
background

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.

krishsharma0413 avatar krishsharma0413 commented on May 19, 2024

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.

Melmacker avatar Melmacker commented on May 19, 2024

It still crashes. I also have other resources that I use in the documents folder, which all can be found.

from discordlevelingcard.

krishsharma0413 avatar krishsharma0413 commented on May 19, 2024

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.

Melmacker avatar Melmacker commented on May 19, 2024

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.

krishsharma0413 avatar krishsharma0413 commented on May 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.