Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

load a config file discordjs

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

const bot = Discord.Client();
// config.json 
// {"token": "Your token!"}
// Make sure you saved it in the root directory
// with your main script.
const config = require('./config.json');
const token = config.token;

bot.once('ready', () => {
	console.log('Online!');
})

bot.login(token);
 
PREVIOUS NEXT
Tagged: #load #config #file #discordjs
ADD COMMENT
Topic
Name
2+9 =