Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
02958e9
v1.3.5 (RELEASE)
Abadima Aug 7, 2023
b50ac7a
*quick updates
Abadima Aug 7, 2023
8922663
v1.3.7
Abadima Aug 12, 2023
b52848a
v1.3.8
Abadima Jan 26, 2026
8b1557f
Satisfy Codacy (v1.3.8-fix.0)
Abadima Jan 26, 2026
b9c0d22
Refactor level payload creation to utility function
Abadima Jan 26, 2026
afbf0d3
Refactor leaderboard and add JSDoc comments
Abadima Jan 26, 2026
3018380
Refactor leaderboard and shortener logic
Abadima Jan 26, 2026
732fccb
is it fixed yet..
Abadima Jan 26, 2026
59bb447
Update shortener.js
Abadima Jan 26, 2026
ee85502
Fix Typo
Abadima Jan 26, 2026
8e49516
Allow "level 0"
Abadima Jan 26, 2026
1efe2c3
Update src/setXP.js
Abadima Jan 26, 2026
0a00975
fix typo
Abadima Jan 26, 2026
55587e8
Update src/leaderboard.js
Abadima Jan 26, 2026
b87ea80
Initial plan
Copilot Jan 26, 2026
b39a703
Fix levelUp event comparison to compare previous level with new level
Copilot Jan 26, 2026
13ac2d9
Merge pull request #11 from Abadima/copilot/sub-pr-10
Abadima Jan 26, 2026
e9b44c8
Initial plan
Copilot Jan 26, 2026
8f3374f
Initial plan
Copilot Jan 26, 2026
793f2ff
Fix race condition in setXP by updating xp and level atomically
Copilot Jan 26, 2026
207db13
Fix setLevel to capture previous level before updating
Copilot Jan 26, 2026
a96625e
Initial plan
Copilot Jan 26, 2026
6bf2ab8
Return both xp and level from setXP for consistency
Copilot Jan 26, 2026
52594fc
Ensure level is coerced to number before comparison
Copilot Jan 26, 2026
a384d7e
Update JSDoc to reflect level accepts string or number
Copilot Jan 26, 2026
44e681f
Merge pull request #12 from Abadima/copilot/sub-pr-10-again
Abadima Jan 26, 2026
005ed73
Merge pull request #13 from Abadima/copilot/sub-pr-10-another-one
Abadima Jan 26, 2026
145cbee
Merge pull request #14 from Abadima/copilot/sub-pr-10-yet-again
Abadima Jan 26, 2026
ec35b9f
small patches
Abadima Jan 26, 2026
0371ece
Initial plan
Copilot Jan 26, 2026
eaefb2b
Apply review feedback: fix level params, negative numbers, indentatio…
Copilot Jan 26, 2026
c6d1dc7
Revert connect.js to only notify when explicitly set to true
Copilot Jan 26, 2026
d7d173a
Merge pull request #15 from Abadima/copilot/sub-pr-10-one-more-time
Abadima Jan 26, 2026
c1f15b9
Initial plan
Copilot Jan 26, 2026
be32272
Apply review feedback: fix validation, performance, and config issues
Copilot Jan 26, 2026
051f656
Update error message in addLevel to match validation logic
Copilot Jan 26, 2026
a82c91f
Improve consistency and performance in validation and deletion
Copilot Jan 26, 2026
afbb671
Merge pull request #17 from Abadima/copilot/sub-pr-10-please-work
Abadima Jan 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .eslintrc.json

This file was deleted.

10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
package-lock.json
# IDE/Editor files
.idea

# Dependencies
node_modules
.idea

# Lock files
pnpm-lock.yaml
pnpm-workspace.yaml
20 changes: 18 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
# Configurations
eslint.config.cjs
.eslintrc.json
tsconfig.json
pnpm-lock.yaml
pnpm-workspace.yaml

# Version control / CI
.github
.gitignore

# IDE / editor settings
.vscode
Examples
.tgz
.idea

# Dependencies
node_modules

# Documentation
Examples
53 changes: 23 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<p align="center"><img align="center" style="margin-bottom:-6px" src="https://i.imgur.com/BiaHJA7.png?maxwidth=128&fidelity=grand"></p>

<h2 style="font-size:2.5rem;" align="center">Simply-XP</h2>
<p align="center">
<img src="https://i.ibb.co/cCKJ9FS/simplyxp.png" width="320" height="125" alt="Simply-XP logo" />
</p>

<h2 align="center">A Simple, Easy and Beginner friendly XP System. <br>Supports Discord.JS<br><br>Developed by Rahuletto#0243 & Maintained by Abadima#6356</h2>
A simple, beginner-friendly XP system that brings levels, ranks, and role rewards to Discord.js.

<br>
<p align="center">
<a href="https://www.npmjs.com/package/simply-xp"><img src="https://img.shields.io/npm/v/simply-xp.svg?style=flat-square" /></a>
<a href="https://www.npmjs.com/package/simply-xp"><img src="https://img.shields.io/npm/dt/simply-xp?style=flat-square" /></a><br>
<a href="https://www.npmjs.com/package/simply-xp"><img src="https://nodei.co/npm/simply-xp.png?downloadRank=true&downloads=true&downloadRank=true&stars=true" /></a><br>
<a href="https://discord.gg/3JzDV9T5Fn"><img src="https://invidget.switchblade.xyz/3JzDV9T5Fn" /></a>
<a href="https://www.npmjs.com/package/simply-xp"><img src="https://img.shields.io/npm/v/simply-xp.svg?style=for-the-badge" alt="npm version" /></a>
<a href="https://www.npmjs.com/package/simply-xp"><img src="https://img.shields.io/npm/dt/simply-xp?style=for-the-badge" alt="npm downloads" /></a>
<a href="https://www.codefactor.io/repository/github/abadima/simply-xp/overview/lts"><img src="https://www.codefactor.io/repository/github/abadima/simply-xp/badge/lts?style=for-the-badge" alt="CodeFactor grade" /></a>
</p>

