dirigeants / klasa-pieces

MIT License
44 stars 55 forks source link

Add discordemoji cmd #195

Closed gc closed 5 years ago

gc commented 5 years ago

Fetches emojis listed on https://discordemoji.com/ has an optional "count" param

E.g. for 'thinking' emotes: +discordemoji thinking.

It randomly sorts them first so if theres 100+ thinking emojis, you dont get the same 4 ones each time.

gc commented 5 years ago

It's used here: https://github.com/dirigeants/klasa-pieces/blob/e3fadcf0db13cfe2b38cdaedfc19ac25e45a3bf0/commands/Tools/discordemoji.js#L18

The API returns every single emoji together, which is fetched once on init(), and then when the command is used, it searches that cached data.

Not sure what you mean by 'to the constructor', do it in the constructor instead of init?

kyranet commented 5 years ago

No, I meant to add this in the constructor, to avoid object shape transitions.

this.emojis = null;