Closed 007-Tommy closed 4 years ago
The guide is sequential, it's essential you read and follow it carefully and precisely from the beginning (of at least the section you want to apply).
client.commands
is set to be an empty collection in the first difference code block of the section Dynamically reading command files.
+ const fs = require('fs');
const Discord = require('discord.js');
const { prefix, token } = require('./config.json');
const client = new Discord.Client();
+ client.commands = new Discord.Collection();
This is the foundation needed to be able to set and read commands from this collection further down.
If you are stuck at some confusing behavior you can also take a peek at the Resulting code where applicable.
Part of the guide or code sample the question is about https://github.com/discordjs/guide/tree/master/guide/command-handling
Question How do i get it to recognise client.commands