1.2.6 • Published 5 months ago
@elara-services/leveling v1.2.6
Welcome to the leveling package
Links:
 Docs
 Docs
 Support
 Support
 Patreon
 Patreon
 PayPal
 PayPal
REQUIRED:
- client: A v13/v14 discord.js client. (this will not work with any version below v13)
- mongodb_uri: A mongodb connection uri. (this is for the package to save the data for servers/users/weekly)
Features:
- XP Earning
- Messages (with custom cooldown)
- Voice
- Toggle for if users should be unmuted to earn XP in voice channel(s)
- Custom Levels
- Custom messages per-level
- Custom roles to add/remove when a use gets to that level
- Toggle to only announced when someone reaches a registered level
- Toggle if the level roles should stack (default: they don't)
- Weekly Leaderboard
- Automatic announcements
- Weekly stats for the server's messages,voiceandxp
- Weekly stats for the user's messages,level,voiceandxpearned that week
- Custom ping role(s) for when the leaderboard gets announced
- Default rank image profiles
- Currently supported types: arcaneandcavancord
- Default leaderboard images
- Currently supported types: canvacord
- Custom XP earned
- Min/Max XP earned for when sending messages.
- Custom cooldown for earning XP
- Custom XP Multipliers
- Can be limited to the entire server or only certain channels/roles.
- Ignore roles/channels/users
- Level up announcements
- Supports: DM and Channel notifications
- Custom content/embeds for both DM and Channel notifications.
- Toggle for pinging the user in the level up message (can be disabled per-user as well)
- Reset a user's data when they leave the server.
- Requires the bot to have "GuildMembers" intent
- User Customization
- stats: For any stats for the user (by default:- messages,- voice) but this could be added with any stats for the user (just use- api.users.stats.inc)
- background: Sets the background for the user's rank profiles.
- colors: Sets the custom color for certain rank profiles.
- toggles.locked: Freezes the user's data from earning XP
- toggles.dms: Makes the bot not DM them level announcements
- toggles.pings: Makes the bot not mention them in level announcements
Getting Started
    const { Leveling } = require("@elara-services/leveling");
    const lvls = new Leveling(client, "MONGODB_URI");
    await lvls.start(); // This will tell the package to start listening for events. Note: All data can be configured with lvls.api.xxx
Example API Functions:
Servers:
   const server = lvls.api.servers;
   // Get the server data.
   const serverData = await server.get("server_id");
   if (serverData.status) {
        console.log(serverData.data); // Returns the settings for the server.
   }
   // Toggle leveling on/off for a server. (by default: Leveling is off for the server)
   const data = await server.toggle("server_id", "leveling");
   console.log(data.message);Users:
    const users = lvls.api.users;
    // Get a user's data 
    const userData = await users.get("user_id", "server_id");
    if (userData.status) {
        console.log(userData.data); // Returns the user's data for that server.
    }Rank Profile(s):
    const data = await lvls.getRankCard("user_id", "server_id");
    // OR 
    const data = await lvls.getRankCard("user_id", "server_id", "rank_card_type"); 
    // By default the "rank_card_type" is "arcane"
    if (data.status) { // Get the rank profile image then send it to the channel
        return channel.send({
            files: [
                { 
                    name: "profile.png",
                    attachment: data.image,
                }
            ]
        });
    }Get Leaderboard Image
    const data = await lvls.getLeaderboard("server_id");
    // OR 
    const data = await lvls.getLeaderboard(
        "server_id",
        {
            page: 1, // The page for the leaderboard image
            perPage: 5, // Up to 10 users returned in the leaderbaord image
            sort: "top", // Sort by "top" or "bottom"
            sortBy: "xp", // Sortby "xp" or "level" 
        },
        "canvacord",
        false, // If you want the weekly leaderboard, set this to: true
    )
    if (data.status) {
        // Get the leaderboard image then send it to the channel. 
        return channel.send({
            files: [
                {
                    name: "lb.png",
                    attachment: data.image,
                }
            ]
        });
    }1.2.6
5 months ago
1.2.5
5 months ago
1.2.4
5 months ago
1.2.3
6 months ago
1.2.2
1 year ago
1.2.0
1 year ago
1.2.1
1 year ago
1.1.19
1 year ago
1.1.18
2 years ago
1.1.16
2 years ago
1.1.14
2 years ago
1.1.17
2 years ago
1.1.13
2 years ago
1.1.12
2 years ago
1.1.11
2 years ago
1.1.10
2 years ago
1.1.9
2 years ago
1.1.8
2 years ago
1.1.7
2 years ago
1.1.6
2 years ago
1.1.5
2 years ago
1.1.4
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago