ZemPosts ZemPosts

How to Create a Discord Bot?

1 min read

How to Code a Discord bot?

💻STEP 1 - Setting up your workspace:

😃Step 2 - Add the Code:

const express = require('express')
const Discord = require('discord.js')
const app = express();

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

const client = new Discord.Client({ intents: 32767 }) 

client.on('messageCreate', async (message) => {
  if (message.content === "hi") {
    message.channel.send('helllo')
  }
})

client.login('YOUR BOT TOKEN HERE')

🥇Step 3 - Running your project