Copy and Paste the following code into Lumia Stream.
async function() {
// Generate random number 1–100
const num = Math.floor(Math.random() * 100) + 1;
// Log number + user (optional)
log(`Random number pulled: ${num} by {{username}}`);
if (num > 50) {
chatbot({
message: `🎅 {{username}} is ${num}% naughty... Looks like someone's on the naughty list! 😈`
});
} else if (num < 50) {
chatbot({
message: `🎄 {{username}} is only ${num}% naughty! You're safe on the nice list... for now. 😇`
});
} else {
chatbot({
message: `🤔 {{username}} is 50% naughty... Santa is unsure what to do with you.`
});
}
done();
}