You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bot commands no longer work. but the panel can return them
C:\Users\batti\OneDrive\Documents\GitHub\Eagle-Bot-List\src\routes\bots\index.js:85
let c = botUser.presence.status;
^
TypeError: Cannot read properties of undefined (reading 'status')
at C:\Users\batti\OneDrive\Documents\GitHub\Eagle-Bot-List\src\routes\bots\index.js:85:28
at processTicksAndRejections (node:internal/process/task_queues:96:5)
C:\Users\batti\OneDrive\Documents\GitHub\Eagle-Bot-List\src\routes\api\auth\index.js:16
if (![bot.owners.primary].concat(bot.owners.additional).includes(req.user.id) && !admin_user_ids.includes(req.user.id)) return res.json({ "success": false, "error": "Bot owner is not user." });
^
ReferenceError: admin_user_ids is not defined
at C:\Users\batti\OneDrive\Documents\GitHub\Eagle-Bot-List\src\routes\api\auth\index.js:16:85
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Well, I am unable to reproduce the first and the third error(s), but the second one says that the variable admin_user_ids is not defined, so you should check for its definition in other parts of the code.
As for the first one, you should add a check whether the bot has a presence set or not, example:
// Assuming that `.status` is a `string` object,// we return an empty string if no presence// was received or fetched from gateway.letc=botUser.presence?.status??'';
Last but not least, in the third one, you should do the same thing for the first one, example:
if(req?.user?.staff){ ... }
Here, ?. checks whether the variable that is currently being accessed checks whether the variable req (or req.user, if it is accessible) is null or undefined.
Bug description
Bot commands no longer work. but the panel can return them
The text was updated successfully, but these errors were encountered: