diff --git a/freemoji/index.js b/freemoji/index.js index 6c08254..e5583ce 100644 --- a/freemoji/index.js +++ b/freemoji/index.js @@ -1,3 +1,3 @@ -(function(a,o,r,d,m,p,E){"use strict";const u=[];function l(e,n,t){return function(){try{return t.apply(this,arguments)}catch(i){console.error(`Error while running ${e} callback for ${n}:`,i)}}}const f=function(e,n,t,i){u.push(d.before(e,n,l("before",e,t),i))},j=function(e,n,t,i){u.push(d.instead(e,n,l("instead",e,t),i))},g=r.findByProps("canUseEmojisEverywhere");var y=[j("canUseEmojisEverywhere",g,function(){return!0}),j("canUseAnimatedEmojis",g,function(){return!0})];const{getCustomEmojiById:v}=r.findByStoreName("EmojiStore"),{getGuildId:z}=r.findByStoreName("SelectedGuildStore"),w=//i;function b(e,n){const t=e.matchAll(//gi),i=[];for(const s of t){const c=v(s[2]);(c.guildId!=z()||c.animated)&&(e=e.replace(s[0],""),c.animated?i.push(`https://cdn.discordapp.com/emojis/${s[2]}.gif?size=${n}`):i.push(`https://cdn.discordapp.com/emojis/${s[2]}.webp?size=${n}`))}return{newContent:e.trim(),extractedEmojis:i}}function S(e){if(!e.content.match(w))return;const{newContent:n,extractedEmojis:t}=b(e.content,o.storage.emojiSize);e.content=n,t.length>0&&(e.content+=` +(function(a,n,r,c,m,g,S){"use strict";const u=r.findByProps("canUseEmojisEverywhere");var h=[c.instead("canUseEmojisEverywhere",u,function(){return!0}),c.instead("canUseAnimatedEmojis",u,function(){return!0})];const p=[];function E(e,o,t){return function(){try{return t.apply(this,arguments)}catch(i){console.error(`Error while running ${e} callback for ${o}:`,i)}}}const l=function(e,o,t,i){p.push(c.before(e,o,E("before",e,t),i))},{getCustomEmojiById:y}=r.findByStoreName("EmojiStore"),{getGuildId:v}=r.findByStoreName("SelectedGuildStore"),z=//i;function w(e,o){const t=e.matchAll(//gi),i=[];for(const s of t){const d=y(s[2]);(d.guildId!=v()||d.animated)&&(e=e.replace(s[0],""),d.animated?i.push(`https://cdn.discordapp.com/emojis/${s[2]}.gif?size=${o}`):i.push(`https://cdn.discordapp.com/emojis/${s[2]}.webp?size=${o}`))}return{newContent:e.trim(),extractedEmojis:i}}function f(e){if(!e.content.match(z))return;const{newContent:o,extractedEmojis:t}=w(e.content,n.storage.emojiSize);e.content=o,t.length>0&&(e.content+=` `+t.join(` -`)),e.invalidEmojis=[]}const $=r.findByProps("sendMessage","receiveMessage"),R=r.findByProps("uploadLocalFiles");var B=[f("sendMessage",$,function(e){return S(e[1])}),f("uploadLocalFiles",R,function(e){return S(e[0].parsedMessage)})];const{FormSection:h,FormRadioRow:P}=p.Forms,F={Tiny:16,Small:32,Medium:48,Large:64,Huge:96,Jumbo:128},I="https://cdn.discordapp.com/emojis/926602689213767680.webp";function M(){return E.useProxy(o.storage),React.createElement(m.ReactNative.ScrollView,{style:{flex:1},contentContainerStyle:{paddingBottom:38}},React.createElement(h,{title:"Emoji Size",titleStyleType:"no_border"},Object.entries(F).map(function(e){let[n,t]=e;return React.createElement(P,{label:n,subLabel:t,selected:o.storage.emojiSize===t,onPress:function(){o.storage.emojiSize=t}})})),React.createElement(h,{title:"Preview"},React.createElement(m.ReactNative.Image,{source:{uri:`${I}?size=${o.storage.emojiSize}`,width:o.storage.emojiSize,height:o.storage.emojiSize}})))}o.storage.emojiSize??=48,typeof o.storage.emojiSize=="string"&&(o.storage.emojiSize=parseInt(o.storage.emojiSize));const U=[...y,...B],C=function(){return U.forEach(function(e){return e()})};return a.onUnload=C,a.settings=M,a})({},vendetta.plugin,vendetta.metro,vendetta.patcher,vendetta.metro.common,vendetta.ui.components,vendetta.storage); +`)),e.invalidEmojis=[]}const b=r.findByProps("sendMessage","receiveMessage"),$=r.findByProps("uploadLocalFiles");var R=[l("sendMessage",b,function(e){return f(e[1])}),l("uploadLocalFiles",$,function(e){return f(e[0].parsedMessage)})];const{FormSection:j,FormRadioRow:B}=g.Forms,P={Tiny:16,Small:32,Medium:48,Large:64,Huge:96,Jumbo:128},F="https://cdn.discordapp.com/emojis/926602689213767680.webp";function I(){return S.useProxy(n.storage),React.createElement(m.ReactNative.ScrollView,{style:{flex:1},contentContainerStyle:{paddingBottom:38}},React.createElement(j,{title:"Emoji Size",titleStyleType:"no_border"},Object.entries(P).map(function(e){let[o,t]=e;return React.createElement(B,{label:o,subLabel:t,selected:n.storage.emojiSize===t,onPress:function(){n.storage.emojiSize=t}})})),React.createElement(j,{title:"Preview"},React.createElement(m.ReactNative.Image,{source:{uri:`${F}?size=${n.storage.emojiSize}`,width:n.storage.emojiSize,height:n.storage.emojiSize}})))}n.storage.emojiSize??=48,typeof n.storage.emojiSize=="string"&&(n.storage.emojiSize=parseInt(n.storage.emojiSize));const M=[...h,...R],U=function(){return M.forEach(function(e){return e()})};return a.onUnload=U,a.settings=I,a})({},vendetta.plugin,vendetta.metro,vendetta.patcher,vendetta.metro.common,vendetta.ui.components,vendetta.storage); diff --git a/freemoji/manifest.json b/freemoji/manifest.json index eae9699..e18f884 100644 --- a/freemoji/manifest.json +++ b/freemoji/manifest.json @@ -1 +1 @@ -{"name":"Freemoji","description":"Allows you to use Nitro emoji without Nitro.","authors":[{"name":"maisy","id":"257109471589957632"},{"name":"Rico040","id":"619474349845643275"}],"main":"index.js","vendetta":{"icon":"img_nitro_emojis"},"hash":"e8cfc310b3dc1ee8991dbbfc30f6794275bb039b134e407824f8b8c7e9bb3a8b"} \ No newline at end of file +{"name":"Freemoji","description":"Allows you to use Nitro emoji without Nitro.","authors":[{"name":"maisy","id":"257109471589957632"},{"name":"Rico040","id":"619474349845643275"}],"main":"index.js","vendetta":{"icon":"img_nitro_emojis"},"hash":"7d8a0ddf47d5b1080b1878f38cc97f8e594f4b8f6f03f3185d6efcf73912f898"} \ No newline at end of file