#help
1 messages · Page 1 of 1 (latest)
hello
const express = require("express");
const app = express();
app.listen(3000, () => {
console.log("cmon lets go");
})
app.get("/", (req, res) => {
res.send("Hello world");
})
const prefix = '!';
const Discord = require("discord.js")
const client = new Discord.Client({intents: ["GUILDS","GUILD_MESSAGES"]});
client.on("message", message => {
if(message.content === "ping") {
message.channel.send("pong")
}
})
client.login(process.env.token); ```
so what you need to do with it?
right now
the code recognises ping
without a prefix
like it doesnt use a prefix
just do ${prefix}ping instead
if(message.content === `${prefix}ping`) {
message.channel.send("pong")
}
})
yeah,like this
will that work for all commands
nope
or do i have to do that for every single one
yes, for every single command(is it hard?)
where would i put this?
okok ty
https://javascript.info please read up before you ask questions like this
thank you it worked
thank you
will do
yes, learn the basics of js first