From b40ec385904f715e3b8077b06be25d9a4c0220ee Mon Sep 17 00:00:00 2001 From: Rico040 Date: Sun, 11 Aug 2024 17:20:39 +0000 Subject: [PATCH] deploy: 43796920b7f7367d71ee153f828bb182f92f915a --- freemoji/index.js | 4 ++-- freemoji/manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/freemoji/index.js b/freemoji/index.js index 8c7c020..03f8dff 100644 --- a/freemoji/index.js +++ b/freemoji/index.js @@ -1,3 +1,3 @@ -(function(s,e,r,i,u,c,h,j){"use strict";const g=r.findByProps("canUseEmojisEverywhere");var v=[i.instead("canUseEmojisEverywhere",g,function(){return!0}),i.instead("canUseAnimatedEmojis",g,function(){return!0})];const{getCustomEmojiById:E}=r.findByStoreName("EmojiStore"),{getGuildId:b}=r.findByStoreName("SelectedGuildStore"),R=//i;function w(t,n){const o=t.matchAll(//gi),d=[];for(const a of o){const f=E(a[2]);if(f.guildId!=b()||f.animated){t=t.replace(a[0],"");var l="webp";f.animated&&(l="gif"),e.storage.hyperlink===!0?d.push(`[${a[1]}](https://cdn.discordapp.com/emojis/${a[2]}.${l}?size=${n}&quality=lossless&name=${a[1]})`):d.push(`https://cdn.discordapp.com/emojis/${a[2]}.${l}?size=${n}`)}}return{newContent:t.trim(),extractedEmojis:d}}function y(t){if(!t.content.match(R)||!e.storage.forceMoji&&e.storage.haveNitro)return;const{newContent:n,extractedEmojis:o}=w(t.content,e.storage.emojiSize);t.content=n,o.length>0&&(e.storage.hyperlink===!0?t.content+=" "+o.join(" "):t.content+=` +(function(s,e,n,i,u,c,h,j){"use strict";const g=n.findByProps("canUseEmojisEverywhere");var v=[i.instead("canUseEmojisEverywhere",g,function(){return!0}),i.instead("canUseAnimatedEmojis",g,function(){return!0})];const{getCustomEmojiById:E}=n.findByStoreName("EmojiStore"),{getGuildId:b}=n.findByStoreName("SelectedGuildStore"),R=//i;function w(t,a){const o=t.matchAll(//gi),l=[];for(const r of o){const f=E(r[2]);if(f.guildId!=b()||f.animated){t=t.replace(r[0],"");var d="webp";f.animated&&(d="gif"),e.storage.hyperlink===!0?l.push(`[${r[1]}](https://cdn.discordapp.com/emojis/${r[2]}.${d}?size=${a}&quality=lossless&name=${r[1]})`):l.push(`https://cdn.discordapp.com/emojis/${r[2]}.${d}?size=${a}&quality=lossless&name=${r[1]}`)}}return{newContent:t.trim(),extractedEmojis:l}}function y(t){if(!t.content.match(R)||!e.storage.forceMoji&&e.storage.haveNitro)return;const{newContent:a,extractedEmojis:o}=w(t.content,e.storage.emojiSize);t.content=a,o.length>0&&(e.storage.hyperlink===!0?t.content+=" "+o.join(" "):t.content+=` `+o.join(` -`)),t.invalidEmojis=[]}const z=r.findByProps("sendMessage","receiveMessage"),F=r.findByProps("uploadLocalFiles");var $=[i.before("sendMessage",z,function(t){return y(t[1])}),i.before("uploadLocalFiles",F,function(t){return y(t[0].parsedMessage)})];const{FormSection:m,FormRadioRow:k,FormSwitchRow:S}=c.Forms,p={Tiny:16,Small:32,Medium:48,Large:64,Huge:96,Jumbo:128},B="https://cdn.discordapp.com/emojis/926602689213767680.webp";function M(){return h.useProxy(e.storage),React.createElement(u.ReactNative.ScrollView,{style:{flex:1},contentContainerStyle:{paddingBottom:38}},React.createElement(m,{title:"Settings",titleStyleType:"no_border"},React.createElement(S,{label:"Hyperlink emoji",subLabel:"Hyperlinks emoji link to be less distractive",leading:React.createElement(c.Forms.FormIcon,{source:j.getAssetIDByName("ic_link")}),value:e.storage.hyperlink,onValueChange:function(){e.storage.hyperlink=!e.storage.hyperlink},note:""}),React.createElement(S,{label:"Force Freemoji",subLabel:"Explicitly force Freemoji even if you have nitro (useful for testing)",leading:React.createElement(c.Forms.FormIcon,{source:j.getAssetIDByName("img_nitro_emojis")}),value:e.storage.forceMoji,onValueChange:function(){e.storage.forceMoji=!e.storage.forceMoji},note:""})),React.createElement(m,{title:"Emoji Size"},Object.entries(p).map(function(t){let[n,o]=t;return React.createElement(k,{label:n,subLabel:o,selected:e.storage.emojiSize===o,onPress:function(){e.storage.emojiSize=o}})})),React.createElement(m,{title:"Preview"},React.createElement(u.ReactNative.Image,{source:{uri:`${B}?size=${e.storage.emojiSize}`,width:e.storage.emojiSize,height:e.storage.emojiSize}})))}e.storage.emojiSize??=48,e.storage.hyperlink??=!0,e.storage.haveNitro??=r.findByStoreName("UserStore").getCurrentUser()?.premiumType!==null,e.storage.forceMoji??=!1,typeof e.storage.emojiSize=="string"&&(e.storage.emojiSize=parseInt(e.storage.emojiSize));const I=[...v,...$],N=function(){return I.forEach(function(t){return t()})};return s.onUnload=N,s.settings=M,s})({},vendetta.plugin,vendetta.metro,vendetta.patcher,vendetta.metro.common,vendetta.ui.components,vendetta.storage,vendetta.ui.assets); +`)),t.invalidEmojis=[]}const z=n.findByProps("sendMessage","receiveMessage"),$=n.findByProps("uploadLocalFiles");var F=[i.before("sendMessage",z,function(t){return y(t[1])}),i.before("uploadLocalFiles",$,function(t){return y(t[0].parsedMessage)})];const{FormSection:m,FormRadioRow:B,FormSwitchRow:S}=c.Forms,k={Tiny:16,Small:32,Medium:48,Big:56,Large:64,Huge:96,Jumbo:128},p="https://cdn.discordapp.com/emojis/926602689213767680.webp";function M(){return h.useProxy(e.storage),React.createElement(u.ReactNative.ScrollView,{style:{flex:1},contentContainerStyle:{paddingBottom:38}},React.createElement(m,{title:"Settings",titleStyleType:"no_border"},React.createElement(S,{label:"Hyperlink emoji",subLabel:"Hyperlinks emoji link to be less distractive",leading:React.createElement(c.Forms.FormIcon,{source:j.getAssetIDByName("ic_link")}),value:e.storage.hyperlink,onValueChange:function(){e.storage.hyperlink=!e.storage.hyperlink},note:""}),React.createElement(S,{label:"Force Freemoji",subLabel:"Explicitly force Freemoji even if you have nitro (useful for testing)",leading:React.createElement(c.Forms.FormIcon,{source:j.getAssetIDByName("img_nitro_emojis")}),value:e.storage.forceMoji,onValueChange:function(){e.storage.forceMoji=!e.storage.forceMoji},note:""})),React.createElement(m,{title:"Emoji Size"},Object.entries(k).map(function(t){let[a,o]=t;return React.createElement(B,{label:a,subLabel:o,selected:e.storage.emojiSize===o,onPress:function(){e.storage.emojiSize=o}})})),React.createElement(m,{title:"Preview"},React.createElement(u.ReactNative.Image,{source:{uri:`${p}?size=${e.storage.emojiSize}`,width:e.storage.emojiSize,height:e.storage.emojiSize}})))}e.storage.emojiSize??=48,e.storage.hyperlink??=!0,e.storage.haveNitro??=n.findByStoreName("UserStore").getCurrentUser()?.premiumType!==null,e.storage.forceMoji??=!1,typeof e.storage.emojiSize=="string"&&(e.storage.emojiSize=parseInt(e.storage.emojiSize));const I=[...v,...F],N=function(){return I.forEach(function(t){return t()})};return s.onUnload=N,s.settings=M,s})({},vendetta.plugin,vendetta.metro,vendetta.patcher,vendetta.metro.common,vendetta.ui.components,vendetta.storage,vendetta.ui.assets); diff --git a/freemoji/manifest.json b/freemoji/manifest.json index 1981308..3e7b746 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":"818b8e8df2f7bb6dd2b163307a8352adc5a3fb016920db89db1ca81d9a09a668"} \ 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":"d94507a91ab847710485989a9a6c8f8c84ad77387c8315f67b25aa89be7fd1c7"} \ No newline at end of file