(xp: number)
| 22 | } |
| 23 | |
| 24 | function xpForNextLevel(xp: number): number { |
| 25 | let total = 0; |
| 26 | for (const threshold of levelThresholds) { |
| 27 | total += threshold; |
| 28 | if (xp < total) { |
| 29 | return total - xp; |
| 30 | } |
| 31 | } |
| 32 | return 0; |
| 33 | } |
| 34 | |
| 35 | script.on("MESSAGE_CREATE", async (msg) => { |
| 36 | if (!msg.author || msg.author.bot) { |