Rank/Level Command (Discord.js v14)

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ธ.ค. 2024

ความคิดเห็น • 44

  • @GaresMusicOfficial
    @GaresMusicOfficial 7 หลายเดือนก่อน +20

    (PLEASE PIN THIS)
    canvacord have changed some names of classes and how parameters are implemented. Here is an example of how to create the rank card via the new version:
    under "let currentRank = allLevels.findIndex((lvl) => lvl.userId === targetUserId) + 1;" write:
    const { Font } = require('canvacord');
    Font.loadDefault();
    const rank = new canvacord.RankCardBuilder()
    [same as in the video]
    .setTextStyles({
    level: "LEVEL:",
    xp: "EXP:",
    rank: "RANK:",
    });
    const image = await rank.build({ format: 'png',});
    const attachment = new AttachmentBuilder(image);
    interaction.editReply({ files: [attachment] });
    *IF YOU WANT TO CHANGE THE COLOR OF THE PROGRESS BAR:*
    .setStyles({
    progressbar: {
    thumb: {
    style: {
    backgroundColor: "color here, can be hex",
    },
    },
    },
    })

    • @KAP3340
      @KAP3340 7 หลายเดือนก่อน +1

      Thanks for this ❤

    • @GaresMusicOfficial
      @GaresMusicOfficial 7 หลายเดือนก่อน

      @@KAP3340 no worries at all :)

    • @audreygym6219
      @audreygym6219 7 หลายเดือนก่อน

      How can we change the size of the text ? The new rank card seems different from the video it looks like the text is smaller and level/rank/xp are written below the progressBar do you know how we can change it to make like in the video ?

    • @benzhou9751
      @benzhou9751 5 หลายเดือนก่อน

      Wait so what do you put in the "[same as in the video]" part?

    • @AboMeezO
      @AboMeezO 4 หลายเดือนก่อน

      This one:
      .setAvatar(targetUserObj.user.displayAvatarURL({ size: 256 }))
      .setRank(currentRank)
      .setLevel(fetchedLevel.level)
      .setCurrentXp(fetchedLevel.xp)
      .setRequiredXP(calculateLevelXp(fetchedLevel.level))
      .setStatus(targetUserObj.presence.status)
      .setProgressBar("#FFC300", "COLOR")
      .setUsername(targetUserObj.user.username)
      .setDiscriminator(targetUserObj.user.discriminator);

  • @Kijiroshi
    @Kijiroshi ปีที่แล้ว +3

    Thank you very much for these videos. They're super informative, easy to understand and get straight to the point.
    Keep up the amazing work!

  • @absolute_nick
    @absolute_nick ปีที่แล้ว

    Your videos are awsome and you deserve much more likes!

  • @Imdead_2115
    @Imdead_2115 ปีที่แล้ว +5

    can u make a leaderboard?

  • @XStarReviews
    @XStarReviews ปีที่แล้ว

    Great video and got it working on my side! Quick question that might be a bad one. Where does the Rank value come into play? Additionally, is it possible to replace the rank value to the name of a role instead of a number?

  • @oliverturp8667
    @oliverturp8667 ปีที่แล้ว +1

    Would love to expand the canvacord rank card into a full leaderboard for all users/top X users!

    • @XStarReviews
      @XStarReviews ปีที่แล้ว +1

      Agreed! That would be awesome. Great competitive feature to hopefully boost engagement

  • @DredragonAustin
    @DredragonAustin 11 หลายเดือนก่อน +3

    Why doees canvacord.Rank() is not working it tell me that canvacord.Rank() is not a consstructor

    • @DanielAiyon
      @DanielAiyon 10 หลายเดือนก่อน

      use canvacord.RankCardBuilder instead (from the canvacord docs)

    • @Chicken-pp8rs
      @Chicken-pp8rs 10 หลายเดือนก่อน +1

      Rank is not longer working because of newer version of canvacord.
      Solution for this is importing Font and RankCardBuilder from canvacord.
      const { Font, RankCardBuilder } = require('canvacord');
      and different using of creating cards:
      const card = new RankCardBuilder()
      .setDisplayName(name)
      .setUsername(username)
      .setAvatar(avatar_url)
      .setCurrentXP(currentXP)
      .setRequiredXP(requiredXP)
      .setLevel(level)
      .setRank(currentRank)
      .setOverlay(90)
      .setBackground("#000000")
      });
      const image = await card.build({
      format: "png",
      });
      const attachment = new AttachmentBuilder(image);
      interaction.editReply({ files: [attachment] });
      },

  • @spiritwolf1390
    @spiritwolf1390 ปีที่แล้ว +1

    Hey! I followed this video for the rank card and it worked well... right to the point where I tried looking up someone who was offline. the Error was marked as Status = NULL. Apparently in the discord documentation there are only 3 status presences. online, idle and dnd. there is no presence for Offline members which breaks the .setStatus() entry of the rank card. Not sure if you have fixed his in further videos but thought I would point it out in case it went unnoticed. Keep up the flow in the channel. I like how you explain things!

    • @KAP3340
      @KAP3340 6 หลายเดือนก่อน

      For me, I just made a function to identify the user's status, and if it's not in the 3, then I just coded it so that it sets the status to offline, since it must be offlne.

  • @shapo2453
    @shapo2453 ปีที่แล้ว +1

    How about modals (for moderator recruitment for example ?), or welcome / leave embeds ?

  • @iliketoast
    @iliketoast 11 หลายเดือนก่อน

    How would I change the text 'LEVEL' or 'RANK' to be different and how would I add a background image to the image

  • @ipn.d
    @ipn.d 6 หลายเดือนก่อน

    There was an error running this command: TypeError: canvacord.Rank is not a constructor
    any one have a solution?

  • @hyp3rislive
    @hyp3rislive ปีที่แล้ว

    In Canvacord Status its showing undefined and not showing the status ?

  • @PapodeMestre
    @PapodeMestre ปีที่แล้ว

    could be a good idea to give roles while member is leveling

  • @bachpankasitara9055
    @bachpankasitara9055 ปีที่แล้ว

    Thank you!!! Btw can you make a video of music bot?

    • @UnderCtrl
      @UnderCtrl  ปีที่แล้ว

      Unfortunately it's against TOS :(

    • @bachpankasitara9055
      @bachpankasitara9055 ปีที่แล้ว

      @@UnderCtrl and what about Spotify api?

  • @giuseppemarino7831
    @giuseppemarino7831 7 หลายเดือนก่อน

    TypeError: canvacord.Rank is not a constructor. Help please

    • @persty1
      @persty1 6 หลายเดือนก่อน

      same

  • @chammy7523
    @chammy7523 ปีที่แล้ว +1

    Can you do a music bot? :>

  • @i._.become_a_devil
    @i._.become_a_devil ปีที่แล้ว

    is it work in discord.js 13 after doing some changes?

  • @Xilart142
    @Xilart142 ปีที่แล้ว

    waiting for music commands tutorial

  • @yudhacakep8390
    @yudhacakep8390 ปีที่แล้ว

    i got error: "Current xp data type must be a number, received undefined". how to fix that?

    • @arijitdn
      @arijitdn ปีที่แล้ว

      parseInt()

  • @AnkushThakur-zd3ks
    @AnkushThakur-zd3ks ปีที่แล้ว

    could you teach us how to add music as well?

  • @PapodeMestre
    @PapodeMestre ปีที่แล้ว

    Shit i don't know how to deploy this command in bot.
    i'm getting error
    undefined...

  • @shieldzfn
    @shieldzfn ปีที่แล้ว

    yo could you do an updated tutorial on how to make slash commands

    • @UnderCtrl
      @UnderCtrl  ปีที่แล้ว

      The video I have is up to date

  • @IronBubbles33
    @IronBubbles33 7 หลายเดือนก่อน

    canvacord.Rank() not a constructor easiest way to fix do npm remove convacord and then do npm i convacord@latest

  • @TheOfficial_Elias
    @TheOfficial_Elias 8 หลายเดือนก่อน +1

    It says: There was an error running this command: TypeError: canvacord.Rank is not a constructor. i have tryed to the code from github but it will not work can somebody please help?

    • @GaresMusicOfficial
      @GaresMusicOfficial 7 หลายเดือนก่อน

      instead use:
      const rank = new canvacord.RankCardBuilder()

    • @Hotdoghunter55
      @Hotdoghunter55 7 หลายเดือนก่อน +1

      its on there discord server in ther faq

    • @audreygym6219
      @audreygym6219 7 หลายเดือนก่อน

      canvacord.Rankbuilder()