Team-Gigabyte / quotobot

Either all code paths should have explicit returns, or none of them JS-0045
Anti-pattern
Minor
5 months ago3 years old
Expected to return a value at the end of async arrow function
410            if (usedStocksRecently.has(message.author.id)) {
411                message.reply(embed.error(`You need to wait ${timeout / 1000} seconds before asking for stocks again.`, "ERR_RATE_LIMIT", "Slow down!"));
412            } else {
413                (async () => {414                    if (!stocksEnabled) {
415                        message.reply(embed.error("Stock lookup isn't currently working. Sorry about that.", "ERR_NO_STOCK_KEY"));
416                        return null;
Async arrow function expected no return value
362                    let city = !(["metric", "imperial"].includes(norm(args[0]))) ? args.slice(0).join(" ") : args.slice(1).join(" ");
363                    if (!city) {
364                        message.reply(embed.error("You didn't include a city name. Re-run the command with the city name.", `args: ${args.toString()}`));
365                        return null;366                    }
367                    let windUnits = units == "imperial" ? "mph" : "m/s";
368
Arrow function expected no return value
225        case "amiadmin":
226            if (!message.member) return message.reply("Trick question.");
227            if (!message.member.hasPermission("ADMINISTRATOR")) return message.reply("you're not admin!");
228            else return message.reply("you are admin!");229        case "testdm":
230            message.author.send("Looks like the DM worked! You can send commands in here.")
231                .catch(error => {
Expected to return a value at the end of async arrow function
466                message.reply(embed.error("You didn't include any arguments. Re-run the command with the summoner name."));
467                return;
468            }
469            (async () => {470                let reg = "NA";
471
472                if (args[1]) {
Expected to return a value at the end of arrow function
549                    const mbed = new Discord.MessageEmbed()
550                        .setColor(6765239)
551                        .setTitle("Spell Check");
552                    items.some(({ fragment, suggestions }) => {553                        let addition = `~~${fragment}~~ → **${suggestions.join("**, **") || "No suggestions"} **\n`;
554                        if (desc.length + addition.length > 2000) {
555                            mbed.setFooter("This spellcheck has been shortened.");