My help command doesn't work

I new in v12
And why this command not work me on v12?

bot.on(“message”, async message => {

if(message.author.bot) return;
if(message.channel.type === “dm”) return;

if (message == <@${bot.user.id}> || message == <@!${bot.user.id}>) {
message.channel.cache.send(“Hey My Prefix Is !”)
}

let prefixes = JSON.parse(fs.readFileSync("./prefixes.json", “utf8”));
if(!prefixes[message.guild.id]){
prefixes[message.guild.id] = {
prefixes: botconfig.prefix
};
}

let prefix = prefixes[message.guild.id].prefixes;
if(!message.content.startsWith(prefix)) return;
if(cooldown.has(message.author.id)){
message.delete();
return message.reply(“You have to wait 5 seconds between commands.”)
}
if(!message.member.hasPermission(“ADMINISTRATOR”)){
cooldown.add(message.author.id);
}

let messageArray = message.content.split(" ");
let cmd = messageArray[0];
let args = messageArray.slice(1);

let commandfile = bot.commands.get(cmd.slice(prefix.length));
if(commandfile) commandfile.run(bot,message,args);

setTimeout(() => {
cooldown.delete(message.author.id)
}, cdseconds * 1000)
});

Hello, are you getting any errors?

No I don’t have

formatted version:

bot.on(“message”, (message) => {
    if (message.author.bot) return;
    if (message.channel.type === “dm”) return;

    if (message == < @$ {
            bot.user.id
        } > || message == < @!$ {
            bot.user.id
        } > ) {
        message.channel.send(“Hey My Prefix Is!”)
    }

    let messageArray = message.content.split(" ");
    let cmd = messageArray[0];
    let args = messageArray.slice(1);

    if (!message.content.startsWith(prefix)) return;

    let commandfile = bot.commands.get(cmd.slice(prefix.length));
    if (commandfile) commandfile.run(bot, message, args);
});

I try your code and I have error

I’m just formatting the code, so others can view it and build off it.

Ok i edit code
I wait :smile:

I want to learn v12 now
All my bot my v12
And this last commands don’t works

I don’t see why this was flagged.

2 Likes

I try to label my bots and command its not work

Can you show us some logs, maybe? :smiley:

I try to label my bot and command not work

Try using the regular " character

The one in phone keyboards use a different type which js doesn’t not recognize

What do you mean I did not understand you in what you said

bot.on("message", (message) => {
    if (message.author.bot) return;
    if (message.channel.type === "dm") return;

    if (message == < @$ {
            bot.user.id
        } > || message == < @!$ {
            bot.user.id
        } > ) {
        message.channel.send("Hey My Prefix Is!")
    }

    let messageArray = message.content.split(" ");
    let cmd = messageArray[0];
    let args = messageArray.slice(1);

    if (!message.content.startsWith(prefix)) return;

    let commandfile = bot.commands.get(cmd.slice(prefix.length));
    if (commandfile) commandfile.run(bot, message, args);
});

I took @code-alt’s formatted version and changed it to the main quotes.

1 Like

I have error your code

bot.on("message", (message) => {
    if (message.author.bot) return;
    if (message.channel.type === "dm") return;

    if (message <= @$ {
            bot.user.id
        } > || message <= @!$ {
            bot.user.id
        } > ) {
        message.channel.send("Hey My Prefix Is!")
    }

    let messageArray = message.content.split(" ");
    let cmd = messageArray[0];
    let args = messageArray.slice(1);

    if (!message.content.startsWith(prefix)) return;

    let commandfile = bot.commands.get(cmd.slice(prefix.length));
    if (commandfile) commandfile.run(bot, message, args);
 });

Try this

Don’t work

Can i ask what the @$ is for?

@bot
And bot say my prefix is