install discord js

Solutions on MaxInterview for install discord js by the best coders in the world

showing results for - "install discord js"
Erika
19 Jan 2019
1npm install discord.js
Roberta
13 Apr 2020
1$ npm install discord.js@latest
Eric
10 Jun 2020
1/* If you are a mac user, do this in TERMINAL
2If you are a Window/Linux user, do this in COMMAND PROMPT
3
4npm install discord.js 
5
6DISCORD.JS IS NOW INSTALLED.
7I suggest looking on youtube for a tutorial on setting up a project, but here are the basics.
8
9
10THIS CODE SHOULD BE IN A "index.js" or "main.js" or whatever your main file is.*/
11
12const Discord = require('discord.js');
13const client - new Discord.Client();
14const /*you can have any prefix you want here*/ prefix = "?"
15
16client.on("ready", () => {
17	console.log('literally anything you want goes here')
18})
19
20//SUPER BASIC COMMAND: BASICALLY SHOWS THAT YOUR BOT CAN SPEAK
21client.on('message', message => {
22	if(message.content.startsWith(`${prefix}ping`)){
23    	message.channel.send('pong!');
24    }
25})
26
27
28//EXTREMELY IMPORTANT: GET YOUR TOKEN FROM THE DISCORD DEVELOPER PORTAL
29//NEVER EVER EVER EVER TELL/GIVE ANYONE YOUR TOKEN!
30client.login('your token here');