aoijs / aoi.js

aoi.js - The most advanced string-based package to create a Discord Bot fast and powerful.
https://aoi.js.org
Apache License 2.0
329 stars 130 forks source link

Bug: Leaderboard #629

Closed LaurensTheDev closed 1 month ago

LaurensTheDev commented 1 month ago

Bug Type

Function

Bugged Function

$userLeaderBoard[$guildID;coins;asc;{top} - {username} - {value};10;1;main]

Version of aoi.js

v6.7.1

Version of Node.js

v21.4.0 (Current)

Excepted Output

1 - name - 100 2 - name - 200

(using 6.8.5 and aoi.mongo) (this happens with all leaderboard functions)

Relevant log output

TypeError: Cannot read properties of undefined (reading 'startsWith')
    at /home/container/node_modules/aoi.js/src/functions/userLeaderBoard.js:26:29
    at Array.filter (<anonymous>)
    at Database.all (/home/container/node_modules/aoi.mongo/classes/Database.js:227:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async module.exports [as code] (/home/container/node_modules/aoi.js/src/functions/userLeaderBoard.js:23:14)
    at async Object.Interpreter [as interpreter] (/home/container/node_modules/aoi.js/src/core/interpreter.js:327:28)
    at async module.exports [as code] (/home/container/node_modules/aoi.js/src/functions/eval.js:12:18)
    at async Interpreter (/home/container/node_modules/aoi.js/src/core/interpreter.js:327:28)

Code of Conduct

LaurensTheDev commented 1 month ago

aoi.mongo debug returns this:


[received] all(main, (data) => {
            return data.key.startsWith(variable.addBrackets() + "_") && data.key.split("_").length === 3 && data.key.split("_")[2] == guildID;
        }, 10, asc)
LaurensTheDev commented 1 month ago

nvm my database was just broken, after resetting it worked