#here
1 messages · Page 1 of 1 (latest)
oh ok
const app = express();
app.listen(3000, () => {
console.log("Project is running!");
})
app.get("/", (req, res) => {
res.send("THE BOT IS RUNNING!");
})
const Discord = require("discord.js");
const client = new Discord.Client({ intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES] });
//text commands
client.on("message", message => {
if(message.content === "H!botStatus"){
message.channel.send("Online")
}
})
client.on("message", message => {
if(message.content === "H!region"){
message.channel.send("Team Hydro is based in OCE, but we will hapily accept all regions!")
}
})
client.on("message", message => {
if(message.content === "H!join"){
message.channel.send("Read #how-to-join for the requirements and expectations to join!")
}
})
client.on("message", message => {
if(message.content === "H!owner"){
message.channel.send("The owner of Team Hydro is @Christian!#9204 (*Team Hydro is co-owned by @wavesAU#1234* ) ")
}
})
client.on("message", message => {
if(message.content === "H!author"){
message.channel.send("This Bot was coded by @wavesAU#1234")
}
})
client.on("message", message => {
if(message.content === "H!english"){
message.channel.send("This server is an ENGLISH ONLY SERVER!")
}
})
client.on("message", message => {
if(message.content === "H!games"){
message.channel.send("This is a Fortnite Clan (But we might add other games soon!)")
}
})
//mute
const mutedRole = message.guild.roles.cache.get('928417599954505759')
const target = message.mentions.members.first();
if(message.content.startsWith("H!mute ")){
target.roles.add(mutedRole);
}
client.login(process.env.token);```
im begging you please https://www.w3schools.com/js/
for the sake of everyone , please put all your message events in ONE event
oki
you haven't defined message, and so js has no way of knowing what you want to do. the client object contains what you're looking for
its an object that basically is your bot as a variable
const express = require("express");
const app = express();
app.listen(3000, () => {
console.log("Project is running!");
})
app.get("/", (req, res) => {
res.send("THE BOT IS RUNNING!");
})
const Discord = require("discord.js");
const client = new Discord.Client({ intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES] });
//text commands
client.on("messageCreate", message => {
if (message.content === "H!botStatus") {
message.channel.send("Online")
}
if (message.content === "H!region") {
message.channel.send("Team Hydro is based in OCE, but we will hapily accept all regions!")
}
if (message.content === "H!join") {
message.channel.send("Read #how-to-join for the requirements and expectations to join!")
}
if (message.content === "H!owner") {
message.channel.send("The owner of Team Hydro is @Christian!#9204 (*Team Hydro is co-owned by @wavesAU#1234* ) ")
}
if (message.content === "H!author") {
message.channel.send("This Bot was coded by @wavesAU#1234")
}
if (message.content === "H!english") {
message.channel.send("This server is an ENGLISH ONLY SERVER!")
}
if (message.content === "H!games") {
message.channel.send("This is a Fortnite Clan (But we might add other games soon!)")
}
if (message.content.startsWith("H!mute ")) {
const mutedRole = message.guild.roles.cache.get('928417599954505759')
const target = message.mentions.members.first();
target.roles.add(mutedRole);
}
})
client.login(process.env.token);
switch exists