42const helpDomain = envVars.QBSTATUS || configFile["help-domain"] || undefined;
43let helpMessage;
44// handle starting up the League API
45let leagueEnabled; 46try {
47 if (!envVars.QBRGKEY && !configFile.riotKey) {
48 throw new Error("The Riot key is falsy (usually undefined). Did you put a key?")
141 db.each(randQuoteQuery).then(
142 ({ quote, source }) => console.log(chalk`{blueBright "${quote}" –${source}}`)
143 )
144 let invText;145 if (configFile.clientID) {
146 invText = `https://discordapp.com/oauth2/authorize?client_id=${configFile.clientID}&scope=bot&permissions=${configFile.permissionValue.toString() || "280576"}`;
147 } else {
40 console.log("Your stock API key is falsy (usually undefined). Stock lookups will not work.")
41}
42const helpDomain = envVars.QBSTATUS || configFile["help-domain"] || undefined;
43let helpMessage; 44// handle starting up the League API
45let leagueEnabled;
46try {
147 } else {
148 invText = "Available in the Discord developer portal";
149 }
150 let leagueText;151 if (leagueEnabled === false) leagueText = "🚫 League commands will not work"
152 else if (leagueEnabled) leagueText = "✅";
153 else leagueText = "💬 Still trying to start the League API";
26}
27const authorPictures = require("./db/portraits.js");
28const authorWikis = require("./db/wikis.js")
29let token; 30if (configFile.token == "your-token-here-inside-these-quotes") {
31 token = envVars.QBTOKEN;
32} else if (!configFile.token) { token = envVars.QBTOKEN; }
In JavaScript, variables can be assigned during declaration, or at any point afterwards using an assignment statement. For example, in the following code, foo
is initialized during declaration, while bar
is initialized later.
var foo = 1;
var bar;
if (foo) {
bar = 1;
} else {
bar = 2;
}
function foo() {
var bar;
let baz;
}
function foo() {
var bar = 1;
let baz = 2;
const qux = 3;
}