Bot does not respond

I've made a bot following the tutorial (kinda), and it does not respond at all anymore (image). The code is public and can be found at https://github.com/oriel-beck/application-bot/tree/v4. To start it follow the readme. According to the debug log it's connected and receives the interaction payload.
25 Replies
Lioness100
Lioness1002y ago
To debug, try adding the line Store.logger = console.log before you login in index.ts (Store can be imported from @sapphire/framework) That will let you know if anything went wrong while loading the command file @oriel beck
oriel beck
oriel beckOP2y ago
testing
oriel beck
oriel beckOP2y ago
Also, d.js v14.10.0 causes this, just fyi
oriel beck
oriel beckOP2y ago
I have found the cause, the app checked /app/src/commands for the commands instead of /app/commands, I changed the copy command in the Dockerfile to accommodate this and it fixed it gl with this issue @Lioness100 (am 9 btw) (it might effect everyone who uses sapphire, idk) and thank you
Lioness100
Lioness1002y ago
That's expected, your "main" field in package.json is src/index.js, and sapphire uses directories relative to that
oriel beck
oriel beckOP2y ago
Yeah, forgot about that
Lioness100
Lioness1002y ago
cc @Favna
kyra
kyra2y ago
We already know in discord.js's internals
Favna
Favna2y ago
Regarding this, try to run yarn up -R @discordjs/builders to update the transient dependency. Or whatever npm or pnpm have as equivalent, I wouldn't know. CC @Lioness100 (am 9 btw) But yes that's a known issue No idea how the core team intends to fix it... I've read different ideas. I do hope they get around it soon though. This is gonna be really infruiriating for a lot of people. Not just sapphire, but typescript discordjs users in general.
kyra
kyra2y ago
Update to v14.10.2, it should be fixed now
oriel beck
oriel beckOP2y ago
I hope so, I tried the yarn up -R @discordjs/builders and it exploded, I'll check later and let you know
kyra
kyra2y ago
It wouldn't have made a difference because latest djs depends on latest /builders, so it was naturally bumped for you
oriel beck
oriel beckOP2y ago
Well, I did yarn upgrade, I get an error cannot find isJSONEncodeable (something like that) So yeah, I might downgrade again till this is solved
Favna
Favna2y ago
because isJSONEncodeable was removed so wherever you're using that, stop using it
oriel beck
oriel beckOP2y ago
Good thing I'm not using it It's an internal error
Favna
Favna2y ago
shrug
oriel beck
oriel beckOP2y ago
From message creation
Favna
Favna2y ago
@Dragonite works just fine with 14.10.2 and I'm testing a bot with message commands for #utilities-development and it works there too
oriel beck
oriel beckOP2y ago
I'll make sure it's updated to 14.0.2 when I'm home again and let you know, it should be Actually, it's on GitHub, I can check rn
Favna
Favna2y ago
yarn upgrade is yarn v1 btw. You should really update to Yarn v3. V1 is deprecated.
oriel beck
oriel beckOP2y ago
Seems to still be on 14.9.0, which is weird, since I upgraded, I'll try again when I'm home
Spinel
Spinel2y ago
Tag suggestion for @oriel beck: Yarn v3 is new version of Yarn that we recommend switching to as Yarn v1 has been deprecated.
"But I don't see any update on [source]?"
That is correct. Yarn v3 is installed through Yarn itself. Your global toolchain is and will always remain to be Yarn v1, however, you configure Yarn v3 on a per-project basis. How? Simply write:
yarn set version berry
yarn set version berry
This will download the new Yarn v3 binary and put in .yarn/releases, you should push this to your Git repository. It will also create a .yarnrc.yml file which configures the path which you should also commit. Next you probably also want to run the following 2 commands:
yarn config set enableGlobalCache true
yarn config set nodeLinker node-modules
yarn config set enableGlobalCache true
yarn config set nodeLinker node-modules
This will add to your .yarnrc file:
enableGlobalCache: true
nodeLinker: node-modules
enableGlobalCache: true
nodeLinker: node-modules
Which ensures that you just have a Yarn v1-like experience with node_modules and a global cache. Next step is to nuke your node_modules and yarn.lock and run yarn install Then some final adjustments. Put this in you .gitignore:
# Yarn files
.yarn/install-state.gz
.yarn/build-state.yml
# Yarn files
.yarn/install-state.gz
.yarn/build-state.yml
And anywhere in your scripts in package.json where you use * you should wrap it in extra " For example:
{
"format": "prettier --write \"src/**/*.ts\""
}
{
"format": "prettier --write \"src/**/*.ts\""
}
Mind you this last thing is good add regardless of script runner / package bundler because it ensures the glob is performed by the library and not by your shell, which may differ when people develop on different operating systems. In short the command to set everything up you can run:
yarn set version berry && yarn config set enableGlobalCache true && yarn config set nodeLinker node-modules && echo "" >> .gitignore && echo "# Yarn files" >> .gitignore && echo ".yarn/install-state.gz" >> .gitignore && echo ".yarn/build-state.yml" >> .gitignore
yarn set version berry && yarn config set enableGlobalCache true && yarn config set nodeLinker node-modules && echo "" >> .gitignore && echo "# Yarn files" >> .gitignore && echo ".yarn/install-state.gz" >> .gitignore && echo ".yarn/build-state.yml" >> .gitignore
oriel beck
oriel beckOP2y ago
I believe I updated yarn when I started this project, but I'll verify
Favna
Favna2y ago
well yarn upgrade doesnt exist with yarn v3 so...
oriel beck
oriel beckOP2y ago
Yeah pandaexplode update yarn, run whatever command it has now to update everything, and see Seems to have worked, thx
Want results from more Discord servers?
Add your server