Role Command: Cannot read properties of undefined #137

Closed
opened 2022-04-23 16:20:52 +01:00 by Vylpes · 0 comments
Vylpes commented 2022-04-23 16:20:52 +01:00 (Migrated from github.com)

When running the role command it crashes the bot due to not being able to find the roles in the config.

(node:15667) DeprecationWarning: Passing strings for MessageEmbed#setFooter is deprecated. Pass a sole object instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
/home/vylpes/projects/vylbot-app/dist/commands/role.js:25
            const roles = process.env.COMMANDS_ROLE_ROLES.split(',');
                                                          ^

TypeError: Cannot read properties of undefined (reading 'split')
    at Role.<anonymous> (/home/vylpes/projects/vylbot-app/dist/commands/role.js:25:59)
    at Generator.next (<anonymous>)
    at /home/vylpes/projects/vylbot-app/dist/commands/role.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/vylpes/projects/vylbot-app/dist/commands/role.js:4:12)
    at Role.execute (/home/vylpes/projects/vylbot-app/dist/commands/role.js:24:16)
    at Util.<anonymous> (/home/vylpes/projects/vylbot-app/dist/client/util.js:79:31)
    at Generator.next (<anonymous>)
    at fulfilled (/home/vylpes/projects/vylbot-app/dist/client/util.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Subtasks

  • Fix issue with bot crashing
  • Fix issue with it not fetching the server's prefix
  • Add easy way to configure
When running the role command it crashes the bot due to not being able to find the roles in the config. ```bash (node:15667) DeprecationWarning: Passing strings for MessageEmbed#setFooter is deprecated. Pass a sole object instead. (Use `node --trace-deprecation ...` to show where the warning was created) /home/vylpes/projects/vylbot-app/dist/commands/role.js:25 const roles = process.env.COMMANDS_ROLE_ROLES.split(','); ^ TypeError: Cannot read properties of undefined (reading 'split') at Role.<anonymous> (/home/vylpes/projects/vylbot-app/dist/commands/role.js:25:59) at Generator.next (<anonymous>) at /home/vylpes/projects/vylbot-app/dist/commands/role.js:8:71 at new Promise (<anonymous>) at __awaiter (/home/vylpes/projects/vylbot-app/dist/commands/role.js:4:12) at Role.execute (/home/vylpes/projects/vylbot-app/dist/commands/role.js:24:16) at Util.<anonymous> (/home/vylpes/projects/vylbot-app/dist/client/util.js:79:31) at Generator.next (<anonymous>) at fulfilled (/home/vylpes/projects/vylbot-app/dist/client/util.js:5:58) at processTicksAndRejections (node:internal/process/task_queues:96:5) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. ``` ## Subtasks - [x] Fix issue with bot crashing - [x] Fix issue with it not fetching the server's prefix - [x] Add easy way to configure
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: RabbitLabs/vylbot-app#137
No description provided.