How to use the random function from node-emoji

Find comprehensive JavaScript node-emoji.random code examples handpicked from public code repositorys.

54
55
56
57
58
59
60
61
62
var emoji = require('node-emoji');


// Display an emoji picked randomly
controller.hears(['random'], 'direct_message,direct_mention', function (bot, message) {
    var random = emoji.random();
    var email = message.user; // Spark User that created the message orginally 
    bot.reply(message, "hey <@personEmail:" + email + ">, type `:" + random.key + ":` to get " + random.emoji);
});
fork icon47
star icon2
watch icon2

9
10
11
12
13
14
15
16
17
18
19
20
// just for testing
const createEmojiWorld = emojiCount => {
  let map = '';


  for (let i = 0; i <= emojiCount; i++) {
    const item = emoji.random();
    map += item.emoji;
  }


  return map;
fork icon0
star icon0
watch icon0