commit | 4f164f3adb44899a2dc93199d8750583ae4dae9f | [log] [tgz] |
---|---|---|
author | pineafan <pineapplefanyt@gmail.com> | Sat Feb 26 22:07:12 2022 +0000 |
committer | pineafan <pineapplefanyt@gmail.com> | Sat Feb 26 22:07:12 2022 +0000 |
tree | cb336cfe7ad3c23f71f6756d81c4ede1875cf5cc | |
parent | dd1155eb3de44d7c8dbf0d6b6cdb9b2064c29169 [diff] [blame] |
guess who forgot to add files
diff --git a/src/utils/getEmojiByName.ts b/src/utils/getEmojiByName.ts new file mode 100644 index 0000000..64c7ede --- /dev/null +++ b/src/utils/getEmojiByName.ts
@@ -0,0 +1,12 @@ +import emojis from '../config/emojis.json' assert {type: 'json'}; + +function getEmojiByName(name: string): string { + let split = name.split("."); + let id = emojis + split.forEach(part => { + id = id[part]; + }); + return `<:a:${id}>`; +} + +export default getEmojiByName;