Getting the error as mentioned on the title.
My command file:
const anime = require("ctk-anime-scraper");
module.exports.run = (message, args) => {
const query = args.join(" ");
if(!query) return message.channel.send("Anime not specified").then(m => m.delete({ timeout: 10000 }));
anime.search(query).then(data => {
if(!data.length) return message.channel.send("No anime found.");
anime.fetchAnime(data[0].link).then (d => message.channel.send(d));
});
};
And my part of the index file which have the error (other parts are right):
client.on("message", async message => {
// message things needed
const prefix = ".";
if (message.author.bot || !message.content.startsWith(prefix)) return;
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const commandName = args.shift().toLowerCase();
// command
if (!client.commands.has(commandName)) return;
const command = client.commands.get(commandName);
try {
command.run(client, message, args);
}