Open jaredlyon opened 3 years ago
The below code (also commented in checkstreaks.js in feature-1) was the original blueprint for the command, though this has been tested multiple times and does not work either:
var message = "**__Active Daily Streaks:__**\n*Does not include streaks that have expired.*\n";
function checkStreaks() {
bot.guilds.cache.get("399740385221672970").members.cache.forEach(async member => {
let streaks = (await bot.streaks.get(member.id)) || {};
if (streaks.streak && streaks.streak >= 1 && (new Date() - new Date(streaks.lastDaily) <= 172800000)) {
message += member.displayName + "\n";
}
});
}
await checkStreaks();
msg.channel.send(message);
The current code in feature-1:
returns:
Ideally, the code concatenates the results into one message, although all attempts to do so have failed.