How do I code a discord bot?

Hello! Am a bot developer and am trying to use glitch today for making a bot!
Does anyone know what I do? :lying_face:

1 Like

Ah yes someone who doesn’t want to be spoonfeeded.

First things, first, let’s start up with a Express project which is the second app template. Click on that to create your project (hit new project)

Then go into the terminal by going into tools > terminal (tools are at the bottom left)

then copy/paste these commands and hit enter when they are done to do another command

rm -rf views
npm i discord.js

Now type in refresh in the terminal and wait. Then close it. You can now require discord.js and code your bot. You can delete some of the default code, too.

If I help you and this is a solution then please mark it as one near this reply :slight_smile:

1 Like

Hi! We can’t spoonfeed you on how to make a bot, but the awesome people at have made a very detailed yet simple tutorial on how to get started and they even show you how to make some commands!


If you want to write a bot from scratch for free on Glitch, you can remix this starter project A new Discord bot starter, no pinging needed (of mine, full disclosure). There aren’t any tutorials for how to do anything this way, so you’d have to read the reference materials on the Discord gateway and Eris’s REST APIs.

Or you could write a bot using an existing library, in which case there are many tutorials. If you do it this way, when it comes time to run the bot, you can either buy a Glitch membership or export it to another hosting service.


@isuwu! That breaks the Glitch ToS!

And you should take a day to learn about variables, and three to learn about JavaScript.

lol ik its a joke