Search code examples
javascriptdiscord

Is there a way to find out how many emoji slots left to use on a guild?


Is there a way to find out how many emoji slots left to use on a guild? Or just a total amount of emoji slots available for a certain guild

discord.js


Solution

  • https://discord.js.org/#/docs/main/stable/typedef/PremiumTier

    Guild PremiumTier

    The premium tier (Boost level) of a guild:

    NONE     - 100 total slots
    TIER_1   - 200 total slots
    TIER_2   - 350 total slots
    TIER_3   - 500 total slots
    

    Can be used to count how many slots are available for a guild

    The slots between usual and animated emojis spread equally, you can calculate the amount of slots left for each type, like this

    ( tier level slots / 2 ) - the amount of emojis already uploaded of one of the types

    var totalEmojiSlots;
    
    if(message.guild.premiumTier == 1){
      totalEmojiSlots = 200;
    } else
    if(message.guild.premiumTier == 2){
      totalEmojiSlots = 350;
    } else
    if(message.guild.premiumTier == 3){
      totalEmojiSlots = 500;
    } else {
      totalEmojiSlots = 100;
    }
    
    // And each emoji type takes half of total emoji slots