]> git.lizzy.rs Git - furrybot-discord.git/commitdiff
Add emojify command
authorElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 6 Mar 2022 14:51:32 +0000 (15:51 +0100)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 6 Mar 2022 14:51:32 +0000 (15:51 +0100)
http.js

diff --git a/http.js b/http.js
index 4572419c000b722a502d173dbe3e2736a0b839b1..f30ed6b822392968f3102dd4208afae51423898c 100644 (file)
--- a/http.js
+++ b/http.js
@@ -81,5 +81,21 @@ module.exports = {
                func: msg => fetch("https://8ball.delegator.com/magic/JSON/whatever")
                        .then(res => res.json())
                        .then(data => msg.reply(data.magic.answer))
+       },
+       emojify: {
+               func: (msg, text) => fetch("https://api.emojify.net/convert", {
+                               method: "POST",
+                               headers: {
+                                       "Accept": "application/json",
+                                       "Content-Type": "application/json",
+                               },
+                               body: JSON.stringify({
+                                       density: 100,
+                                       input: text.join(" "),
+                                       shouldFilterEmojis: false,
+                               }),
+                       })
+                               .then(res => res.json())
+                               .then(data => msg.reply(data.result))
        }
 }