Answer the question
In order to leave comments, you need to log in
Why does ParsingError:Unexpected token occur?
I'm making my own discord bot, trying to make a command to delete messages, but for some reason some error appears, and I don't know how to fix it.
const Discord = require("discord.js");
const fs = require("fs");
module.exports.run = async (bot, message, args) => {
if(message.content.startsWith(prefix + "clear")){
if(!message.member.hasPermission("MANAGE_MESSAGES"))return(message.reply("you need to have \`MANAGE_MESSAGES\` permission to do that"));
let howManyDelete = args[1];
if(!howManyDelete)return(message.reply("please enter how many messages you want to delete"));
if(howManyDelete < 1)return(message.reply("please enter number more than 1"));
if(howManyDelete > 100)return(mesasge.reply("please enter number lower than 100"));
await message.channel.bulkDelete(howManyDelete);
message.channel.send(`Deleted \`${howManyDelete}\` messages`);
};
module.exports.help = {
name: "clear"
};
Answer the question
In order to leave comments, you need to log in
This error is related to the token. Your token is invalid, insert a new token into your bot.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question