Sleek
SIASapphire - Imagine a framework
•Created by Sleek on 12/13/2022 in #discordjs-support
My bot wont respond to my commands
Heres my code:
const express = require("express");
const app = express();
app.listen(3000,() => {
console.log("Project is running");
})
app.get("/",(req,res) => {
res.send("Hello world!");
})
const Discord = require("discord.js");
const client = new Discord.Client({intents: ["GUILDS", "GUILD_MESSAGES"]});
client.login(process.env.token);
client.on("ready", () => {
// Perform any necessary setup tasks here
});
client.on("messageCreate", message => {
if(message.content === "ping") {
message.channel.send("pong!");
} else if (message.content === "!hello") {
message.channel.send("Hello!");
}
});
13 replies