greys-bots / form-fox

A form and application bot for Discord
GNU Affero General Public License v3.0
16 stars 14 forks source link

Module missing error #28

Closed superJK92iscool closed 2 years ago

superJK92iscool commented 2 years ago

When I run node bot/bot

I get

internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module 'node:events'
Require stack:
- C:\Users\super\form-fox\node_modules\discord.js\src\client\BaseClient.js
- C:\Users\super\form-fox\node_modules\discord.js\src\index.js
- C:\Users\super\form-fox\bot\bot.js
←[90m    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:667:27)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:887:19)←[39m
←[90m    at require (internal/modules/cjs/helpers.js:74:18)←[39m
    at Object.<anonymous> (C:\Users\super\form-fox\node_modules\←[4mdiscord.js←[24m\src\client\BaseClient.js:3:22)
←[90m    at Module._compile (internal/modules/cjs/loader.js:999:30)←[39m
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)←[39m
←[90m    at Module.load (internal/modules/cjs/loader.js:863:32)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:708:14)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:887:19)←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: [
    ←[32m'C:\\Users\\super\\form-fox\\node_modules\\discord.js\\src\\client\\BaseClient.js'←[39m,
    ←[32m'C:\\Users\\super\\form-fox\\node_modules\\discord.js\\src\\index.js'←[39m,
    ←[32m'C:\\Users\\super\\form-fox\\bot\\bot.js'←[39m
  ]
}
greysdawn commented 2 years ago

Hiya, please make sure you're running at least node.js 16.6.0 or higher

superJK92iscool commented 2 years ago

Now I get

DiscordAPIError[50001]: Missing Access
    at SequentialHandler.runRequest (C:\Users\super\form-fox\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js:198:23
)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (C:\Users\super\form-fox\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.j
s:99:20)
    at async InteractionHandler.load (C:\Users\super\form-fox\bot\handlers\interaction.js:157:6)
    at async Client.<anonymous> (C:\Users\super\form-fox\bot\handlers\interaction.js:19:4) {
  rawError: { message: 'Missing Access', code: 50001 },
  code: 50001,
  status: 403,
  method: 'put',
  url: 'https://discord.com/api/v10/applications/985710408071524413/guilds/979565697137000508/commands'
}
DiscordAPIError[50001]: Missing Access
    at SequentialHandler.runRequest (C:\Users\super\form-fox\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js:198:23
)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (C:\Users\super\form-fox\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.j
s:99:20)
    at async InteractionHandler.load (C:\Users\super\form-fox\bot\handlers\interaction.js:157:6)
    at async Client.<anonymous> (C:\Users\super\form-fox\bot\handlers\interaction.js:19:4) {
  rawError: { message: 'Missing Access', code: 50001 },
  code: 50001,
  status: 403,
  method: 'put',
  url: 'https://discord.com/api/v10/applications/985710408071524413/guilds/979565697137000508/commands'
}
greysdawn commented 2 years ago

You'll need to re-invite your bot's application to the server you have set up in the .env with the applications.commands scope added to the invite

superJK92iscool commented 2 years ago

How do I get it so only I can accept and decline forms so admins can't.

superJK92iscool commented 2 years ago

I just changed the channel that the responses post to, to a private channel that I and discord bots can view and send messages in.