#help

1 messages · Page 1 of 1 (latest)

torn herald
#

@nocturne creek

nocturne creek
#

hello

torn herald
#

so show the code

#

again one last time

nocturne creek
#
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);  ```
torn herald
#

so what you need to do with it?

nocturne creek
#

right now

#

the code recognises ping

#

without a prefix

#

like it doesnt use a prefix

torn herald
#

just do ${prefix}ping instead

nocturne creek
#

like i want it to prefix everything

rustic badger
#
 if(message.content === `${prefix}ping`) {
   message.channel.send("pong")
  }
})
nocturne creek
#

will that work for all commands

torn herald
#

nope

nocturne creek
#

or do i have to do that for every single one

torn herald
#

yes, for every single command(is it hard?)

nocturne creek
#

where would i put this?

nocturne creek
rustic badger
nocturne creek
#

thank you it worked

torn herald
#

yes, learn the basics of js first

nocturne creek
#

this is my first project and im not the best at reading long things

#

thank you i will start

#

merry christmas to the both of you