How To Develop Bot in Glitch Part 1 1

How To Develop Bot in Glitch Part 1

Creating a Discord Bot is a piece of cake 🙂

Developing a discord bot is a very easy task. Developing a bot for discord is aloso a fun task, i am saying this from my opinion, idk about yours but i am sure you will also feel same in future if you learn discord.js. Today i am going to Teach you about how to create a simple ping bot in glitch by js(Java Script).

Lets Begin With Creating Bot.

• First you need to go in Discord Developer Portal.

How To Develop Bot in Glitch Part 1 2
• Now click on new New Application Icon.

• You will see this tab after you click Button

How To Develop Bot in Glitch Part 1 3
• Type your bot name and click on create button after typing the name

• Now go to slide bar and click on Bot option

How To Develop Bot in Glitch Part 1 4

• Click on Add Bot Button.

How To Develop Bot in Glitch Part 1 5

• Now Go to side bar again and click on Auth.

• After than you will see check option. Check on Bot then scroll down

How To Develop Bot in Glitch Part 1 6

•After scrolling down you will see link. Copy it and open new tap paste it and invite your bot in your server.

How To Develop Bot in Glitch Part 1 7
Done!!

Lets Start Developing Bot.

• First you need to open glitch in your browser. Go to Glitch.com

• Now click on new Project

• After that you will see three option in tab, Choose Hello express.

• Now you will see these files, if you did things right.

How To Develop Bot in Glitch Part 1 8

• Go to server.js and paste this code.

const discord = require('discord.js');
const client = new discord.Client();

client.on('ready', message => {
  console.log('I am ready');
});

client.on('message',message => {
          if(message.content === '+ping') {
            message.channel.send('Hi, You pinged me?')
          } else if(message.isMemberMentioned(client.user)) {
                    message.channel.send('How can i help you, btw my prefix is +')
                    }
});

client.login('TOKEN');

• Go to Developer portal again, and go to bot tab by scroll bar and copy token.

• Now come back in glitch and replace Your Token with TOKEN

How To Develop Bot in Glitch Part 1 9

• Time to install discord.js package

• Go to Tools Option which is located down

• Click on Logs after clicking on Tools

How To Develop Bot in Glitch Part 1 10

• Click on logs

How To Develop Bot in Glitch Part 1 11
Click on console =>

• After clicking on console type npm install discord.js

How To Develop Bot in Glitch Part 1 12
npm install discord.js

• After this, Your bot is ready to go. Go to server where your bot is in and type the command which is +ping.

Video Support

SUPPORT

IF YOU HAD ANY PROBLEM RELATED TO GLITCH JOIN OUR SERVER FOR ANY SUPPORT – SUPPORT SERVER

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *