TypeError piece.aliases not iterable
When my bot is logging in, it is being prevented by this error below. I tried deleting my node_modules and reinstalling but the same thing happens. Obviously the error can't be in the framework, any idea how I can get past this?
error:
package.json
9 Replies
You have non-command files in your commands folder
And after moving them make sure you remove dist and rebuild because typescript doesn't automatically remove files
Thank you
I checked that. You are right I did use to but I found out through help here that I can’t change the name of the folder. I split out the non command files before encountering this error.
I did delete dist and rebuild too.
Is there something else it might be? I checked that I changed the sapphirerc.json from the custom folder name to ‘commands’
Upload code to GH or something that's easiest way to tell
just an unrelated tip, you don't need to do https://github.com/whackdev/BeholderSapphire/blob/development/refactor/src/commands/FogOfWar/travel.command.ts#L35 instead you can just supply both the IDs
https://github.com/favware/dragonite/blob/main/src/commands/Pokemon/item.ts#L28 like this
why do you have a constructor here https://github.com/whackdev/BeholderSapphire/blob/development/refactor/src/commands/Shops/shop.command.ts
I thought if I did this I would stop the command from being registered in the other guild.
I coded this bot with slightly functionality in commonjs for our dnd server. We use that bot in production currently even though we are going to improve it over time. I set up an exact replica of our discord server.
I thought this would:
- allow me to leave the production bot running and not have the dev commands show up in the real server for development
- only publish the commands when ready to the production branch which would then publish them in the real discord server
https://www.sapphirejs.dev/docs/Guide/application-commands/application-command-registry/registering-chat-input-commands#guildids This made me think that it would only publish in the one given.
Sapphire Framework
Registering Chat Input Commands | Sapphire
To register a Chat Input Command (also known as a Slash Command) with Discord, you need to acquire an application
that's an accident thank you. I am refactoring this to typescript and I missed removing that. I'm not great at this unfortunately but I do try to use Dragonite as an example along with all the guides
instead, you can just use two bots, one for development and one for production so you do not have to worry about under-development commands getting deployed
and idHints can contain the IDs of the respective slash commands for both the bots in the form of an array
anyways not providing any ID will NOT prevent sapphire from registering the command
so did it fix the error?
Ok thank you I’ll change that
I got it removed will check it
This did not fix it.