316 if (authorWikis[source.trim()] !== null)
317 em.setAuthor("Click here for author's wiki", icons.quote, "https://en.wikipedia.org/wiki/" + encodeURIComponent(authorWikis[source.trim()]));
318 } else {
319 em.setAuthor("Click here for author's wiki", icons.quote, "https://en.wikipedia.org/wiki/" + encodeURIComponent(source.trim()));320 }
321 message.channel.send(em);
322 } catch (err) {
314 }
315 if (source.trim() in authorWikis) {
316 if (authorWikis[source.trim()] !== null)
317 em.setAuthor("Click here for author's wiki", icons.quote, "https://en.wikipedia.org/wiki/" + encodeURIComponent(authorWikis[source.trim()]));318 } else {
319 em.setAuthor("Click here for author's wiki", icons.quote, "https://en.wikipedia.org/wiki/" + encodeURIComponent(source.trim()));
320 }
265 if (authorWikis[source.trim()] !== null)
266 em.setAuthor("Click here for author's wiki", icons.quote, "https://en.wikipedia.org/wiki/" + encodeURIComponent(authorWikis[source.trim()]));
267 } else {
268 em.setAuthor("Click here for author's wiki", icons.quote, "https://en.wikipedia.org/wiki/" + encodeURIComponent(source.trim()));269 }
270 message.channel.send(em);
271 } catch (err) {
108 symbol) => new Discord.MessageEmbed()
109 .setTitle(`Current price for ${symbol.toUpperCase()} is \`${current.toFixed(2)}\``)
110 .setURL("https://finance.yahoo.com/quote/" + symbol)
111 .addField("High", "`" + high.toFixed(2) + "`", true)112 .addField("Low", "`" + low.toFixed(2) + "`", true)
113 .addField("Open", "`" + open.toFixed(2) + "`", true)
114 .addField("Previous Close", "`" + prevClose.toFixed(2) + "`", true)
90 if (!code) {
91 code = "";
92 } else {
93 code = "`" + code + "`"; 94 }
95 return new Discord.MessageEmbed()
96 .setColor("ff0000")
In ES2015 (ES6), we can use template literals instead of string concatenation.
var str = `Hello, ${name}!`;
var str = "Hello, " + name + "!";
var str = "Time: " + (12 * 60 * 60 * 1000);
var str = "Hello World!";
var str = `Hello, ${name}!`;
var str = `Time: ${12 * 60 * 60 * 1000}`;
var str = "Hello, " + "World!";