Create Discord Bot in Glitch With V12 of Discord.js

As i am here with re creation discord.js with stable version of discord.js, There is few changes in discord.js v12 , So now i am gonna show you how to create discord bot using discord.js stable version.

Go to and create project and select Hellow express, Make sure your package.json look like this –

  "//1": "describes your app and its dependencies",
  "//2": "",
  "//3": "updating this file will download and update your packages",
  "name": "hello-express",
  "version": "0.0.1",
  "description": "A simple Node app built on Express, instantly up and running.",
  "main": "server.js",
  "scripts": {
    "start": "node server.js"
  "dependencies": {
    "express": "^4.17.1"
  "engines": {
    "node": "12.x"
  "repository": {
    "url": "!/hello-express"
  "license": "MIT",
  "keywords": [

Go to server.js and follow below steps 🙂

Lo>Logging in Discord

const Discord = require('discord.js'); //Needed discord.js module
const client = new Discord.Client(); //Creating Discord new client

client.once('ready', () => { //When bot is ready , bot will run given code
	console.log('Ready!'); //Sends Ready to console as message
  client.user.setActivity(`I am Devil`); //Sets bot activity as "I am Devil" 

client.login('your-token-goes-here'); //Paste Your Bot Token

It wont run until you install discord.js module from console, for that type npm i discord.js in glitch Terminal.

Re>Replying To User Message

client.on("message", message => { //when Someone message 
  if(message.content === "!ping") { //if message is same as !ping
    return`Pong ${}`); //it will return message

Thats how you can send message :), It will reply to message

Re>Resulting Code

Here is the resulting code –

Related Posts

Written by Senpai

"This may be a virtual world,but I feel more alive here then in the real world"

Leave a Reply

One Comment