#Bot does not respond

1 messages · Page 1 of 1 (latest)

thorny estuary
#

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.

safe field
#

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

#

@thorny estuary

thorny estuary
#

testing

#

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

thorny estuary
safe field
thorny estuary
#

Yeah, forgot about that

safe field
lapis pecan
#

We already know in discord.js's internals

analog geyser
#

CC @safe field

#

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.

lapis pecan
thorny estuary
lapis pecan
#

It wouldn't have made a difference because latest djs depends on latest /builders, so it was naturally bumped for you

thorny estuary
#

So yeah, I might downgrade again till this is solved

analog geyser
#

because isJSONEncodeable was removed

#

so wherever you're using that, stop using it

thorny estuary
#

Good thing I'm not using it

#

It's an internal error

analog geyser
#

shrug

thorny estuary
#

From message creation

analog geyser
#

@dreamy scroll works just fine with 14.10.2

#

and I'm testing a bot with message commands for #utilities-development and it works there too

thorny estuary
#

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

analog geyser
#

yarn upgrade is yarn v1 btw. You should really update to Yarn v3. V1 is deprecated.

thorny estuary
#

Seems to still be on 14.9.0, which is weird, since I upgraded, I'll try again when I'm home

molten yachtBOT
#

Tag suggestion for @thorny estuary:
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

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

This will add to your .yarnrc file:

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

And anywhere in your scripts in package.json where you use * you should wrap it in extra "
For example:

{
	"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
thorny estuary
#

I believe I updated yarn when I started this project, but I'll verify

analog geyser
#

well yarn upgrade doesnt exist with yarn v3

#

so...

thorny estuary
#

Yeah pandaexplode

#

I'll update yarn, run whatever command it has now to update everything, and see