VoloBuilds / openai-assistants-discord-bot

MIT License
47 stars 24 forks source link

bot wont start #4

Closed AIPowerGrid closed 9 months ago

AIPowerGrid commented 10 months ago

I populated my .env files with openai key, discord bot token, and assistant ID. And when I run nodemon bot, I get the following:

discordbot/openai-assistants-discord-bot/node_modules/discord.js/src/client/BaseClient.js:45 userAgentAppendix: options.rest?.userAgentAppendix ^

SyntaxError: Unexpected token '.' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (/home/j/discordbot/openai-assistants-discord-bot/node_modules/discord.js/src/index.js:6:22) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) [nodemon] app crashed - waiting for file changes before starting... ^Cj@pop-os:~/discordbot/openai-assistants-discord-bot$ nano node_modules/di digest-fetch/ discord-api-types/ discord.js/

VoloBuilds commented 10 months ago

Huh, that's a strange error - haven't seen that one before. Something to do with the Discord library. Maybe try deleting node_modules and reinstalling dependencies? Maybe local node version is old/out of date?

AIPowerGrid commented 9 months ago

Same error after rebuild and even on another machine, but they are both Pop_OS distro. Let me try on another..

AIPowerGrid commented 9 months ago

It works in Windows!

VoloBuilds commented 9 months ago

Oh interesting! I am developing on a Windows but it looks like @ShivamB25 was able to get it working on an alpine-based node image to get it working in Docker, so it seems like maybe some issue between Pop OS and Discord? That would be sort of outside the scope of this repo, so I'm inclined to close. What do you think @AIPowerGrid ?

ShivamB25 commented 9 months ago

Oh interesting! I am developing on a Windows but it looks like @ShivamB25 was able to get it working on an alpine-based node image to get it working in Docker, so it seems like maybe some issue between Pop OS and Discord? That would be sort of outside the scope of this repo, so I'm inclined to close. What do you think @AIPowerGrid ?

the other way would be for him to try using docker-compose instead while changing the default runtime on docker. maybe try podman too

VoloBuilds commented 9 months ago

Given that this seems to be an environmental issue, I'm going to close. If there are more details to consider or code changes to help avoid this issue, please make a PR or add a comment with more info!