discord-memoji
Version:
Memoji is a discord npm package that allows you to manage every emotes/emojis on your server in an easy and efficient way.
80 lines (78 loc) • 3.02 kB
Markdown
# discord-memoji [](https://www.npmjs.com/package/discord-memoji)
> **A npm package to manage easily server's emojis.**
# Usage
#### Initialization
You have to install [discord.js](https://npmjs.com/package/discord.js) version including v12.
*This structure is necessary in order for the package to work.*
```js
const {
Client,
Structures
} = require('discord.js')
require('discord-memoji')(Structures);
const client = new Client();
```
#### Show Emoji's URL with Message Listener
> The structure of our functions is made with "**Guild**" class so be sure to use it. Then, our functions will just do the job for you !
```js
client.on('message', message => {
if (message.content.startsWith("!emojishow")) {
let emoji = message.content.split(" ").slice(1)
message.reply(message.guild.emojiShow(emoji))
}
})
```
#### Add Emoji with Message Listener
> Parameter `image` only works with image links and not files at the moment.
```js
client.on('message', message => {
if (message.content.startsWith("!emojiadd")) {
let args = message.content.split(" ")
let name = args[1]
let image = args[2]
console.log(image)
message.guild.emojiAdd(name, image);
}
})
```
#### All of This (Full Example)
```js
const {
Client,
Structures
} = require('discord.js')
require('discord-memoji')(Structures);
const client = new Client();
client.on('message', message => {
if (message.content.startsWith("!emojishow")) {
let emoji = message.content.split(" ").slice(1)
message.reply(message.guild.emojiShow(emoji))
}
if (message.content.startsWith("!emojiadd")) {
let args = message.content.split(" ")
let name = args[1]
let image = args[2]
console.log(image)
message.guild.emojiAdd(name, image);
}
})
client.login('YOUR_CLIENT_TOKEN');
```
# Install
`npm install discord-memoji`
# Changelog
> ## **1.1.0**
> * Adding guild.\<functions\> extension according with [Discord.js](https://www.npmjs.com/package/discord.js).
> * Adding [colors](https://www.npmjs.com/package/colors) package.
> * Adding emojiShow function.
> * Adding emojiAdd function.
# Credits
* Nyrok :
- [Github](https://github.com/Nyrok) 
- [Twitter](https://twitter.com/@Nyrok10) 
* Plattyz :
- [Github](https://github.com/Plattyz) 
- [Twitter](https://twitter.com/@0x4d6f6b6d69) 
> Don't forget to Star this open-source repo ! 
# License
Apache-2.0