Team-Gigabyte / quotobot

Require template literals instead of string concatenation JS-0246
Anti-pattern
Minor
5 months ago3 years old
Unexpected string concatenation
152    else leagueText = "💬 Still trying to start the League API";
153    console.table({
154        "bot version": qbVersion, prefix,
155        "username": "@" + bot.user.username + "#" + bot.user.discriminator,156        "invite link": invText,
157        "status": `${prefix}help • ${helpDomain}`,
158        "server count": bot.guilds.cache.size,
Unexpected string concatenation
107        symbol) => new Discord.MessageEmbed()
108            .setTitle(`Current price for ${symbol.toUpperCase()} is \`${current.toFixed(2)}\``)
109            .setURL("https://finance.yahoo.com/quote/" + symbol)
110            .addField("High", "`" + high.toFixed(2) + "`", true)111            .addField("Low", "`" + low.toFixed(2) + "`", true)
112            .addField("Open", "`" + open.toFixed(2) + "`", true)
113            .addField("Previous Close", "`" + prevClose.toFixed(2) + "`", true)
Unexpected string concatenation
106    "stocks": ({ o: open, h: high, l: low, c: current, pc: prevClose, t: timestamp },
107        symbol) => new Discord.MessageEmbed()
108            .setTitle(`Current price for ${symbol.toUpperCase()} is \`${current.toFixed(2)}\``)
109            .setURL("https://finance.yahoo.com/quote/" + symbol)110            .addField("High", "`" + high.toFixed(2) + "`", true)
111            .addField("Low", "`" + low.toFixed(2) + "`", true)
112            .addField("Open", "`" + open.toFixed(2) + "`", true)
Unexpected string concatenation
 89        if (!code) {
 90            code = "";
 91        } else {
 92            code = "`" + code + "`"; 93        }
 94        return new Discord.MessageEmbed()
 95            .setColor("ff0000")
Unexpected string concatenation
384                        let { icon, description: cloudness } = jd.weather[0];
385                        let { id, name: displayCity, dt: timestamp } = jd;
386                        let { country } = jd.sys;
387                        country += cFlags.get(country).emoji ? " " + cFlags.get(country).emoji : "";388                        message.reply(embed.currWeather(currentTemp, maxTemp, minTemp, pressure, humidity, wind, cloudness, icon, author, displayCity, country, units, id, timestamp));
389                        // Adds the user to the set so that they can't get weather for some time
390                        usedWeatherRecently.add(message.author.id);