<br>
<p align="center">
<a href="https://simplyxp.js.org/docs/next/intro/"><img src="https://img.shields.io/badge/SimplyXP-Documentation-6b46d4?style=for-the-badge" alt="Docs" /></a>
<a href="https://discord.gg/hjhnjYJNHX"><img src="https://img.shields.io/badge/Discord-Support-5865F2?style=for-the-badge&logo=discord" alt="Discord support" /></a>
</p>

## 🖥️ <b>How to install ?
## 🖥️ How to install?

```
npm install simply-xp
Expand All @@ -26,32 +27,24 @@ npm install simply-xp
yarn add simply-xp
```

<br>

# 🎉 Recent Updates 🎉
## 🎉 Recent Updates

- Fixed Various Bugs
- Updated `Chart.js`
- D.JS v14 Support
- Patched v1.3.5 Bugs

# ⭐ Features

# But Why ?

- Easiest XP System in Discord.js
- Fastest Support ever
- Rank Card Maker
- Easy XP System
- Automatic Role Assignment
- Beautiful Rank Cards
- Optimized for Performance
- Lightweight & Flexible
- Beginner Friendly
- Easier than other XP Systems
- Inbuilt Auto Roles system
- Flexible and simple at the same time

<br>
## **Need Help?** Join the [Discord Server](https://discord.gg/3JzDV9T5Fn)

## **Need Help ? Join the [Discord Server](https://discord.gg/3JzDV9T5Fn)**
## 👥 Contact & Support

<br>

<h1>👥 Contact us | Support</h1>
<p>
<a href="https://discord.gg/3JzDV9T5Fn"><img src="https://invidget.switchblade.xyz/3JzDV9T5Fn" /></a>
</p>
[![Discord invite](https://invidget.switchblade.xyz/3JzDV9T5Fn)](https://discord.gg/3JzDV9T5Fn)
28 changes: 28 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = [
{
files: ["src/**/*.js", "src/*.js", "*.js"],
languageOptions: {
globals: {
require: "readonly",
module: "readonly",
__dirname: "readonly",
__filename: "readonly",
process: "readonly",
console: "readonly"
},
parserOptions: {
ecmaVersion: "latest",
sourceType: "script"
}
},
rules: {
indent: ["error", "tab"],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"]
}
},
{
ignores: ["node_modules/**"]
}
];
79 changes: 40 additions & 39 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,107 +1,108 @@
import { Message, Client } from 'discord.js'
import { Message } from "discord.js";

type HexColorString = `#${string}` | string
type HexColorString = `#${string}` | string;

export type connectOptions = {
notify?: boolean
}
auto_purge?: boolean;
notify?: boolean;
};

export declare function connect(
db: string,
options?: connectOptions
): Promise<any>
): Promise<any>;

export declare function addLevel(
message: Message,
userID: string,
guildID: string,
level: number
): Promise<any>
): Promise<any>;

export declare function addXP(
message: Message,
userID: string,
guildID: string,
xp: number
): Promise<any>
): Promise<any>;

export type chartsOptions = {
position?: string
background?: HexColorString
type?: 'bar' | 'line' | 'radar' | 'doughnut' | 'polarArea'
}
position?: string;
background?: HexColorString;
type?: "bar" | "line" | "radar" | "doughnut" | "polarArea";
};

export declare function charts(
message: Message,
options?: chartsOptions
): Promise<any>
): Promise<any>;

export declare function create(userID: string, guildID: string): Promise<any>
export declare function create(userID: string, guildID: string): Promise<any>;

export declare function fetch(userID: string, guildID: string): Promise<any>
export declare function fetch(userID: string, guildID: string): Promise<any>;

export declare function leaderboard(
userID: string,
guildID: string,
limit?: number
): Promise<any>
): Promise<any>;

export declare function lvlRole(
message: Message,
userID: string,
guildID: string
): Promise<any>
): Promise<any>;

export type rankOptions = {
slash?: boolean
background?: string
color?: HexColorString
}
slash?: boolean;
background?: string;
color?: HexColorString;
};
export declare function rank(
message: Message,
userID: string,
guildID: string,
options?: rankOptions
): Promise<any>
): Promise<any>;

export declare function reset(userID: string, guildID: string): Promise<any>
export declare function reset(userID: string, guildID: string): Promise<any>;

export type lvladdOptions = {
level: string
role: string
}
level: string;
role: string;
};
export type lvlremoveOptions = {
level: string
}
level: string;
};

export declare function setLevel(
message: Message,
userID: string,
guildID: string,
level: number
): Promise<any>
): Promise<any>;

export declare function setXP(
userID: string,
guildID: string,
xp: number
): Promise<any>
): Promise<any>;

/** For levelUp event */
export type Data = {
xp: string
level: number
userID: string
guildID: string
}
xp: string;
level: number;
userID: string;
guildID: string;
};

export type Role = {
lvl: string
role: string
}
lvl: string;
role: string;
};

declare module 'discord.js' {
declare module "discord.js" {
export interface ClientEvents {
levelUp: [Message, Data, Role]
levelUp: [Message, Data, Role];
}
}
Loading