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
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 becktesting
Also, d.js v14.10.0 causes this, just fyi
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 youThat's expected, your "main" field in package.json is src/index.js, and sapphire uses directories relative to that
Yeah, forgot about that
cc @Favna
We already know in discord.js's internals
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.Update to v14.10.2, it should be fixed now
I hope so, I tried the
yarn up -R @discordjs/builders
and it exploded, I'll check later and let you knowIt wouldn't have made a difference because latest djs depends on latest /builders, so it was naturally bumped for you
Well, I did
yarn upgrade
, I get an error cannot find isJSONEncodeable
(something like that)
So yeah, I might downgrade again till this is solvedbecause
isJSONEncodeable
was removed
so wherever you're using that, stop using itGood thing I'm not using it
It's an internal error
shrug
From message creation
@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
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
yarn upgrade
is yarn v1 btw. You should really update to Yarn v3. V1 is deprecated.Seems to still be on 14.9.0, which is weird, since I upgraded, I'll try again when I'm home
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: 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:
This will add to your .yarnrc
file:
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
:
And anywhere in your scripts in package.json where you use *
you should wrap it in extra "
For example:
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:
I believe I updated yarn when I started this project, but I'll verify
well
yarn upgrade
doesnt exist with yarn v3
so...Yeah update yarn, run whatever command it has now to update everything, and see
Seems to have worked, thx