From ab3774cf095315492a5d5cb1507b324c499b0acd Mon Sep 17 00:00:00 2001 From: Rico040 Date: Thu, 4 Jul 2024 03:57:21 +0000 Subject: [PATCH] deploy: e2f9b911bb9f19edac8378b61f32010e189fbc2b --- always-animate/index.js | 2 +- always-animate/manifest.json | 2 +- bf-eval/index.js | 2 +- bf-eval/manifest.json | 2 +- bluequote/index.js | 2 +- bluequote/manifest.json | 2 +- dislate/index.js | 2 +- dislate/manifest.json | 2 +- freemoji/index.js | 4 ++-- freemoji/manifest.json | 2 +- hideappbutton/index.js | 2 +- hideappbutton/manifest.json | 2 +- picture-links/index.js | 2 +- picture-links/manifest.json | 2 +- sticker-utils/index.js | 2 +- sticker-utils/manifest.json | 2 +- userbg/index.js | 2 +- userbg/manifest.json | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/always-animate/index.js b/always-animate/index.js index ea75500..90946a6 100644 --- a/always-animate/index.js +++ b/always-animate/index.js @@ -1 +1 @@ -(function(d,a,o,p){"use strict";const v=o.findByProps("getStatusSize"),y=o.findByName("DisplayBanner",!1),l=o.findByProps("getAvatarDecorationURL","default"),g=o.findByName("RowManager"),t=[],m=function(){if(typeof o.findByName("GuildIcon").prototype.render<"u"){const n=o.findByName("GuildIcon");t.push(a.before("render",n.prototype,function(){this.props.animate=!0}))}else{const n=o.findByName("GuildIcon",!1);t.push(a.before("default",n,function(e){let[i]=e;i.animate=!0}))}t.push(a.before("type",v.default,function(n){let[e]=n;e.animate=!0})),t.push(a.after("default",y,function(n,e){var i,r;const f=p.findInReactTree(e,function(u){return u.accessibilityRole=="image"&&u.onPress!=null}),s=p.findInReactTree(f,function(u){var c;return((c=u.type)===null||c===void 0?void 0:c.name)=="ProfileBanner"});s&&s.key.endsWith("-false")&&((r=s.props.bannerSource)===null||r===void 0||(i=r.uri)===null||i===void 0?void 0:i.indexOf("/a_"))>-1&&f.onPress()})),t.push(a.before("getAvatarDecorationURL",l,function(n){let[e]=n;e.canAnimate=!0})),t.push(a.before("getUserAvatarURL",l,function(n){n[1]=!0})),t.push(a.before("getGuildMemberAvatarURLSimple",l,function(n){let[e]=n;e.canAnimate=!0})),t.push(a.after("generate",g.prototype,function(n,e){let[i]=n;var r;if(i.rowType!==1)return;const{message:f}=e;((r=f.avatarURL)===null||r===void 0?void 0:r.indexOf("a_"))>-1&&(f.avatarURL=f.avatarURL.replace(".webp",".gif"))}))},R=function(){for(const n of t)n?.()};return d.onLoad=m,d.onUnload=R,d})({},vendetta.patcher,vendetta.metro,vendetta.utils); +(function(u,a,o,d){"use strict";const c=o.findByProps("getStatusSize"),l=o.findByName("DisplayBanner",!1),s=o.findByProps("getAvatarDecorationURL","default"),p=o.findByName("RowManager"),t=[],y=function(){if(typeof o.findByName("GuildIcon").prototype.render<"u"){const e=o.findByName("GuildIcon");t.push(a.before("render",e.prototype,function(){this.props.animate=!0}))}else{const e=o.findByName("GuildIcon",!1);t.push(a.before("default",e,function(n){let[f]=n;f.animate=!0}))}t.push(a.before("type",c.default,function(e){let[n]=e;n.animate=!0})),t.push(a.after("default",l,function(e,n){const f=d.findInReactTree(n,function(r){return r.accessibilityRole=="image"&&r.onPress!=null}),i=d.findInReactTree(f,function(r){return r.type?.name=="ProfileBanner"});i&&i.key.endsWith("-false")&&i.props.bannerSource?.uri?.indexOf("/a_")>-1&&f.onPress()})),t.push(a.before("getAvatarDecorationURL",s,function(e){let[n]=e;n.canAnimate=!0})),t.push(a.before("getUserAvatarURL",s,function(e){e[1]=!0})),t.push(a.before("getGuildMemberAvatarURLSimple",s,function(e){let[n]=e;n.canAnimate=!0})),t.push(a.after("generate",p.prototype,function(e,n){let[f]=e;if(f.rowType!==1)return;const{message:i}=n;i.avatarURL?.indexOf("a_")>-1&&(i.avatarURL=i.avatarURL.replace(".webp",".gif"))}))},m=function(){for(const e of t)e?.()};return u.onLoad=y,u.onUnload=m,u})({},vendetta.patcher,vendetta.metro,vendetta.utils); diff --git a/always-animate/manifest.json b/always-animate/manifest.json index bd9b2e5..00f1c0a 100644 --- a/always-animate/manifest.json +++ b/always-animate/manifest.json @@ -1 +1 @@ -{"name":"Always Animate","description":"Always animates guild icons and avatars.","authors":[{"name":"Cynosphere","id":"150745989836308480"},{"name":"Rico040","id":"619474349845643275"}],"main":"index.js","vendetta":{"icon":"icon-qs-gifs"},"hash":"b9671c1da2e84cf661efc7155b17b1aa84e57c609a26c1fd84b81ae06536d0cc"} \ No newline at end of file +{"name":"Always Animate","description":"Always animates guild icons and avatars.","authors":[{"name":"Cynosphere","id":"150745989836308480"},{"name":"Rico040","id":"619474349845643275"}],"main":"index.js","vendetta":{"icon":"icon-qs-gifs"},"hash":"5f1d9cd141af954fc7236dd90205a8ad3ad02de706622af605bc39bf2a658d90"} \ No newline at end of file diff --git a/bf-eval/index.js b/bf-eval/index.js index 58bf125..cf6eb0e 100644 --- a/bf-eval/index.js +++ b/bf-eval/index.js @@ -1 +1 @@ -(function(o,c,f){"use strict";function p(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function u(n,e){for(var i=0;i1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:3e4;if(p(this,n),!e)throw new Error("No program to interpret.");this.program=e,this.input=i,this.size=t,this.array=new Array(t).fill(0),this.p=0,this.i=0,this.done=!1,this.events={},this.loops={},this.mod=function(a,s){return s+=1,(a%s+s)%s}}return d(n,[{key:"on",value:function(e,i){this.events[e]||(this.events[e]=[]),this.events[e].push(i)}},{key:"emit",value:function(e){for(var i=arguments.length,t=new Array(i>1?i-1:0),a=1;a":this.p++,this.p=this.mod(this.p,this.size);break;case"<":this.p--,this.p=this.mod(this.p,this.size);break;case"+":this.array[this.p]=this.array[this.p]+1&255;break;case"-":this.array[this.p]=this.array[this.p]-1&255;break;case".":if(!String.fromCharCode(this.array[this.p]))break;this.emit("out",String.fromCharCode(this.array[this.p]));break;case",":if(this.emit("in"),this.input[this.char]===void 0){this.array[this.p]=0;break}this.array[this.p]=this.input[this.char++].charCodeAt(0);break;case"[":let t=this.i,a=0;for(;;){if(t++,!e[t])throw new Error("Out of bounds.");if(e[t]==="["&&a++,this.program[t]==="]")if(a===0){this.array[this.p]===0?this.i=t:this.loops[t]=this.i;break}else a--}break;case"]":this.array[this.p]!==0?this.i=this.loops[this.i]:this.loops[this.i];break;default:i=!0}i||this.emit("tick"),this.i++}},{key:"init",value:function(){var e=this;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1e3;const t=function(){for(let a=0;a1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:3e4;if(f(this,n),!e)throw new Error("No program to interpret.");this.program=e,this.input=i,this.size=t,this.array=new Array(t).fill(0),this.p=0,this.i=0,this.done=!1,this.events={},this.loops={},this.mod=function(a,s){return s+=1,(a%s+s)%s}}return p(n,[{key:"on",value:function(e,i){this.events[e]||(this.events[e]=[]),this.events[e].push(i)}},{key:"emit",value:function(e){for(var i=arguments.length,t=new Array(i>1?i-1:0),a=1;a":this.p++,this.p=this.mod(this.p,this.size);break;case"<":this.p--,this.p=this.mod(this.p,this.size);break;case"+":this.array[this.p]=this.array[this.p]+1&255;break;case"-":this.array[this.p]=this.array[this.p]-1&255;break;case".":if(!String.fromCharCode(this.array[this.p]))break;this.emit("out",String.fromCharCode(this.array[this.p]));break;case",":if(this.emit("in"),this.input[this.char]===void 0){this.array[this.p]=0;break}this.array[this.p]=this.input[this.char++].charCodeAt(0);break;case"[":let t=this.i,a=0;for(;;){if(t++,!e[t])throw new Error("Out of bounds.");if(e[t]==="["&&a++,this.program[t]==="]")if(a===0){this.array[this.p]===0?this.i=t:this.loops[t]=this.i;break}else a--}break;case"]":this.array[this.p]!==0?this.i=this.loops[this.i]:this.loops[this.i];break;default:i=!0}i||this.emit("tick"),this.i++}},{key:"init",value:function(){var e=this;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1e3;const t=function(){for(let a=0;a1&&arguments[1]!==void 0?arguments[1]:"auto",n=arguments.length>2?arguments[2]:void 0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;try{if(s)return{source_lang:i,text:e};const a=await(await fetch(V,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e,source_lang:i,target_lang:n})})).json();if(a.code!==200)throw Error(`Failed to translate text from DeepL: ${a.message}`);return{source_lang:i,text:a.data}}catch(a){throw Error(`Failed to fetch from DeepL: ${a}`)}}},x={translate:async function(e){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto",n=arguments.length>2?arguments[2]:void 0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;try{if(s)return{source_lang:i,text:e};const a="https://translate.googleapis.com/translate_a/single?"+new URLSearchParams({client:"gtx",sl:i,tl:n,dt:"t",dj:"1",source:"input",q:e}),d=await(await fetch(a)).json();return{source_lang:i,text:d.sentences.map(function(I){return I.trans}).join("")}}catch(a){throw Error(`Failed to fetch from Google Translate: ${a}`)}}},N;const O=T.findByProps("openLazy","hideActionSheet"),U=((N=T.findByProps("ActionSheetRow"))===null||N===void 0?void 0:N.ActionSheetRow)??h.Forms.FormRow,q=T.findByStoreName("MessageStore"),Y=T.findByStoreName("ChannelStore"),J=t.stylesheet.createThemedStyleSheet({iconComponent:{width:24,height:24,tintColor:M.semanticColors.INTERACTIVE_NORMAL}});let y=[];function X(){return D.before("openLazy",O,function(e){let[i,n,s]=e;const a=s?.message;n!=="MessageLongPressActionSheet"||!a||i.then(function(d){const I=D.after("default",d,function(me,ce){t.React.useEffect(function(){return function(){I()}},[]);const b=$.findInReactTree(ce,function(o){var u,g;return(o==null||(g=o[0])===null||g===void 0||(u=g.type)===null||u===void 0?void 0:u.name)==="ButtonRow"});if(!b)return;const ue=Math.max(b.findIndex(function(o){return o.props.message===t.i18n.Messages.MARK_UNREAD}),0),c=q.getMessage(a.channel_id,a.id);if(!c?.content&&!a.content)return;const C=c?.id??a.id,ge=c?.content??a.content,_=y.find(function(o){return Object.keys(o)[0]===C},"cache object"),E=_?"Revert":"Translate",H=E==="Translate"?l.getAssetIDByName("ic_locale_24px"):l.getAssetIDByName("ic_highlight"),he=async function(){try{const u=r.target_lang,g=E==="Translate";var o;switch(r.translator){case 0:console.log("Translating with DeepL: ",c.content),o=await P.translate(c.content,void 0,u,!g);case 1:console.log("Translating with GTranslate: ",c.content),o=await x.translate(c.content,void 0,u,!g)}t.FluxDispatcher.dispatch({type:"MESSAGE_UPDATE",message:{...c,content:`${g?o.text:_[C]} ${g?`\`[${u?.toLowerCase()}]\``:""}`,guild_id:Y.getChannel(c.channel_id).guild_id},log_edit:!1,otherPluginBypass:!0}),g?y.unshift({[C]:ge}):y=y.filter(function(de){return de!==_},"cached data override")}catch(u){m.showToast("Failed to translate message. Please check Debug Logs for more info.",l.getAssetIDByName("Small")),k.logger.error(u)}finally{return O.hideActionSheet()}};b.splice(ue,0,t.React.createElement(U,{label:`${E} Message`,icon:t.React.createElement(U.Icon,{source:H,IconComponent:function(){return t.React.createElement(t.ReactNative.Image,{resizeMode:"cover",style:J.iconComponent,source:H})}}),onPress:he}))})})})}var w;(function(e){e[e.BUILT_IN=0]="BUILT_IN",e[e.BUILT_IN_TEXT=1]="BUILT_IN_TEXT",e[e.BUILT_IN_INTEGRATION=2]="BUILT_IN_INTEGRATION",e[e.BOT=3]="BOT",e[e.PLACEHOLDER=4]="PLACEHOLDER"})(w||(w={}));var R;(function(e){e[e.SUB_COMMAND=1]="SUB_COMMAND",e[e.SUB_COMMAND_GROUP=2]="SUB_COMMAND_GROUP",e[e.STRING=3]="STRING",e[e.INTEGER=4]="INTEGER",e[e.BOOLEAN=5]="BOOLEAN",e[e.USER=6]="USER",e[e.CHANNEL=7]="CHANNEL",e[e.ROLE=8]="ROLE",e[e.MENTIONABLE=9]="MENTIONABLE",e[e.NUMBER=10]="NUMBER",e[e.ATTACHMENT=11]="ATTACHMENT"})(R||(R={}));var L;(function(e){e[e.CHAT=1]="CHAT",e[e.USER=2]="USER",e[e.MESSAGE=3]="MESSAGE"})(L||(L={}));const G={arabic:"AR",bulgarian:"BG",czech:"CS",danish:"DA",german:"DE",greek:"EL",english:"EN",spanish:"ES",estonian:"ET",finnish:"FI",french:"FR",hungarian:"HU",indonesian:"ID",italian:"IT",japanese:"JA",korean:"KO",lithuanian:"LT",latvian:"LV",norwegian:"NO",dutch:"NL",polish:"PL",portuguese:"PT",romanian:"RO",russian:"RU",slovak:"SK",slovenian:"SL",swedish:"SV",turkish:"TR",ukrainian:"UK","chinese-simplified":"ZH"},W={Afrikaans:"af",Albanian:"sq",Amharic:"am",Arabic:"ar",Armenian:"hy",Assamese:"as",Aymara:"ay",Azerbaijani:"az",Bambara:"bm",Basque:"eu",Belarusian:"be",Bengali:"bn",Bhojpuri:"bho",Bosnian:"bs",Bulgarian:"bg",Catalan:"ca",Cebuano:"ceb",Chichewa:"ny","Chinese (Simplified)":"zh-CN","Chinese (Traditional)":"zh-TW",Corsican:"co",Croatian:"hr",Czech:"cs",Danish:"da",Dhivehi:"dv",Dogri:"doi",Dutch:"nl",English:"en",Esperanto:"eo",Estonian:"et",Ewe:"ee",Filipino:"tl",Finnish:"fi",French:"fr",Frisian:"fy",Galician:"gl",Georgian:"ka",German:"de",Greek:"el",Guarani:"gn",Gujarati:"gu","Haitian Creole":"ht",Hausa:"ha",Hawaiian:"haw",Hebrew:"iw",Hindi:"hi",Hmong:"hmn",Hungarian:"hu",Icelandic:"is",Igbo:"ig",Ilocano:"ilo",Indonesian:"id",Irish:"ga",Italian:"it",Japanese:"ja",Javanese:"jw",Kannada:"kn",Kazakh:"kk",Khmer:"km",Kinyarwanda:"rw",Konkani:"gom",Korean:"ko",Krio:"kri","Kurdish (Kurmanji)":"ku","Kurdish (Sorani)":"ckb",Kyrgyz:"ky",Lao:"lo",Latin:"la",Latvian:"lv",Lingala:"ln",Lithuanian:"lt",Luganda:"lg",Luxembourgish:"lb",Macedonian:"mk",Maithili:"mai",Malagasy:"mg",Malay:"ms",Malayalam:"ml",Maltese:"mt",Maori:"mi",Marathi:"mr","Meiteilon (Manipuri)":"mni-Mtei",Mizo:"lus",Mongolian:"mn","Myanmar (Burmese)":"my",Nepali:"ne",Norwegian:"no","Odia (Oriya)":"or",Oromo:"om",Pashto:"ps",Persian:"fa",Polish:"pl",Portuguese:"pt",Punjabi:"pa",Quechua:"qu",Romanian:"ro",Russian:"ru",Samoan:"sm",Sanskrit:"sa","Scots Gaelic":"gd",Sepedi:"nso",Serbian:"sr",Sesotho:"st",Shona:"sn",Sindhi:"sd",Sinhala:"si",Slovak:"sk",Slovenian:"sl",Somali:"so",Spanish:"es",Sundanese:"su",Swahili:"sw",Swedish:"sv",Tajik:"tg",Tamil:"ta",Tatar:"tt",Telugu:"te",Thai:"th",Tigrinya:"ti",Tsonga:"ts",Turkish:"tr",Turkmen:"tk",Twi:"ak",Ukrainian:"uk",Urdu:"ur",Uyghur:"ug",Uzbek:"uz",Vietnamese:"vi",Welsh:"cy",Xhosa:"xh",Yiddish:"yi",Yoruba:"yo",Zulu:"zu"},Z=T.findByProps("sendBotMessage"),Q=Object.entries(G).map(function(e){let[i,n]=e;return{name:i,displayName:i,value:n}});function ee(){return z.registerCommand({name:"translate",displayName:"translate",description:"Send a message using Dislate in any language chosen.",displayDescription:"Send a message using Dislate in any language chosen.",applicationId:"-1",type:L.CHAT,inputType:w.BUILT_IN_TEXT,options:[{name:"text",displayName:"text",description:"The text/message for Dislate to translate. Please note some formatting of mentions and emojis may break due to the API.",displayDescription:"The text/message for Dislate to translate. Please note some formatting of mentions and emojis may break due to the API.",type:R.STRING,required:!0},{name:"language",displayName:"language",description:"The language that Dislate will translate the text into. This can be any language from the list.",displayDescription:"The language that Dislate will translate the text into. This can be any language from the list.",type:R.STRING,choices:[...Q],required:!0}],async execute(e,i){const[n,s]=e;try{var a;switch(r.translator){case 0:a=await P.translate(n.value,void 0,s.value);case 1:a=await x.translate(n.value,void 0,s.value)}return await new Promise(function(d){return K.showConfirmationAlert({title:"Are you sure you want to send it?",content:React.createElement(h.Codeblock,null,a.text),confirmText:"Yep, send it!",onConfirm:function(){return d({content:a.text})},cancelText:"Nope, don't send it"})})}catch(d){return k.logger.error(d),Z.sendBotMessage(i.channel.id,"Failed to translate message. Please check Debug Logs for more info.")}}})}const{FormRow:S}=h.Forms,{ScrollView:j}=t.ReactNative;function te(){A.useProxy(r);const[e,i]=t.React.useState("");return r.translator==0?t.React.createElement(j,{style:{flex:1}},t.React.createElement(h.Search,{style:{padding:15},placeholder:"Search Language",onChangeText:function(n){i(n)}}),Object.entries(G).filter(function(n){let[s,a]=n;return s.toLowerCase().includes(e.toLowerCase())}).map(function(n){let[s,a]=n;return t.React.createElement(S,{label:s,trailing:function(){return t.React.createElement(S.Arrow,null)},onPress:function(){r.target_lang!=a&&(r.target_lang=a,m.showToast(`Saved ToLang to ${s}`,l.getAssetIDByName("check")))}})})):t.React.createElement(j,{style:{flex:1}},t.React.createElement(h.Search,{style:{padding:15},placeholder:"Search Language",onChangeText:function(n){i(n)}}),Object.entries(W).filter(function(n){let[s,a]=n;return s.toLowerCase().includes(e.toLowerCase())}).map(function(n){let[s,a]=n;return t.React.createElement(S,{label:s,trailing:function(){return t.React.createElement(S.Arrow,null)},onPress:function(){r.target_lang!=a&&(r.target_lang=a,m.showToast(`Saved ToLang to ${s}`,l.getAssetIDByName("check")))}})}))}const{FormRow:v}=h.Forms,{ScrollView:ae}=t.ReactNative;function ne(){return A.useProxy(r),t.React.createElement(ae,{style:{flex:1}},t.React.createElement(v,{label:"DeepL",trailing:function(){return t.React.createElement(v.Arrow,null)},onPress:function(){r.translator!=0&&(r.translator=0,m.showToast("Saved Translator to DeepL",l.getAssetIDByName("check")))}}),t.React.createElement(v,{label:"Google Translate",trailing:function(){return t.React.createElement(v.Arrow,null)},onPress:function(){r.translator!=1&&(r.translator=1,m.showToast("Saved Translator to Google Translate",l.getAssetIDByName("check")))}}))}const{ScrollView:re,Text:ie}=t.ReactNative,{FormRow:f}=h.Forms,se=t.stylesheet.createThemedStyleSheet({subheaderText:{color:M.semanticColors.HEADER_SECONDARY,textAlign:"center",margin:10,marginBottom:50,letterSpacing:.25,fontFamily:t.constants.Fonts.PRIMARY_BOLD,fontSize:14}});function oe(){var e;const i=t.NavigationNative.useNavigation();return A.useProxy(r),t.React.createElement(re,null,t.React.createElement(f,{label:"Translate to",subLabel:(e=r.target_lang)===null||e===void 0?void 0:e.toLowerCase(),leading:t.React.createElement(f.Icon,{source:l.getAssetIDByName("ic_activity_24px")}),trailing:function(){return t.React.createElement(f.Arrow,null)},onPress:function(){return i.push("VendettaCustomPage",{title:"Translate to",render:te})}}),t.React.createElement(f,{label:"Translator",subLabel:r.translator?"Google Translate":"DeepL",leading:t.React.createElement(f.Icon,{source:l.getAssetIDByName("ic_locale_24px")}),trailing:function(){return t.React.createElement(f.Arrow,null)},onPress:function(){return i.push("VendettaCustomPage",{title:"Translator",render:ne})}}),t.React.createElement(ie,{style:se.subheaderText,onPress:function(){return t.url.openURL("https://github.com/Rico040/bunny-plugins")}},`Build: (${B.manifest.hash.substring(0,7)})`))}const r=B.storage;r.target_lang??="EN",r.translator??=0;let F=[];var le={onLoad:function(){return F=[X(),ee()]},onUnload:function(){for(const e of F)e()},settings:oe};return p.default=le,p.settings=r,Object.defineProperty(p,"__esModule",{value:!0}),p})({},vendetta.plugin,vendetta.metro,vendetta.metro.common,vendetta.patcher,vendetta.ui,vendetta.ui.assets,vendetta.ui.components,vendetta.utils,vendetta,vendetta.commands,vendetta.ui.alerts,vendetta.storage,vendetta.ui.toasts); +(function(p,E,d,t,B,D,o,u,H,M,$,z,N,f){"use strict";const K="https://deeplx.vercel.app/translate";var k={translate:async function(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;try{if(i)return{source_lang:s,text:e};const a=await(await fetch(K,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e,source_lang:s,target_lang:n})})).json();if(a.code!==200)throw Error(`Failed to translate text from DeepL: ${a.message}`);return{source_lang:s,text:a.data}}catch(a){throw Error(`Failed to fetch from DeepL: ${a}`)}}},P={translate:async function(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;try{if(i)return{source_lang:s,text:e};const a="https://translate.googleapis.com/translate_a/single?"+new URLSearchParams({client:"gtx",sl:s,tl:n,dt:"t",dj:"1",source:"input",q:e}),g=await(await fetch(a)).json();return{source_lang:s,text:g.sentences.map(function(L){return L.trans}).join("")}}catch(a){throw Error(`Failed to fetch from Google Translate: ${a}`)}}};const x=d.findByProps("openLazy","hideActionSheet"),O=d.findByProps("ActionSheetRow")?.ActionSheetRow??u.Forms.FormRow,V=d.findByStoreName("MessageStore"),q=d.findByStoreName("ChannelStore"),Y=t.stylesheet.createThemedStyleSheet({iconComponent:{width:24,height:24,tintColor:D.semanticColors.INTERACTIVE_NORMAL}});let y=[];function J(){return B.before("openLazy",x,function(e){let[s,n,i]=e;const a=i?.message;n!=="MessageLongPressActionSheet"||!a||s.then(function(g){const L=B.after("default",g,function(Te,le){t.React.useEffect(function(){return function(){L()}},[]);const I=H.findInReactTree(le,function(c){return c?.[0]?.type?.name==="ButtonRow"});if(!I)return;const ce=Math.max(I.findIndex(function(c){return c.props.message===t.i18n.Messages.MARK_UNREAD}),0),l=V.getMessage(a.channel_id,a.id);if(!l?.content&&!a.content)return;const b=l?.id??a.id,ue=l?.content??a.content,C=y.find(function(c){return Object.keys(c)[0]===b},"cache object"),_=C?"Revert":"Translate",F=_==="Translate"?o.getAssetIDByName("ic_locale_24px"):o.getAssetIDByName("ic_highlight"),ge=async function(){try{const T=r.target_lang,m=_==="Translate";var c;switch(r.translator){case 0:console.log("Translating with DeepL: ",l.content),c=await k.translate(l.content,void 0,T,!m);case 1:console.log("Translating with GTranslate: ",l.content),c=await P.translate(l.content,void 0,T,!m)}t.FluxDispatcher.dispatch({type:"MESSAGE_UPDATE",message:{...l,content:`${m?c.text:C[b]} ${m?`\`[${T?.toLowerCase()}]\``:""}`,guild_id:q.getChannel(l.channel_id).guild_id},log_edit:!1,otherPluginBypass:!0}),m?y.unshift({[b]:ue}):y=y.filter(function(he){return he!==C},"cached data override")}catch(T){f.showToast("Failed to translate message. Please check Debug Logs for more info.",o.getAssetIDByName("Small")),M.logger.error(T)}finally{return x.hideActionSheet()}};I.splice(ce,0,t.React.createElement(O,{label:`${_} Message`,icon:t.React.createElement(O.Icon,{source:F,IconComponent:function(){return t.React.createElement(t.ReactNative.Image,{resizeMode:"cover",style:Y.iconComponent,source:F})}}),onPress:ge}))})})})}var w;(function(e){e[e.BUILT_IN=0]="BUILT_IN",e[e.BUILT_IN_TEXT=1]="BUILT_IN_TEXT",e[e.BUILT_IN_INTEGRATION=2]="BUILT_IN_INTEGRATION",e[e.BOT=3]="BOT",e[e.PLACEHOLDER=4]="PLACEHOLDER"})(w||(w={}));var R;(function(e){e[e.SUB_COMMAND=1]="SUB_COMMAND",e[e.SUB_COMMAND_GROUP=2]="SUB_COMMAND_GROUP",e[e.STRING=3]="STRING",e[e.INTEGER=4]="INTEGER",e[e.BOOLEAN=5]="BOOLEAN",e[e.USER=6]="USER",e[e.CHANNEL=7]="CHANNEL",e[e.ROLE=8]="ROLE",e[e.MENTIONABLE=9]="MENTIONABLE",e[e.NUMBER=10]="NUMBER",e[e.ATTACHMENT=11]="ATTACHMENT"})(R||(R={}));var v;(function(e){e[e.CHAT=1]="CHAT",e[e.USER=2]="USER",e[e.MESSAGE=3]="MESSAGE"})(v||(v={}));const U={arabic:"AR",bulgarian:"BG",czech:"CS",danish:"DA",german:"DE",greek:"EL",english:"EN",spanish:"ES",estonian:"ET",finnish:"FI",french:"FR",hungarian:"HU",indonesian:"ID",italian:"IT",japanese:"JA",korean:"KO",lithuanian:"LT",latvian:"LV",norwegian:"NO",dutch:"NL",polish:"PL",portuguese:"PT",romanian:"RO",russian:"RU",slovak:"SK",slovenian:"SL",swedish:"SV",turkish:"TR",ukrainian:"UK","chinese-simplified":"ZH"},X={Afrikaans:"af",Albanian:"sq",Amharic:"am",Arabic:"ar",Armenian:"hy",Assamese:"as",Aymara:"ay",Azerbaijani:"az",Bambara:"bm",Basque:"eu",Belarusian:"be",Bengali:"bn",Bhojpuri:"bho",Bosnian:"bs",Bulgarian:"bg",Catalan:"ca",Cebuano:"ceb",Chichewa:"ny","Chinese (Simplified)":"zh-CN","Chinese (Traditional)":"zh-TW",Corsican:"co",Croatian:"hr",Czech:"cs",Danish:"da",Dhivehi:"dv",Dogri:"doi",Dutch:"nl",English:"en",Esperanto:"eo",Estonian:"et",Ewe:"ee",Filipino:"tl",Finnish:"fi",French:"fr",Frisian:"fy",Galician:"gl",Georgian:"ka",German:"de",Greek:"el",Guarani:"gn",Gujarati:"gu","Haitian Creole":"ht",Hausa:"ha",Hawaiian:"haw",Hebrew:"iw",Hindi:"hi",Hmong:"hmn",Hungarian:"hu",Icelandic:"is",Igbo:"ig",Ilocano:"ilo",Indonesian:"id",Irish:"ga",Italian:"it",Japanese:"ja",Javanese:"jw",Kannada:"kn",Kazakh:"kk",Khmer:"km",Kinyarwanda:"rw",Konkani:"gom",Korean:"ko",Krio:"kri","Kurdish (Kurmanji)":"ku","Kurdish (Sorani)":"ckb",Kyrgyz:"ky",Lao:"lo",Latin:"la",Latvian:"lv",Lingala:"ln",Lithuanian:"lt",Luganda:"lg",Luxembourgish:"lb",Macedonian:"mk",Maithili:"mai",Malagasy:"mg",Malay:"ms",Malayalam:"ml",Maltese:"mt",Maori:"mi",Marathi:"mr","Meiteilon (Manipuri)":"mni-Mtei",Mizo:"lus",Mongolian:"mn","Myanmar (Burmese)":"my",Nepali:"ne",Norwegian:"no","Odia (Oriya)":"or",Oromo:"om",Pashto:"ps",Persian:"fa",Polish:"pl",Portuguese:"pt",Punjabi:"pa",Quechua:"qu",Romanian:"ro",Russian:"ru",Samoan:"sm",Sanskrit:"sa","Scots Gaelic":"gd",Sepedi:"nso",Serbian:"sr",Sesotho:"st",Shona:"sn",Sindhi:"sd",Sinhala:"si",Slovak:"sk",Slovenian:"sl",Somali:"so",Spanish:"es",Sundanese:"su",Swahili:"sw",Swedish:"sv",Tajik:"tg",Tamil:"ta",Tatar:"tt",Telugu:"te",Thai:"th",Tigrinya:"ti",Tsonga:"ts",Turkish:"tr",Turkmen:"tk",Twi:"ak",Ukrainian:"uk",Urdu:"ur",Uyghur:"ug",Uzbek:"uz",Vietnamese:"vi",Welsh:"cy",Xhosa:"xh",Yiddish:"yi",Yoruba:"yo",Zulu:"zu"},W=d.findByProps("sendBotMessage"),Z=Object.entries(U).map(function(e){let[s,n]=e;return{name:s,displayName:s,value:n}});function Q(){return $.registerCommand({name:"translate",displayName:"translate",description:"Send a message using Dislate in any language chosen.",displayDescription:"Send a message using Dislate in any language chosen.",applicationId:"-1",type:v.CHAT,inputType:w.BUILT_IN_TEXT,options:[{name:"text",displayName:"text",description:"The text/message for Dislate to translate. Please note some formatting of mentions and emojis may break due to the API.",displayDescription:"The text/message for Dislate to translate. Please note some formatting of mentions and emojis may break due to the API.",type:R.STRING,required:!0},{name:"language",displayName:"language",description:"The language that Dislate will translate the text into. This can be any language from the list.",displayDescription:"The language that Dislate will translate the text into. This can be any language from the list.",type:R.STRING,choices:[...Z],required:!0}],async execute(e,s){const[n,i]=e;try{var a;switch(r.translator){case 0:a=await k.translate(n.value,void 0,i.value);case 1:a=await P.translate(n.value,void 0,i.value)}return await new Promise(function(g){return z.showConfirmationAlert({title:"Are you sure you want to send it?",content:React.createElement(u.Codeblock,null,a.text),confirmText:"Yep, send it!",onConfirm:function(){return g({content:a.text})},cancelText:"Nope, don't send it"})})}catch(g){return M.logger.error(g),W.sendBotMessage(s.channel.id,"Failed to translate message. Please check Debug Logs for more info.")}}})}const{FormRow:S}=u.Forms,{ScrollView:G}=t.ReactNative;function ee(){N.useProxy(r);const[e,s]=t.React.useState("");return r.translator==0?t.React.createElement(G,{style:{flex:1}},t.React.createElement(u.Search,{style:{padding:15},placeholder:"Search Language",onChangeText:function(n){s(n)}}),Object.entries(U).filter(function(n){let[i,a]=n;return i.toLowerCase().includes(e.toLowerCase())}).map(function(n){let[i,a]=n;return t.React.createElement(S,{label:i,trailing:function(){return t.React.createElement(S.Arrow,null)},onPress:function(){r.target_lang!=a&&(r.target_lang=a,f.showToast(`Saved ToLang to ${i}`,o.getAssetIDByName("check")))}})})):t.React.createElement(G,{style:{flex:1}},t.React.createElement(u.Search,{style:{padding:15},placeholder:"Search Language",onChangeText:function(n){s(n)}}),Object.entries(X).filter(function(n){let[i,a]=n;return i.toLowerCase().includes(e.toLowerCase())}).map(function(n){let[i,a]=n;return t.React.createElement(S,{label:i,trailing:function(){return t.React.createElement(S.Arrow,null)},onPress:function(){r.target_lang!=a&&(r.target_lang=a,f.showToast(`Saved ToLang to ${i}`,o.getAssetIDByName("check")))}})}))}const{FormRow:A}=u.Forms,{ScrollView:te}=t.ReactNative;function ae(){return N.useProxy(r),t.React.createElement(te,{style:{flex:1}},t.React.createElement(A,{label:"DeepL",trailing:function(){return t.React.createElement(A.Arrow,null)},onPress:function(){r.translator!=0&&(r.translator=0,f.showToast("Saved Translator to DeepL",o.getAssetIDByName("check")))}}),t.React.createElement(A,{label:"Google Translate",trailing:function(){return t.React.createElement(A.Arrow,null)},onPress:function(){r.translator!=1&&(r.translator=1,f.showToast("Saved Translator to Google Translate",o.getAssetIDByName("check")))}}))}const{ScrollView:ne,Text:re}=t.ReactNative,{FormRow:h}=u.Forms,ie=t.stylesheet.createThemedStyleSheet({subheaderText:{color:D.semanticColors.HEADER_SECONDARY,textAlign:"center",margin:10,marginBottom:50,letterSpacing:.25,fontFamily:t.constants.Fonts.PRIMARY_BOLD,fontSize:14}});function se(){const e=t.NavigationNative.useNavigation();return N.useProxy(r),t.React.createElement(ne,null,t.React.createElement(h,{label:"Translate to",subLabel:r.target_lang?.toLowerCase(),leading:t.React.createElement(h.Icon,{source:o.getAssetIDByName("ic_activity_24px")}),trailing:function(){return t.React.createElement(h.Arrow,null)},onPress:function(){return e.push("VendettaCustomPage",{title:"Translate to",render:ee})}}),t.React.createElement(h,{label:"Translator",subLabel:r.translator?"Google Translate":"DeepL",leading:t.React.createElement(h.Icon,{source:o.getAssetIDByName("ic_locale_24px")}),trailing:function(){return t.React.createElement(h.Arrow,null)},onPress:function(){return e.push("VendettaCustomPage",{title:"Translator",render:ae})}}),t.React.createElement(re,{style:ie.subheaderText,onPress:function(){return t.url.openURL("https://github.com/Rico040/bunny-plugins")}},`Build: (${E.manifest.hash.substring(0,7)})`))}const r=E.storage;r.target_lang??="EN",r.translator??=0;let j=[];var oe={onLoad:function(){return j=[J(),Q()]},onUnload:function(){for(const e of j)e()},settings:se};return p.default=oe,p.settings=r,Object.defineProperty(p,"__esModule",{value:!0}),p})({},vendetta.plugin,vendetta.metro,vendetta.metro.common,vendetta.patcher,vendetta.ui,vendetta.ui.assets,vendetta.ui.components,vendetta.utils,vendetta,vendetta.commands,vendetta.ui.alerts,vendetta.storage,vendetta.ui.toasts); diff --git a/dislate/manifest.json b/dislate/manifest.json index 1308bde..257e2ed 100644 --- a/dislate/manifest.json +++ b/dislate/manifest.json @@ -1 +1 @@ -{"name":"Dislate Lite","description":"Translates text into a desired language.","authors":[{"name":"Acquite <3","id":"581573474296791211"},{"name":"sapphire :>","id":"757982547861962752"},{"name":"Rico040 ;)","id":"619474349845643275"}],"main":"index.js","vendetta":{"icon":"ic_locale_24px"},"hash":"abc8be824428fefb6521e465afcf345821e276b01b4a7fa8b37c2bdfd83833b4"} \ No newline at end of file +{"name":"Dislate Lite","description":"Translates text into a desired language.","authors":[{"name":"Acquite <3","id":"581573474296791211"},{"name":"sapphire :>","id":"757982547861962752"},{"name":"Rico040 ;)","id":"619474349845643275"}],"main":"index.js","vendetta":{"icon":"ic_locale_24px"},"hash":"df8ae50f1977cb6c76c8724add6553ace316d64bb079586613d6e6aad5593951"} \ No newline at end of file diff --git a/freemoji/index.js b/freemoji/index.js index 5f050c2..8c7c020 100644 --- a/freemoji/index.js +++ b/freemoji/index.js @@ -1,3 +1,3 @@ -(function(s,e,r,i,j,c,h,g){"use strict";const y=r.findByProps("canUseEmojisEverywhere");var E=[i.instead("canUseEmojisEverywhere",y,function(){return!0}),i.instead("canUseAnimatedEmojis",y,function(){return!0})];const{getCustomEmojiById:b}=r.findByStoreName("EmojiStore"),{getGuildId:R}=r.findByStoreName("SelectedGuildStore"),$=//i;function w(t,n){const o=t.matchAll(//gi),l=[];for(const a of o){const u=b(a[2]);if(u.guildId!=R()||u.animated){t=t.replace(a[0],"");var f="webp";u.animated&&(f="gif"),e.storage.hyperlink===!0?l.push(`[${a[1]}](https://cdn.discordapp.com/emojis/${a[2]}.${f}?size=${n}&quality=lossless&name=${a[1]})`):l.push(`https://cdn.discordapp.com/emojis/${a[2]}.${f}?size=${n}`)}}return{newContent:t.trim(),extractedEmojis:l}}function v(t){if(!t.content.match($)||!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,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+=` `+o.join(` -`)),t.invalidEmojis=[]}const z=r.findByProps("sendMessage","receiveMessage"),F=r.findByProps("uploadLocalFiles");var k=[i.before("sendMessage",z,function(t){return v(t[1])}),i.before("uploadLocalFiles",F,function(t){return v(t[0].parsedMessage)})];const{FormSection:m,FormRadioRow:p,FormSwitchRow:S}=c.Forms,B={Tiny:16,Small:32,Medium:48,Large:64,Huge:96,Jumbo:128},M="https://cdn.discordapp.com/emojis/926602689213767680.webp";function I(){return h.useProxy(e.storage),React.createElement(j.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:g.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:g.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(B).map(function(t){let[n,o]=t;return React.createElement(p,{label:n,subLabel:o,selected:e.storage.emojiSize===o,onPress:function(){e.storage.emojiSize=o}})})),React.createElement(m,{title:"Preview"},React.createElement(j.ReactNative.Image,{source:{uri:`${M}?size=${e.storage.emojiSize}`,width:e.storage.emojiSize,height:e.storage.emojiSize}})))}var d;e.storage.emojiSize??=48,e.storage.hyperlink??=!0,e.storage.haveNitro??=((d=r.findByStoreName("UserStore").getCurrentUser())===null||d===void 0?void 0:d.premiumType)!==null,e.storage.forceMoji??=!1,typeof e.storage.emojiSize=="string"&&(e.storage.emojiSize=parseInt(e.storage.emojiSize));const N=[...E,...k],C=function(){return N.forEach(function(t){return t()})};return s.onUnload=C,s.settings=I,s})({},vendetta.plugin,vendetta.metro,vendetta.patcher,vendetta.metro.common,vendetta.ui.components,vendetta.storage,vendetta.ui.assets); +`)),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); diff --git a/freemoji/manifest.json b/freemoji/manifest.json index c7adbf8..1981308 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":"55757a631d0a88beacffec929d8f0cd457ceda4a12e50ef05b833d068a889e0c"} \ 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":"818b8e8df2f7bb6dd2b163307a8352adc5a3fb016920db89db1ca81d9a09a668"} \ No newline at end of file diff --git a/hideappbutton/index.js b/hideappbutton/index.js index b607fb6..51d7c19 100644 --- a/hideappbutton/index.js +++ b/hideappbutton/index.js @@ -1 +1 @@ -(function(e,a,s,u,c){"use strict";const i=a.findByName("ChatInput");let n;var d={onLoad(){const p=["ic_thread_normal_24px","AppsIcon"].map(function(o){return u.getAssetIDByName(o)});n=s.after("render",i.prototype,function(o,f){const r=c.findInReactTree(f,function(t){return"forceAnimateButtons"in t.props&&t.props.actions});r.props.actions=r.props.actions.filter(function(t){return!p.includes(t.source)})})},onUnload:n};return e.default=d,Object.defineProperty(e,"__esModule",{value:!0}),e})({},vendetta.metro,vendetta.patcher,vendetta.ui.assets,vendetta.utils); +(function(e,a,s,u,c){"use strict";const i=a.findByName("ChatInput");let n;var d={onLoad(){const p=["AppsIcon"].map(function(o){return u.getAssetIDByName(o)});n=s.after("render",i.prototype,function(o,f){const r=c.findInReactTree(f,function(t){return"forceAnimateButtons"in t.props&&t.props.actions});r.props.actions=r.props.actions.filter(function(t){return!p.includes(t.source)})})},onUnload:n};return e.default=d,Object.defineProperty(e,"__esModule",{value:!0}),e})({},vendetta.metro,vendetta.patcher,vendetta.ui.assets,vendetta.utils); diff --git a/hideappbutton/manifest.json b/hideappbutton/manifest.json index c839a65..3b56c3e 100644 --- a/hideappbutton/manifest.json +++ b/hideappbutton/manifest.json @@ -1 +1 @@ -{"name":"HideAppButton","description":"Hides app button from chatbox.","authors":[{"name":"Rico040","id":"619474349845643275"}],"main":"index.js","vendetta":{"icon":"AppsIcon"},"hash":"1f73b9016104c3bac275bc7a545135456702017aa67a1d227ea498df3a74cf09"} \ No newline at end of file +{"name":"HideAppButton","description":"Hides app button from chatbox.","authors":[{"name":"Rico040","id":"619474349845643275"}],"main":"index.js","vendetta":{"icon":"AppsIcon"},"hash":"3f5c785973b9e33c4cba8fee8ef53a2fb3c6cb50a1db9f9f775e98f941568597"} \ No newline at end of file diff --git a/picture-links/index.js b/picture-links/index.js index 6ce7808..8ba0936 100644 --- a/picture-links/index.js +++ b/picture-links/index.js @@ -1 +1 @@ -(function(v,a,p,b){"use strict";const{Pressable:h}=a.findByProps("Button","Text","View"),S=a.findByName("ProfileBanner",!1),B=a.findByName("HeaderAvatar",!1),{openMediaModal:w}=a.findByProps("openMediaModal"),{hideActionSheet:I}=a.findByProps("hideActionSheet"),{getChannelId:M}=a.findByStoreName("SelectedChannelStore"),{getGuildId:P}=a.findByStoreName("SelectedGuildStore");function A(t){return new Promise(function(n,e){b.ReactNative.Image.getSize(t,function(i,r){return n({width:i,height:r})},function(i){return e(i)})})}async function o(t,n){const{width:e,height:i}=await A(t);I(),w({initialSources:[{uri:t,sourceURI:t,width:e,height:i,guildId:P(),channelId:M()}],initialIndex:0,originLayout:{width:0,height:0,x:n.pageX,y:n.pageY,resizeMode:"fill"}})}const $=p.after("default",B,function(t,n){let[{user:e,style:i,guildId:r}]=t;var d,l,u,y="png";if(typeof((d=e.guildMemberAvatars)===null||d===void 0?void 0:d[r])=="string"){var s;!((s=e.guildMemberAvatars)===null||s===void 0)&&s[r].includes("a_")&&(y="gif")}const m=((l=e.guildMemberAvatars)===null||l===void 0?void 0:l[r])&&`https://cdn.discordapp.com/guilds/${r}/users/${e.id}/avatars/${e.guildMemberAvatars[r]}.${y}?size=4096`,c=e==null||(u=e.getAvatarURL)===null||u===void 0?void 0:u.call(e,!1,4096,!0);if(!c)return n;const R=typeof c=="number"?`https://cdn.discordapp.com/embed/avatars/${Number(BigInt(e.id)>>22n)%6}.png`:c?.replace(".webp",".png");return delete n.props.style,React.createElement(h,{onPress:function(f){let{nativeEvent:g}=f;return o(R,g)},onLongPress:function(f){let{nativeEvent:g}=f;return m&&o(m,g)},style:i},n)}),z=p.after("default",S,function(t,n){let[{bannerSource:e}]=t;if(typeof e?.uri!="string"||!n)return n;const i=e.uri.replace(/(?:\?size=\d{3,4})?$/,"?size=4096").replace(".webp",".png");return React.createElement(h,{onPress:function(r){let{nativeEvent:d}=r;return o(i,d)}},n)});function N(){$(),z()}return v.onUnload=N,v})({},vendetta.metro,vendetta.patcher,vendetta.metro.common); +(function(l,a,f,h){"use strict";const{Pressable:g}=a.findByProps("Button","Text","View"),v=a.findByName("ProfileBanner",!1),y=a.findByName("HeaderAvatar",!1),{openMediaModal:m}=a.findByProps("openMediaModal"),{hideActionSheet:b}=a.findByProps("hideActionSheet"),{getChannelId:S}=a.findByStoreName("SelectedChannelStore"),{getGuildId:B}=a.findByStoreName("SelectedGuildStore");function w(n){return new Promise(function(t,e){h.ReactNative.Image.getSize(n,function(i,r){return t({width:i,height:r})},function(i){return e(i)})})}async function o(n,t){const{width:e,height:i}=await w(n);b(),m({initialSources:[{uri:n,sourceURI:n,width:e,height:i,guildId:B(),channelId:S()}],initialIndex:0,originLayout:{width:0,height:0,x:t.pageX,y:t.pageY,resizeMode:"fill"}})}const I=f.after("default",y,function(n,t){let[{user:e,style:i,guildId:r}]=n;var d="png";typeof e.guildMemberAvatars?.[r]=="string"&&e.guildMemberAvatars?.[r].includes("a_")&&(d="gif");const p=e.guildMemberAvatars?.[r]&&`https://cdn.discordapp.com/guilds/${r}/users/${e.id}/avatars/${e.guildMemberAvatars[r]}.${d}?size=4096`,u=e?.getAvatarURL?.(!1,4096,!0);if(!u)return t;const A=typeof u=="number"?`https://cdn.discordapp.com/embed/avatars/${Number(BigInt(e.id)>>22n)%6}.png`:u?.replace(".webp",".png");return delete t.props.style,React.createElement(g,{onPress:function(s){let{nativeEvent:c}=s;return o(A,c)},onLongPress:function(s){let{nativeEvent:c}=s;return p&&o(p,c)},style:i},t)}),M=f.after("default",v,function(n,t){let[{bannerSource:e}]=n;if(typeof e?.uri!="string"||!t)return t;const i=e.uri.replace(/(?:\?size=\d{3,4})?$/,"?size=4096").replace(".webp",".png");return React.createElement(g,{onPress:function(r){let{nativeEvent:d}=r;return o(i,d)}},t)});function P(){I(),M()}return l.onUnload=P,l})({},vendetta.metro,vendetta.patcher,vendetta.metro.common); diff --git a/picture-links/manifest.json b/picture-links/manifest.json index 30493f0..2870ad6 100644 --- a/picture-links/manifest.json +++ b/picture-links/manifest.json @@ -1 +1 @@ -{"name":"Picture Links","description":"Allows you to click on profile pictures and banners.","authors":[{"name":"redstonekasi","id":"265064055490871297"},{"name":"Rico040","id":"619474349845643275"}],"main":"index.js","vendetta":{"icon":"ic_link"},"hash":"a6927d69e0b59cb1642f408fcf0bc4cc06c09e19fc6dd3ec67814f842a678a78"} \ No newline at end of file +{"name":"Picture Links","description":"Allows you to click on profile pictures and banners.","authors":[{"name":"redstonekasi","id":"265064055490871297"},{"name":"Rico040","id":"619474349845643275"}],"main":"index.js","vendetta":{"icon":"ic_link"},"hash":"d3f63a159f3683660d7b71c20cb17611c9ba2156762a13db9967a99a21d21a6c"} \ No newline at end of file diff --git a/sticker-utils/index.js b/sticker-utils/index.js index f1fdf0e..4df7da5 100644 --- a/sticker-utils/index.js +++ b/sticker-utils/index.js @@ -1 +1 @@ -(function(g,b,n,h,o,r,a,S){"use strict";var u;const k=n.findByStoreName("GuildStore"),R=n.findByStoreName("UserSettingsProtoStore"),P=((u=n.findByProps("ActionSheet"))===null||u===void 0?void 0:u.ActionSheet)??n.find(function(c){var i;return(c==null||(i=c.render)===null||i===void 0?void 0:i.name)==="ActionSheet"}),{hideActionSheet:d}=n.findByProps("hideActionSheet"),{downloadMediaAsset:I}=n.findByProps("downloadMediaAsset"),p=n.findByProps("favoriteSticker","unfavoriteSticker"),s={marginBottom:10},_=b.before("render",P,function(c){let[i]=c;var v,f,m;const A=h.findInReactTree(i,function(t){return Array.isArray(t?.children)}),e=(v=h.findInReactTree(i,function(t){var y;return typeof t?.sticker=="object"&&(t==null||(y=t.sticker)===null||y===void 0?void 0:y.hasOwnProperty("guild_id"))}))===null||v===void 0?void 0:v.sticker,F=(m=R.frecencyWithoutFetchingLatest)===null||m===void 0||(f=m.favoriteStickers)===null||f===void 0?void 0:f.stickerIds;if(!A||!e)return;const l=!!F?.find(function(t){return t===e.id}),B=`https://discord.com/stickers/${e.id}.png`;A.children[1]=React.createElement(React.Fragment,null,Object.values(k.getGuilds()).find(function(t){return t.id===e.guild_id})&&React.createElement(o.Button,{text:l?"Remove from Favorites":"Add to Favorites",color:l?"red":"brand",style:s,size:"small",onPress:function(){return l?p.unfavoriteSticker(e.id):p.favoriteSticker(e.id),d(),r.showToast(l?"Removed from Favorites":"Added to Favorites",a.getAssetIDByName("Check"))}}),React.createElement(o.Button,{text:"Copy ID to clipboard",color:"brand",size:"small",style:s,onPress:function(){return S.clipboard.setString(e.id),d(),r.showToast(`Copied ${e.name}'s ID to clipboard`,a.getAssetIDByName("ic_copy_message_link"))}}),React.createElement(o.Button,{text:"Copy URL to clipboard",color:"brand",size:"small",style:s,onPress:function(){return S.clipboard.setString(B),d(),r.showToast(`Copied ${e.name}'s URL to clipboard`,a.getAssetIDByName("ic_copy_message_link"))}}),React.createElement(o.Button,{text:"Save image",color:"brand",size:"small",style:s,onPress:function(){return I(B,0),d(),r.showToast(`Saved ${e.name}'s image`,a.getAssetIDByName("toast_image_saved"))}}))}),w=function(){return _()};return g.onUnload=w,g})({},vendetta.patcher,vendetta.metro,vendetta.utils,vendetta.ui.components,vendetta.ui.toasts,vendetta.ui.assets,vendetta.metro.common); +(function(l,h,n,u,i,r,o,f){"use strict";const S=n.findByStoreName("GuildStore"),p=n.findByStoreName("UserSettingsProtoStore"),A=n.findByProps("ActionSheet")?.ActionSheet??n.find(function(d){return d?.render?.name==="ActionSheet"}),{hideActionSheet:a}=n.findByProps("hideActionSheet"),{downloadMediaAsset:B}=n.findByProps("downloadMediaAsset"),m=n.findByProps("favoriteSticker","unfavoriteSticker"),c={marginBottom:10},b=h.before("render",A,function(d){let[y]=d;const v=u.findInReactTree(y,function(t){return Array.isArray(t?.children)}),e=u.findInReactTree(y,function(t){return typeof t?.sticker=="object"&&t?.sticker?.hasOwnProperty("guild_id")})?.sticker,R=p.frecencyWithoutFetchingLatest?.favoriteStickers?.stickerIds;if(!v||!e)return;const s=!!R?.find(function(t){return t===e.id}),g=`https://discord.com/stickers/${e.id}.png`;v.children[1]=React.createElement(React.Fragment,null,Object.values(S.getGuilds()).find(function(t){return t.id===e.guild_id})&&React.createElement(i.Button,{text:s?"Remove from Favorites":"Add to Favorites",color:s?"red":"brand",style:c,size:"small",onPress:function(){return s?m.unfavoriteSticker(e.id):m.favoriteSticker(e.id),a(),r.showToast(s?"Removed from Favorites":"Added to Favorites",o.getAssetIDByName("Check"))}}),React.createElement(i.Button,{text:"Copy ID to clipboard",color:"brand",size:"small",style:c,onPress:function(){return f.clipboard.setString(e.id),a(),r.showToast(`Copied ${e.name}'s ID to clipboard`,o.getAssetIDByName("ic_copy_message_link"))}}),React.createElement(i.Button,{text:"Copy URL to clipboard",color:"brand",size:"small",style:c,onPress:function(){return f.clipboard.setString(g),a(),r.showToast(`Copied ${e.name}'s URL to clipboard`,o.getAssetIDByName("ic_copy_message_link"))}}),React.createElement(i.Button,{text:"Save image",color:"brand",size:"small",style:c,onPress:function(){return B(g,0),a(),r.showToast(`Saved ${e.name}'s image`,o.getAssetIDByName("toast_image_saved"))}}))}),k=function(){return b()};return l.onUnload=k,l})({},vendetta.patcher,vendetta.metro,vendetta.utils,vendetta.ui.components,vendetta.ui.toasts,vendetta.ui.assets,vendetta.metro.common); diff --git a/sticker-utils/manifest.json b/sticker-utils/manifest.json index f198246..15ac87b 100644 --- a/sticker-utils/manifest.json +++ b/sticker-utils/manifest.json @@ -1 +1 @@ -{"name":"StickerUtils","description":"i love discord!","authors":[{"name":"sapphire","id":"757982547861962752"}],"main":"index.js","vendetta":{"icon":"ic_sticker_24px"},"hash":"41a8e1303e2636e9e4c7b8a7462c7d10cc7b8d6d1a6e0513035d1d4722a86209"} \ No newline at end of file +{"name":"StickerUtils","description":"i love discord!","authors":[{"name":"sapphire","id":"757982547861962752"},{"name":"Rico040","id":"619474349845643275"}],"main":"index.js","vendetta":{"icon":"ic_sticker_24px"},"hash":"4b3babc92ece8266ed274d0f7a6511a499b5cd1c1eaac233244983b7ebd9b141"} \ No newline at end of file diff --git a/userbg/index.js b/userbg/index.js index fe14fbe..a482232 100644 --- a/userbg/index.js +++ b/userbg/index.js @@ -1 +1 @@ -(function(t,h,B,D,R,o,e,a,u){"use strict";const{ScrollView:y}=u.General,{FormSection:v,FormRow:n}=u.Forms;function w(){return e.React.createElement(y,null,e.React.createElement(v,null,e.React.createElement(n,{label:"Discord Server",leading:e.React.createElement(n.Icon,{source:a.getAssetIDByName("Discord")}),trailing:n.Arrow,onPress:function(){return e.url.openDeeplink("https://discord.gg/TeRQEPb")}}),e.React.createElement(n,{label:"Reload DB",leading:e.React.createElement(n.Icon,{source:a.getAssetIDByName("ic_message_retry")}),onPress:async function(){return await c()?o.showToast("Reloaded DB",a.getAssetIDByName("check")):o.showToast("Failed to reload DB",a.getAssetIDByName("small"))}})))}const m=B.findByProps("default","getUserBannerURL");let r,d;const c=async function(){try{return r=await(await R.safeFetch("https://usrbg.is-hardly.online/users",{cache:"no-store"})).json(),r}catch(i){h.logger.error("Failed to fetch userBG data",i)}},b=async function(){if(await c(),!r)return o.showToast("Failed to load DB");const{endpoint:i,bucket:U,prefix:I,users:A}=r;d=D.after("getUserBannerURL",m,function($){let[f]=$;const g=Object.entries(A).find(function(s){let[l,p]=s;return l===f?.id});if(f?.banner===void 0&&g){const[s,l]=g;return`${i}/${U}/${I}${s}?${l}`}})},E=function(){return d?.()},F=w;return t.fetchData=c,t.onLoad=b,t.onUnload=E,t.settings=F,t})({},vendetta,vendetta.metro,vendetta.patcher,vendetta.utils,vendetta.ui.toasts,vendetta.metro.common,vendetta.ui.assets,vendetta.ui.components); +(function(t,h,B,D,R,c,e,a,d){"use strict";const{ScrollView:y}=d.General,{FormSection:v,FormRow:n}=d.Forms;function w(){return e.React.createElement(y,null,e.React.createElement(v,null,e.React.createElement(n,{label:"Discord Server",leading:e.React.createElement(n.Icon,{source:a.getAssetIDByName("Discord")}),trailing:n.Arrow,onPress:function(){return e.url.openDeeplink("https://discord.gg/TeRQEPb")}}),e.React.createElement(n,{label:"Reload DB",leading:e.React.createElement(n.Icon,{source:a.getAssetIDByName("ic_message_retry")}),onPress:async function(){return await o()?c.showToast("Reloaded DB",a.getAssetIDByName("check")):c.showToast("Failed to reload DB",a.getAssetIDByName("small"))}})))}const m=B.findByProps("default","getUserBannerURL");let r,u;const o=async function(){try{return r=await(await R.safeFetch("https://usrbg.is-hardly.online/users",{cache:"no-store"})).json(),r}catch(s){h.logger.error("Failed to fetch userBG data",s)}},b=async function(){if(await o(),!r)return c.showToast("Failed to load DB");const{endpoint:s,bucket:U,prefix:I,users:A}=r;u=D.after("getUserBannerURL",m,function($){let[f]=$;const g=Object.entries(A).find(function(i){let[l,p]=i;return l===f?.id});if(f?.banner===void 0&&g){const[i,l]=g;return`${s}/${U}/${I}${i}?${l}`}})},E=function(){return u?.()},F=w;return t.fetchData=o,t.onLoad=b,t.onUnload=E,t.settings=F,t})({},vendetta,vendetta.metro,vendetta.patcher,vendetta.utils,vendetta.ui.toasts,vendetta.metro.common,vendetta.ui.assets,vendetta.ui.components); diff --git a/userbg/manifest.json b/userbg/manifest.json index fa480e7..419d5c9 100644 --- a/userbg/manifest.json +++ b/userbg/manifest.json @@ -1 +1 @@ -{"name":"UserBG","description":"https://github.com/Discord-Custom-Covers/usrbg#request-your-own-usrbg","authors":[{"name":"sapphire","id":"757982547861962752"},{"name":"Rico040","id":"619474349845643275"}],"main":"index.js","vendetta":{"icon":"ic_profile_24px"},"hash":"242979faf2eb3163375b41d643c0a5e3166cbd1f468cd4dcd0d9cbfd0ce921d3"} \ No newline at end of file +{"name":"UserBG","description":"https://github.com/Discord-Custom-Covers/usrbg#request-your-own-usrbg","authors":[{"name":"sapphire","id":"757982547861962752"},{"name":"Rico040","id":"619474349845643275"}],"main":"index.js","vendetta":{"icon":"ic_profile_24px"},"hash":"0e4797e8f2ce1791b0413dffce4b4801c258c4c56f9669d1d941560fbd02ff3f"} \ No newline at end of file