Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nicpwns/random-unicode-emoji

A simple JavaScript package that returns random Unicode emojis. ๐Ÿ“œ
https://github.com/nicpwns/random-unicode-emoji

discord discord-bot discord-js emoji javascript node nodejs npm npm-package npmjs random unicode unicode-characters

Last synced: 26 days ago
JSON representation

A simple JavaScript package that returns random Unicode emojis. ๐Ÿ“œ

Awesome Lists containing this project

README

        

# random-unicode-emoji

[![npm](https://img.shields.io/npm/v/random-unicode-emoji)](https://www.npmjs.com/package/random-unicode-emoji)
[![Unicode](https://img.shields.io/badge/Unicode-15.0-success)](https://www.unicode.org/Public/emoji/15.0/)
[![downloads](https://img.shields.io/npm/dw/random-unicode-emoji)](https://www.npmjs.com/package/random-unicode-emoji)
[![stars](https://img.shields.io/github/stars/NicPWNs/random-unicode-emoji)](https://github.com/NicPWNs/random-unicode-emoji/stargazers)
[![forks](https://img.shields.io/github/forks/NicPWNs/random-unicode-emoji.svg)](https://github.com/NicPWNs/random-unicode-emoji/forks)
[![repo size](https://img.shields.io/github/repo-size/NicPWNs/random-unicode-emoji)](https://github.com/NicPWNs/random-unicode-emoji)
[![issues](https://img.shields.io/github/issues/NicPWNs/random-unicode-emoji.svg)](https://github.com/NicPWNs/random-unicode-emoji/issues)

A simple JavaScript package that returns random Unicode emojis. ๐Ÿ“œ

> Like this repo? Give it a [โญ on GitHub!](https://github.com/NicPWNs/random-unicode-emoji)

## Install โœจ

```bash
npm install random-unicode-emoji
```

> No dependencies!

## Usage ๐Ÿ™

```js
// Require the module
var randomEmoji = require('random-unicode-emoji');

// Use the module
randomEmoji.random({count: 3});
// -> ["๐Ÿธ", "๐Ÿ‡", "๐Ÿšฃ"]

// Add custom emoji
randomEmoji.random({count: 3, custom: ['(ยฐ อœส– อกยฐ)','(โ•ฏยฐโ–กยฐ)โ•ฏ๏ธต โ”ปโ”โ”ป']});
// -> ["๐Ÿ”ฅ", "(ยฐ อœส– อกยฐ)", "โšพ"]
```

### Discord Bots

This package is very popular among Discord bots.
Below is an example of using the custom emoji feature to include custom Discord emojis.

```js
randomEmoji.random({count: 3, custom: message.guild.emojis.map()});
// -> ["๐Ÿคก", "<:HUH:1081269950800466059>", "๐Ÿ˜ธ"]
```

> `<:HUH:1081269950800466059>` translates to an emoji for a specific Discord guild.

## Update โ˜€๏ธ

```bash
npm update random-unicode-emoji
```

## Unicode

Uses Unicode Standard Emoji from [Unicode.org](https://www.unicode.org/Public/emoji/)

> Currently supports the latest [Unicode Standard Version 15.0](https://www.unicode.org/Public/emoji/15.0/)

## Language

This is the JavaScript ๐Ÿ“œ version. There is also a [Python ๐Ÿ](https://github.com/NicPWNs/random-unicode-emoji-py) and [Rust โš™๏ธ](https://github.com/NicPWNs/random-unicode-emoji-rs) version.

## Maintainer

[Nic Jones, (@NicPWNs)](https://github.com/NicPWNs)

## Credit

Originally created by [Pirijan, (@pketh)](https://github.com/pketh)