Offline Bot + Massive Error

Why is my bot offline? Why is there a massive error? What is wrong with my code?

Context: I am trying to make a Discord bot that would ping a certain role when another specific bot made a message with a specific phrase. I’m having to relearn Java Script.

How to make a Discord Bot Without Downloading Anything + Host it Online FOREVER - YouTube
I used the video above as a reference sometimes ^

Here is my code

const express = require("express");
const app = express()

app.listen(3000, () => {
  console.log("Project is running!")
})

app.get("/", (req, res) => {
  res.send("Balls");
})

const Discord = require('discord.js');
const client = new Discord.Client({intents: ["GUILDS", "GUILDED_MESSAGES"]});

client.on("message", message =>  {
  if(message.content ==="A wild countryball appeared!" & message.author.bot === true){
    message.channel.roleMention('Country Ball Ping')
  }
} )

Looks like you’re using code for an ancient version of discord.js. Use the guide to learn how to make discord bots (except store your token in secrets and not a config file)

2 Likes