diff --git a/Commands/index.js b/Commands/index.js index 88b1d10..72fdd33 100644 --- a/Commands/index.js +++ b/Commands/index.js @@ -1,8 +1,15 @@ -(function(B,re,o,p,N,C,g,s,oe,ie,ce){"use strict";const le=async function(){const e=await(await fetch("https://uselessfacts.jsph.pl/api/v2/facts/random")).json();return{text:e.text,source:e.source,language:e.language}},de=async function(){return{text:(await(await fetch("https://dogapi.dog/api/v2/facts?limit=1")).json()).data[0].attributes.body}},ue=async function(){const e=await(await fetch("https://catfact.ninja/fact")).json();return{text:e.fact,length:e.length}},ye=async function(e){return await(await fetch(`https://api.obamabot.me/v2/image/petpet?image=${e.replace("webp","png")}`)).json()},pe=async function(e="gary"){try{switch(e){case"gary":return(await(await fetch("https://api.garythe.cat/gary")).json()).url;case"goober":return(await(await fetch("https://api.garythe.cat/goober")).json()).url;case"catapi":return(await(await fetch("https://api.thecatapi.com/v1/images/search")).json())[0].url;case"minker":return"https://minky.materii.dev/";default:throw new Error("Invalid Gary image source value")}}catch(t){return console.error(`[Gary API] Error fetching image from ${e}:`,t),null}},P=p.findByProps("sendMessage"),_=function(e){let t=e.text;return o.storage.factSettings?.includeCitation&&e.source&&(t+=` +(function(P,re,s,p,A,b,h,a,oe,ie,l,ce){"use strict";const le=async function(){const e=await(await fetch("https://uselessfacts.jsph.pl/api/v2/facts/random")).json();return{text:e.text,source:e.source,language:e.language}},de=async function(){return{text:(await(await fetch("https://dogapi.dog/api/v2/facts?limit=1")).json()).data[0].attributes.body}},ue=async function(){const e=await(await fetch("https://catfact.ninja/fact")).json();return{text:e.fact,length:e.length}},ye=async function(e){return await(await fetch(`https://api.obamabot.me/v2/image/petpet?image=${e.replace("webp","png")}`)).json()},ge=async function(e="gary"){try{switch(e){case"gary":return(await(await fetch("https://api.garythe.cat/gary")).json()).url;case"goober":return(await(await fetch("https://api.garythe.cat/goober")).json()).url;case"catapi":return(await(await fetch("https://api.thecatapi.com/v1/images/search")).json())[0].url;case"minker":return"https://minky.materii.dev/";default:throw new Error("Invalid Gary image source value")}}catch(t){return console.error(`[Gary API] Error fetching image from ${e}:`,t),null}},_=p.findByProps("sendMessage"),x=function(e){let t=e.text;return s.storage.factSettings?.includeCitation&&e.source&&(t+=` -Source: ${e.source}`),t},fe={name:"catfact",displayName:"catfact",description:"Sends a random cat fact.",displayDescription:"Sends a random cat fact.",applicationId:"-1",inputType:1,type:1,execute:async function(e,t){try{const a=await ue(),r=Date.now().toString();return P.sendMessage(t.channel.id,{content:_(a)},void 0,{nonce:r}),{type:4}}catch(a){return console.error("[CatFact] Error:",a),{type:4}}}},ge={name:"dogfact",displayName:"dogfact",description:"Sends a dog fact.",displayDescription:"Sends a dog fact.",applicationId:"-1",inputType:1,type:1,execute:async function(e,t){try{const a=await de(),r=Date.now().toString();return P.sendMessage(t.channel.id,{content:_(a)},void 0,{nonce:r}),{type:4}}catch(a){return console.error("[DogFact] Error:",a),{type:4}}}},me={name:"useless",displayName:"useless",description:"Sends a useless fact.",displayDescription:"Sends a useless fact.",applicationId:"-1",inputType:1,type:1,execute:async function(e,t){try{const a=await le(),r=Date.now().toString();return P.sendMessage(t.channel.id,{content:_(a)},void 0,{nonce:r}),{type:4}}catch(a){return console.error("[UselessFact] Error:",a),{type:4}}}},S={CONTENT:"This list is over 2000 characters. Send anyway?",CONFIRM:"Send",CANCEL:"Cancel"},he={DETAILED:"detailed"},O="",T={SLM_NOT_INSTALLED:"This list is over 2000 characters. Install the Split Large Messages plugin to send it.",SLM_NOT_ENABLED:"This list is over 2000 characters. Enable the Split Large Messages plugin to send it."},U={SEMICOL:"; ",NEW_LINE:` -`},be="Nothing to see here, huh...",V="github.com/fres621/vendetta-plugins",w={ENABLED:"\u2705",DISABLED:"\u274C",SELECTED:"\u2705",NOT_SELECTED:"\u274C"},Ce=p.findByProps("sendMessage","receiveMessage"),E=p.findByProps("sendBotMessage"),j=function(){try{return p.findByStoreName("UserStore").getCurrentUser()?.premiumType===2?4e3:2e3}catch{return 2e3}}(),F=function(e){return Object.keys(e).includes(V)},G=function(e){return Object.values(e).find(function(t){return t.id==V})?.enabled},W=function(e){return e.find(function(t){return t.name===he.DETAILED})?.value??!1},L=function(e){return!e||!Array.isArray(e)||e.length===0?"Unknown":e.filter(function(t){return t&&(typeof t=="string"||typeof t=="object"&&t.name)}).map(function(t){return typeof t=="string"?t:t.name||"Unknown"}).join(U.SEMICOL)||"Unknown"},K=function(e){return e.join(U.NEW_LINE).trimEnd()},D=function(e){return K(e).length},A=async function(e,t){const a=Date.now().toString();await Ce.sendMessage(e,{content:K(t)},void 0,{nonce:a})},q=function(e,t){return[`**My ${e} List | ${t} ${e}s**`,O]};async function we(e,t){try{const a=W(e),r=o.storage.themeListAlwaysDetailed??!1;if(!N.themes||typeof N.themes!="object"){const y=t.channel.id;return E.sendBotMessage(y,"No themes found or themes not loaded yet."),{type:4}}const n=Object.values(N.themes),c=t.channel.id,i=q("Theme",Object.keys(N.themes).length);if(n.length)for(const y of n){if(!y||typeof y!="object")continue;const{selected:l,data:d,id:m}=y,v=d?.name||"Unknown Theme",R=d?.description||"No description",M=d?.authors;a||r?i.push(`> **Name**: ${v}`,`> **Selected**: ${l?w.SELECTED:w.NOT_SELECTED}`,`> **Description**: ${R}`,`> **Authors**: ${L(M)}`,`> **[Install!](${m||"unknown"})**`,O):i.push(`> ${l?w.SELECTED:w.NOT_SELECTED} **${v}** by ${L(M)}`)}else i.push(be);const u=D(i)>j;if(u&&!F(C.plugins))E.sendBotMessage(c,T.SLM_NOT_INSTALLED);else if(u&&!G(C.plugins))E.sendBotMessage(c,T.SLM_NOT_ENABLED);else{if(D(i)>2e3)return g.alerts.showConfirmationAlert({content:S.CONTENT,confirmText:S.CONFIRM,cancelText:S.CANCEL,onConfirm:async function(){return await A(c,i)}});await A(c,i)}}catch(a){return console.error("[ThemeList] Error:",a),{type:4}}}async function Se(e,t){try{const a=W(e),r=o.storage.pluginListAlwaysDetailed??!1,n=t.channel.id;if(!C.plugins||typeof C.plugins!="object")return E.sendBotMessage(n,"No plugins found or plugins not loaded yet."),{type:4};const c=q("Plugin",Object.keys(C.plugins).length);for(const u of Object.values(C.plugins)){if(!u||typeof u!="object")continue;const{enabled:y,manifest:l,id:d}=u,m=l?.name||"Unknown Plugin",v=l?.description||"No description",R=l?.authors;a||r?c.push(`> **Name**: ${m}`,`> **Status**: ${y?w.ENABLED:w.DISABLED}`,`> **Description**: ${v}`,`> **Authors**: ${L(R)}`,`> **[Install!](${d||"unknown"})**`,O):c.push(`> ${y?w.ENABLED:w.DISABLED} **${m}** by ${L(R)}`)}const i=D(c)>j;if(i&&!F(C.plugins))E.sendBotMessage(n,T.SLM_NOT_INSTALLED);else if(i&&!G(C.plugins))E.sendBotMessage(n,T.SLM_NOT_ENABLED);else{if(D(c)>2e3)return g.alerts.showConfirmationAlert({content:S.CONTENT,confirmText:S.CONFIRM,cancelText:S.CANCEL,onConfirm:async function(){return await A(n,c)}});await A(n,c)}}catch(a){return console.error("[PluginList] Error:",a),{type:4}}}const Ee={name:"plugin-list",displayName:"plugin list",description:"Send your plugin list to the current channel",displayDescription:"Send your plugin list to the current channel",options:[{name:"detailed",description:"Whether to send a list with detailed information.",type:5,required:!1,displayName:"detailed",displayDescription:"Whether to send a list with detailed information."}],execute:Se,applicationId:"-1",inputType:1,type:1},ve={name:"theme-list",displayName:"theme list",description:"Send your theme list to the current channel",displayDescription:"Send your theme list to the current channel",options:[{name:"detailed",description:"Whether to send a list with detailed information.",type:5,required:!1,displayName:"detailed",displayDescription:"Whether to send a list with detailed information."}],execute:we,applicationId:"-1",inputType:1,type:1},Re=p.findByStoreName("UserStore"),Ne=p.findByProps("sendMessage"),Te={name:"petpet",displayName:"petpet",description:"PetPet someone",displayDescription:"PetPet someone",options:[{name:"user",description:"The user(or their id) to be patted",type:6,required:!0,displayName:"user",displayDescription:"The user(or their id) to be patted"}],execute:async function(e,t){try{const a=(await Re.getUser(e[0].value)).getAvatarURL(512),r=await ye(a),n=Date.now().toString();return Ne.sendMessage(t.channel.id,{content:r.url},void 0,{nonce:n}),{type:4}}catch(a){return console.error("[PetPet] Error:",a),{type:4}}},applicationId:"-1",inputType:1,type:1},Le=p.findByProps("sendMessage"),De=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),X=async function(e){const t="https://konachan.com/post.json",a=e?"rating:explicit":"rating:safe",r=Math.floor(Math.random()*100);try{const n=await(await fetch(`${t}?tags=${a}&limit=1&page=${r}`)).json();return!Array.isArray(n)||n.length===0?null:n[0].file_url}catch(n){return console.error("[KonoChan Randomizer] Error fetching image:",n),null}},z=function(){return g.alerts.showConfirmationAlert({title:"NSFW Content Warning",content:"NSFW content can only be sent in NSFW channels!",confirmText:"Okay",cancelText:null,confirmColor:"brand",isDismissable:!0})},H={name:"nsfw",description:"Include NSFW content?",type:5,required:!1,displayName:"nsfw",displayDescription:"Include NSFW content?"},Ae={name:"konoself",displayName:"konoself",description:"Fetch a random image from KonoChan for yourself.",displayDescription:"Fetch a random image from KonoChan for yourself.",options:[H],execute:async function(e,t){try{const a=new Map(e.map(function(n){return[n.name,n]})).get("nsfw")?.value||!1;if(a&&!t.channel.nsfw)return z(),{type:4};const r=await X(a);return r?(De.sendBotMessage(t.channel.id,`Here's your random image: ${r}`),{type:4}):{type:4}}catch(a){return console.error("[KonoSelf] Error:",a),{type:4}}},applicationId:"-1",inputType:1,type:1},ke={name:"konosend",displayName:"konosend",description:"Fetch a random image from KonoChan and send it to the channel.",displayDescription:"Fetch a random image from KonoChan and send it to the channel.",options:[H],execute:async function(e,t){try{const a=new Map(e.map(function(c){return[c.name,c]})).get("nsfw")?.value||!1;if(a&&!t.channel.nsfw)return z(),{type:4};const r=await X(a);if(!r)return{type:4};const n=Date.now().toString();return Le.sendMessage(t.channel.id,{content:r},void 0,{nonce:n}),{type:4}}catch(a){return console.error("[KonoSend] Error:",a),{type:4}}},applicationId:"-1",inputType:1,type:1},Y=p.findByProps("getAPIBaseURL","get"),$e=p.findByProps("sendMessage"),k=async function(e,t,a){const r=t?`&author_id=${t}`:"",n=a?`&channel_id=${a}`:"",c=t?"":"&min_id=0";return(await Y.get({url:`/guilds/${e}/messages/search`,query:`include_nsfw=true${r}${n}${c}&sort_by=timestamp&sort_order=asc&offset=0`})).body.messages[0][0]},Z=async function(e,t){const a=t?`&author_id=${t}`:"",r=t?"":"&min_id=0";return(await Y.get({url:`/channels/${e}/messages/search`,query:`&sort_by=timestamp&sort_order=asc&offset=0${a}${r}`})).body.messages[0][0]},Me={name:"firstmessage",displayName:"firstmessage",description:"Tired of scrolling to first message?",displayDescription:"Tired of scrolling to first message?",options:[{name:"user",displayName:"user",description:"Target user to get their first message in this server/dm",displayDescription:"Target user to get their first message in this server/dm",type:6,required:!1},{name:"channel",displayName:"channel",description:"Target channel to get first message of",displayDescription:"Target channel to get first message of",type:7,required:!1},{name:"send",displayName:"send",description:"Whether to send the resulting url",displayDescription:"Whether to send the resulting url",type:5,required:!1}],execute:async function(e,t){try{const a=new Map(e.map(function(m){return[m.name,m]})),r=a.get("user")?.value,n=a.get("channel")?.value,c=a.get("send")?.value,i=t.guild?.id,u=t.channel.id,y=t.channel.type===1;let l="https://discord.com/channels/",d;if(!r&&!n)y?(d=await Z(u),l+=`@me/${u}/${d.id}`):(d=await k(i),l+=`${i}/${d.channel_id}/${d.id}`);else if(r)y?(d=await Z(u,r),l+=`@me/${u}/${d.id}`):(d=await k(i,r),l+=`${i}/${d.channel_id}/${d.id}`);else if(n){if(y)return{type:4};d=await k(i,null,n),l+=`${i}/${n}/${d.id}`}else{if(y)return{type:4};d=await k(i,r,n),l+=`${i}/${n}/${d.id}`}if(c){const m=Date.now().toString();return $e.sendMessage(t.channel.id,{content:l},void 0,{nonce:m}),{type:4}}else return s.url.openDeeplink(l),{type:4}}catch(a){return console.error("[FirstMessage] Error:",a),{type:4}}},applicationId:"-1",inputType:1,type:1},Ie=p.findByProps("sendMessage"),Be=p.findByProps("sendBotMessage","sendMessage","receiveMessage");function Pe(){let{height:e,width:t,scale:a}=s.ReactNative.Dimensions.get("screen");return e*=a,t*=a,{width:t,height:e}}function _e(){try{const e=p.findByProps("memory");if(!e)return{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A",netInfo:"N/A"};const{cpuCoreCount:t,cpuPercentage:a,memory:r}=e,n=a?a.toFixed(2)+"%":"N/A",c=r?parseFloat((r/1e3).toPrecision(3))+" MB":"N/A";let i="N/A";try{const u=p.findByProps("useNetInfo");if(u){const y=Object.values(u.fetch()).filter(function(l){return l?.type})[0];if(y){const{type:l,details:d}=y;i={wifi:"WiFi",ethernet:"Ethernet",other:"Unknown",bluetooth:"Bluetooth",wimax:"WiMAX",vpn:"VPN",cellular:d?.cellularGeneration?.toUpperCase()||"Cellular"}[l]??l}}}catch(u){console.warn("Network info unavailable:",u)}return{cpuCoreCount:t,cpuPerc:n,memUsage:c,netInfo:i}}catch(e){return console.warn("Hardware info unavailable:",e),{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A",netInfo:"N/A"}}}function Oe(){try{const{NativeModules:e}=s.ReactNative;return(e.InfoDictionaryManager??e.RTNClientInfoManager)||{}}catch(e){return console.warn("Discord info unavailable:",e),{}}}function xe(){try{const{cpuCoreCount:e,cpuPerc:t,memUsage:a,netInfo:r}=_e(),n=Oe(),{vendetta:c,discord:i,react:u,hermes:y,os:l,device:d}=oe.getDebugInfo(),{version:m,bytecodeVersion:v}=y||{},{version:R,nativeVersion:M}=u||{},{name:te,version:st,sdk:ne}=l||{},{manufacturer:rt,brand:ae,model:se,codename:ot}=d||{},{version:it}=c||{},{version:ct,build:lt}=i||{},{ReleaseChannel:dt}=n,ut=te=="iOS"?ot:`${ae} ${se}`,{width:yt,height:pt}=Pe();let I={Device:{Device:ut||"Unknown",Model:se||"Unknown",Manufacturer:rt||"Unknown",Brand:ae||"Unknown",Display:`${yt}x${pt}`},Hardware:{"CPU Cores":e||"N/A",Network:r},Software:{OS:te||"Unknown",Version:st||"Unknown"},Discord:{Branch:dt||"Unknown",Version:ct||"Unknown",Build:lt||"Unknown",Vendetta:it||"Unknown","CPU Usage":t,"Memory Usage":a},React:{Version:R||"Unknown","Hermes Bytecode":v||"Unknown",Hermes:m||"Unknown",Native:M||"Unknown"}};return window.enmity&&(I.Discord.Enmity=window.enmity.version),window.aliucord&&(I.Discord.Aliucord=window.aliucord.version),ne&&(I.Software["SDK Version"]=ne),I}catch(e){throw console.error("Error generating system info:",e),e}}const J=["device","hardware","software","discord","react","ephemeral"];for(const e of J)o.storage[e]===void 0&&(o.storage[e]=!0);function Ue(e,t){try{let a=[`__System Information__ -`];const r=xe();Object.keys(r).forEach(function(i){const u=o.storage[i.toLowerCase()],y=e.find(function(l){return l.name==i.toLowerCase()})?.value??u;(y||u)&&!(u&&!y)&&(a.push(`[**${i}**]`),Object.keys(r[i]).forEach(function(l){a.push(`> ${l}: ${r[i][l]}`)}))});const n=o.storage.ephemeral,c=e.find(function(i){return i.name=="ephemeral"})?.value??n;if((c||n)&&!(n&&!c))return Be.sendBotMessage(t.channel.id,a.join(` -`)),{type:4};{const i=Date.now().toString();return Ie.sendMessage(t.channel.id,{content:a.join(` -`)},void 0,{nonce:i}),{type:4}}}catch(a){return console.error("[Sysinfo] Error:",a),{type:4}}}const Ve={name:"sysinfo",displayName:"sysinfo",description:"Display system information",displayDescription:"Display system information",options:[{name:"ephemeral",displayName:"ephemeral",description:"Keep sysinfo ephemeral (default: true)",displayDescription:"Keep sysinfo ephemeral (default: true)",type:5,required:!1},...J.slice(0,-1).map(function(e){return{name:e,displayName:e,description:`Display the ${e} section. Set default in settings.`,displayDescription:`Display the ${e} section. Set default in settings.`,type:5,required:!1}})],execute:Ue,applicationId:"-1",inputType:1,type:1},Q=p.findByProps("sendMessage","receiveMessage"),je=p.findByStoreName("SpotifyStore");async function Fe(e,t){return o.storage.enabledCommands?.spotifyTrack?$(t,function(a){return`https://open.spotify.com/track/${a.id}`}):{type:4}}async function Ge(e,t){return o.storage.enabledCommands?.spotifyAlbum?$(t,function(a){return`https://open.spotify.com/album/${a.album.id}`}):{type:4}}async function We(e,t){return o.storage.enabledCommands?.spotifyArtists?$(t,function(a){return a.artists.map(function(r){return`[${r.name}](${r.external_urls.spotify})`}).join(` -`)}):{type:4}}async function Ke(e,t){return o.storage.enabledCommands?.spotifyCover?$(t,function(a){return a.album.image.url}):{type:4}}async function $(e,t){try{const a=e.channel.id,r=je?.getTrack?.();if(!r){const i=Date.now().toString();return Q.sendMessage(a,{content:"You are not listening to any track."},void 0,{nonce:i}),{type:4}}const n=t(r),c=Date.now().toString();return Q.sendMessage(a,{content:n},void 0,{nonce:c}),{type:4}}catch(a){return console.error("[Spotify Command] Error:",a),{type:4}}}const qe={name:"spotify track",displayName:"spotify track",description:"Sends your current Spotify track",displayDescription:"Sends your current Spotify track",applicationId:"-1",inputType:1,type:1,execute:Fe},Xe={name:"spotify album",displayName:"spotify album",description:"Sends your current track's album",displayDescription:"Sends your current track's album",applicationId:"-1",inputType:1,type:1,execute:Ge},ze={name:"spotify artists",displayName:"spotify artists",description:"Sends your current track's artists",displayDescription:"Sends your current track's artists",applicationId:"-1",inputType:1,type:1,execute:We},He={name:"spotify cover",displayName:"spotify cover",description:"Sends your current track's cover",displayDescription:"Sends your current track's cover",applicationId:"-1",inputType:1,type:1,execute:Ke},Ye=p.findByProps("sendMessage"),Ze={name:"gary",displayName:"gary",description:"Send a random Gary image to the channel.",displayDescription:"Send a random Gary image to the channel.",options:[],execute:async function(e,t){try{let a="gary";o.storage.garySettings?.useCatAPI?a="catapi":o.storage.garySettings?.useMinkerAPI?a="minker":o.storage.garySettings?.useGooberAPI&&(a="goober");const r=await pe(a);if(!r)return{type:4};const n=Date.now().toString();return Ye.sendMessage(t.channel.id,{content:r},void 0,{nonce:n}),{type:4}}catch(a){return console.error("[Gary] Error:",a),{type:4}}},applicationId:"-1",inputType:1,type:1},{ScrollView:Je}=p.findByProps("ScrollView"),{TableRowGroup:h,TableSwitchRow:f,Stack:ee,TableRow:b}=p.findByProps("TableSwitchRow","TableRowGroup","Stack","TableRow");function Qe(){const e=s.stylesheet.createThemedStyleSheet({container:{flexDirection:"column",alignItems:"center",paddingVertical:24,paddingHorizontal:16},title:{fontSize:28,fontWeight:"700",color:g.semanticColors.TEXT_NORMAL,marginBottom:4},subtitle:{fontSize:16,fontWeight:"500",color:g.semanticColors.TEXT_MUTED},iconContainer:{backgroundColor:g.semanticColors.BACKGROUND_SECONDARY,borderRadius:16,padding:12,marginBottom:16},icon:{width:32,height:32,tintColor:g.semanticColors.TEXT_NORMAL}});return s.React.createElement(s.ReactNative.View,{style:e.container},s.React.createElement(s.ReactNative.View,{style:e.iconContainer},s.React.createElement(s.ReactNative.Image,{source:ce.getAssetIDByName("SettingsIcon"),style:e.icon})),s.React.createElement(s.ReactNative.Text,{style:e.title},"Commands"),s.React.createElement(s.ReactNative.Text,{style:e.subtitle},"A collection of useful commands"))}function et({forceRerender:e}){const t=s.stylesheet.createThemedStyleSheet({container:{backgroundColor:g.semanticColors.BACKGROUND_SECONDARY,borderRadius:12,marginHorizontal:16,marginVertical:8,padding:16},title:{fontSize:18,fontWeight:"600",color:g.semanticColors.TEXT_NORMAL,marginBottom:12},optionContainer:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:8,borderRadius:8,marginVertical:2},selectedOption:{backgroundColor:g.semanticColors.BACKGROUND_MODIFIER_SELECTED},optionText:{fontSize:16,fontWeight:"500",marginLeft:12,flex:1},selectedText:{color:g.semanticColors.TEXT_BRAND},normalText:{color:g.semanticColors.TEXT_NORMAL},radioButton:{width:20,height:20,borderRadius:10,borderWidth:2,borderColor:g.semanticColors.TEXT_MUTED,alignItems:"center",justifyContent:"center"},selectedRadio:{borderColor:g.semanticColors.TEXT_BRAND},radioInner:{width:10,height:10,borderRadius:5,backgroundColor:g.semanticColors.TEXT_BRAND}}),a=[{value:"gary",label:"Gary API",desc:"Original Gary cat images"},{value:"catapi",label:"Cat API",desc:"Random cat pictures"},{value:"minker",label:"Minker API",desc:"Minky images"},{value:"goober",label:"Goober API",desc:"Goober images"}],r=o.storage.garySettings?.imageSource||"gary";return s.React.createElement(s.ReactNative.View,{style:t.container},s.React.createElement(s.ReactNative.Text,{style:t.title},"Gary Image Source"),a.map(function(n){const c=r===n.value;return s.React.createElement(s.ReactNative.Pressable,{key:n.value,style:[t.optionContainer,c&&t.selectedOption],onPress:function(){o.storage.garySettings.imageSource=n.value,e()}},s.React.createElement(s.ReactNative.View,{style:[t.radioButton,c&&t.selectedRadio]},c&&s.React.createElement(s.ReactNative.View,{style:t.radioInner})),s.React.createElement(s.ReactNative.View,{style:{flex:1,marginLeft:12}},s.React.createElement(s.ReactNative.Text,{style:[t.optionText,c?t.selectedText:t.normalText]},n.label),s.React.createElement(s.ReactNative.Text,{style:{fontSize:14,color:g.semanticColors.TEXT_MUTED,marginTop:2}},n.desc)))}))}o.storage.factSettings||(o.storage.factSettings={sendAsReply:!0,includeCitation:!1}),o.storage.listSettings||(o.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),o.storage.garySettings||(o.storage.garySettings={imageSource:"gary"}),o.storage.enabledCommands||(o.storage.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0,firstmessage:!0,sysinfo:!0,spotifyTrack:!0,spotifyAlbum:!0,spotifyArtists:!0,spotifyCover:!0,gary:!0}),o.storage.pendingRestart||(o.storage.pendingRestart=!1);function tt(){ie.useProxy(o.storage);const[e,t]=s.React.useReducer(function(n){return n+1},0),a=s.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:g.semanticColors.BACKGROUND_PRIMARY},spacing:{height:16}});s.React.useEffect(function(){return function(){o.storage.pendingRestart&&(o.storage.pendingRestart=!1,g.alerts.showConfirmationAlert({title:"Restart Required",content:"You have made changes to commands. Please restart Discord to apply these changes.",confirmText:"Okay",cancelText:null}))}},[]);const r=function(n,c){o.storage.enabledCommands[n]=c,o.storage.pendingRestart=!0,t()};return s.React.createElement(s.ReactNative.View,{style:a.container},s.React.createElement(Je,{style:{flex:1},contentContainerStyle:{paddingBottom:38},showsVerticalScrollIndicator:!1},s.React.createElement(Qe,null),s.React.createElement(ee,{spacing:8},s.React.createElement(h,{title:"Facts Commands"},s.React.createElement(f,{label:"Send as Reply",subLabel:"Send facts as a reply to the command message",value:o.storage.factSettings?.sendAsReply??!0,onValueChange:function(n){o.storage.factSettings.sendAsReply=n,t()}}),s.React.createElement(f,{label:"Include Source Citation",subLabel:"Include the source of facts when available",value:o.storage.factSettings?.includeCitation??!1,onValueChange:function(n){o.storage.factSettings.includeCitation=n,t()}}),s.React.createElement(f,{label:"/catfact",subLabel:"Get random cat facts",value:o.storage.enabledCommands?.catfact??!0,onValueChange:function(n){return r("catfact",n)}}),s.React.createElement(f,{label:"/dogfact",subLabel:"Get random dog facts",value:o.storage.enabledCommands?.dogfact??!0,onValueChange:function(n){return r("dogfact",n)}}),s.React.createElement(f,{label:"/useless",subLabel:"Get random useless facts",value:o.storage.enabledCommands?.useless??!0,onValueChange:function(n){return r("useless",n)}})),s.React.createElement(h,{title:"List Commands"},s.React.createElement(f,{label:"Always Send Detailed Plugin List",subLabel:"Always use detailed mode when listing plugins",value:o.storage.listSettings?.pluginListAlwaysDetailed??!1,onValueChange:function(n){o.storage.listSettings.pluginListAlwaysDetailed=n,t()}}),s.React.createElement(f,{label:"Always Send Detailed Theme List",subLabel:"Always use detailed mode when listing themes",value:o.storage.listSettings?.themeListAlwaysDetailed??!1,onValueChange:function(n){o.storage.listSettings.themeListAlwaysDetailed=n,t()}}),s.React.createElement(f,{label:"/plugin-list",subLabel:"List all installed plugins",value:o.storage.enabledCommands?.pluginList??!0,onValueChange:function(n){return r("pluginList",n)}}),s.React.createElement(f,{label:"/theme-list",subLabel:"List all installed themes",value:o.storage.enabledCommands?.themeList??!0,onValueChange:function(n){return r("themeList",n)}})),s.React.createElement(h,{title:"Petpet Commands"},s.React.createElement(f,{label:"/petpet",subLabel:"Create pet-pet GIF of a user",value:o.storage.enabledCommands?.petpet??!0,onValueChange:function(n){return r("petpet",n)}})),s.React.createElement(h,{title:"KonoChan Commands"},s.React.createElement(f,{label:"/konoself",subLabel:"Get random image from KonoChan (private)",value:o.storage.enabledCommands?.konoself??!0,onValueChange:function(n){return r("konoself",n)}}),s.React.createElement(f,{label:"/konosend",subLabel:"Send random image from KonoChan to channel",value:o.storage.enabledCommands?.konosend??!0,onValueChange:function(n){return r("konosend",n)}})),s.React.createElement(h,{title:"Message Commands"},s.React.createElement(f,{label:"/firstmessage",subLabel:"Get the first message in a channel",value:o.storage.enabledCommands?.firstmessage??!0,onValueChange:function(n){return r("firstmessage",n)}})),s.React.createElement(h,{title:"System Commands"},s.React.createElement(f,{label:"/sysinfo",subLabel:"Display system information",value:o.storage.enabledCommands?.sysinfo??!0,onValueChange:function(n){return r("sysinfo",n)}})),s.React.createElement(h,{title:"Spotify Commands"},s.React.createElement(f,{label:"/spotify track",subLabel:"Share your current Spotify track",value:o.storage.enabledCommands?.spotifyTrack??!0,onValueChange:function(n){return r("spotifyTrack",n)}}),s.React.createElement(f,{label:"/spotify album",subLabel:"Share your current track's album",value:o.storage.enabledCommands?.spotifyAlbum??!0,onValueChange:function(n){return r("spotifyAlbum",n)}}),s.React.createElement(f,{label:"/spotify artists",subLabel:"Share your current track's artists",value:o.storage.enabledCommands?.spotifyArtists??!0,onValueChange:function(n){return r("spotifyArtists",n)}}),s.React.createElement(f,{label:"/spotify cover",subLabel:"Share your current track's cover",value:o.storage.enabledCommands?.spotifyCover??!0,onValueChange:function(n){return r("spotifyCover",n)}})),s.React.createElement(h,{title:"Gary Commands"},s.React.createElement(f,{label:"/gary",subLabel:"Send random Gary images to channel",value:o.storage.enabledCommands?.gary??!0,onValueChange:function(n){return r("gary",n)}}))),s.React.createElement(et,{forceRerender:t}),s.React.createElement(s.ReactNative.View,{style:a.spacing}),s.React.createElement(ee,{spacing:8},s.React.createElement(h,{title:"Credits"},s.React.createElement(b,{label:"Facts Commands",subLabel:"by jdev082"}),s.React.createElement(b,{label:"List Commands",subLabel:"by Kitomanari"}),s.React.createElement(b,{label:"PetPet Command",subLabel:"by wolfieeee"}),s.React.createElement(b,{label:"KonoChan Commands",subLabel:"by btmc727 & Rico040"}),s.React.createElement(b,{label:"FirstMessage Command",subLabel:"by sapphire"}),s.React.createElement(b,{label:"Sysinfo Command",subLabel:"by mugman"}),s.React.createElement(b,{label:"Spotify Commands",subLabel:"by Kitomanari"}),s.React.createElement(b,{label:"Gary Command",subLabel:"by Zach Orange"})),s.React.createElement(h,{title:"About"},s.React.createElement(b,{label:"Commands",subLabel:"A collection of commands"}))),s.React.createElement(s.ReactNative.View,{style:a.spacing})))}o.storage.factSettings||(o.storage.factSettings={sendAsReply:!0,includeCitation:!1}),o.storage.listSettings||(o.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),o.storage.garySettings||(o.storage.garySettings={imageSource:"gary"}),o.storage.enabledCommands||(o.storage.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0,firstmessage:!0,sysinfo:!0,spotifyTrack:!0,spotifyAlbum:!0,spotifyArtists:!0,spotifyCover:!0,gary:!0});const nt={catfact:fe,dogfact:ge,useless:me,petpet:Te,pluginList:Ee,themeList:ve,konoself:Ae,konosend:ke,firstmessage:Me,sysinfo:Ve,spotifyTrack:qe,spotifyAlbum:Xe,spotifyArtists:ze,spotifyCover:He,gary:Ze};let x=[];var at={onLoad:function(){console.log("[All-In-One Commands] Loading plugin...");for(const[e,t]of Object.entries(nt))o.storage.enabledCommands[e]&&x.push(re.registerCommand(t));console.log("[All-In-One Commands] Plugin loaded successfully!")},onUnload:function(){console.log("[All-In-One Commands] Unloading plugin..."),x.forEach(function(e){return e()}),x=[],console.log("[All-In-One Commands] Plugin unloaded successfully!")},settings:tt};return B.default=at,Object.defineProperty(B,"__esModule",{value:!0}),B})({},vendetta.commands,vendetta.plugin,vendetta.metro,vendetta.themes,vendetta.plugins,vendetta.ui,vendetta.metro.common,vendetta.debug,vendetta.storage,vendetta.ui.assets); +Source: ${e.source}`),t},fe={name:"catfact",displayName:"catfact",description:"Sends a random cat fact.",displayDescription:"Sends a random cat fact.",applicationId:"-1",inputType:1,type:1,execute:async function(e,t){try{const n=await ue(),o=Date.now().toString();return _.sendMessage(t.channel.id,{content:x(n)},void 0,{nonce:o}),{type:4}}catch(n){return console.error("[CatFact] Error:",n),{type:4}}}},pe={name:"dogfact",displayName:"dogfact",description:"Sends a dog fact.",displayDescription:"Sends a dog fact.",applicationId:"-1",inputType:1,type:1,execute:async function(e,t){try{const n=await de(),o=Date.now().toString();return _.sendMessage(t.channel.id,{content:x(n)},void 0,{nonce:o}),{type:4}}catch(n){return console.error("[DogFact] Error:",n),{type:4}}}},me={name:"useless",displayName:"useless",description:"Sends a useless fact.",displayDescription:"Sends a useless fact.",applicationId:"-1",inputType:1,type:1,execute:async function(e,t){try{const n=await le(),o=Date.now().toString();return _.sendMessage(t.channel.id,{content:x(n)},void 0,{nonce:o}),{type:4}}catch(n){return console.error("[UselessFact] Error:",n),{type:4}}}},I={CONTENT:"This list is over 2000 characters. Send anyway?",CONFIRM:"Send",CANCEL:"Cancel"},he={DETAILED:"detailed"},O="",v={SLM_NOT_INSTALLED:"This list is over 2000 characters. Install the Split Large Messages plugin to send it.",SLM_NOT_ENABLED:"This list is over 2000 characters. Enable the Split Large Messages plugin to send it."},V={SEMICOL:"; ",NEW_LINE:` +`},Ce="Nothing to see here, huh...",j="github.com/fres621/vendetta-plugins",w={ENABLED:"\u2705",DISABLED:"\u274C",SELECTED:"\u2705",NOT_SELECTED:"\u274C"},Se=p.findByProps("sendMessage","receiveMessage"),E=p.findByProps("sendBotMessage"),F=function(){try{return p.findByStoreName("UserStore").getCurrentUser()?.premiumType===2?4e3:2e3}catch{return 2e3}}(),G=function(e){return Object.keys(e).includes(j)},W=function(e){return Object.values(e).find(function(t){return t.id==j})?.enabled},K=function(e){return e.find(function(t){return t.name===he.DETAILED})?.value??!1},R=function(e){return!e||!Array.isArray(e)||e.length===0?"Unknown":e.filter(function(t){return t&&(typeof t=="string"||typeof t=="object"&&t.name)}).map(function(t){return typeof t=="string"?t:t.name||"Unknown"}).join(V.SEMICOL)||"Unknown"},z=function(e){return e.join(V.NEW_LINE).trimEnd()},T=function(e){return z(e).length},L=async function(e,t){const n=Date.now().toString();await Se.sendMessage(e,{content:z(t)},void 0,{nonce:n})},q=function(e,t){return[`**My ${e} List | ${t} ${e}s**`,O]};async function be(e,t){try{const n=K(e),o=s.storage.themeListAlwaysDetailed??!1;if(!A.themes||typeof A.themes!="object"){const f=t.channel.id;return E.sendBotMessage(f,"No themes found or themes not loaded yet."),{type:4}}const i=Object.values(A.themes),r=t.channel.id,c=q("Theme",Object.keys(A.themes).length);if(i.length)for(const f of i){if(!f||typeof f!="object")continue;const{selected:d,data:u,id:C}=f,N=u?.name||"Unknown Theme",D=u?.description||"No description",B=u?.authors;n||o?c.push(`> **Name**: ${N}`,`> **Selected**: ${d?w.SELECTED:w.NOT_SELECTED}`,`> **Description**: ${D}`,`> **Authors**: ${R(B)}`,`> **[Install!](${C||"unknown"})**`,O):c.push(`> ${d?w.SELECTED:w.NOT_SELECTED} **${N}** by ${R(B)}`)}else c.push(Ce);const g=T(c)>F;if(g&&!G(b.plugins))E.sendBotMessage(r,v.SLM_NOT_INSTALLED);else if(g&&!W(b.plugins))E.sendBotMessage(r,v.SLM_NOT_ENABLED);else{if(T(c)>2e3)return h.alerts.showConfirmationAlert({content:I.CONTENT,confirmText:I.CONFIRM,cancelText:I.CANCEL,onConfirm:async function(){return await L(r,c)}});await L(r,c)}}catch(n){return console.error("[ThemeList] Error:",n),{type:4}}}async function we(e,t){try{const n=K(e),o=s.storage.pluginListAlwaysDetailed??!1,i=t.channel.id;if(!b.plugins||typeof b.plugins!="object")return E.sendBotMessage(i,"No plugins found or plugins not loaded yet."),{type:4};const r=q("Plugin",Object.keys(b.plugins).length);for(const g of Object.values(b.plugins)){if(!g||typeof g!="object")continue;const{enabled:f,manifest:d,id:u}=g,C=d?.name||"Unknown Plugin",N=d?.description||"No description",D=d?.authors;n||o?r.push(`> **Name**: ${C}`,`> **Status**: ${f?w.ENABLED:w.DISABLED}`,`> **Description**: ${N}`,`> **Authors**: ${R(D)}`,`> **[Install!](${u||"unknown"})**`,O):r.push(`> ${f?w.ENABLED:w.DISABLED} **${C}** by ${R(D)}`)}const c=T(r)>F;if(c&&!G(b.plugins))E.sendBotMessage(i,v.SLM_NOT_INSTALLED);else if(c&&!W(b.plugins))E.sendBotMessage(i,v.SLM_NOT_ENABLED);else{if(T(r)>2e3)return h.alerts.showConfirmationAlert({content:I.CONTENT,confirmText:I.CONFIRM,cancelText:I.CANCEL,onConfirm:async function(){return await L(i,r)}});await L(i,r)}}catch(n){return console.error("[PluginList] Error:",n),{type:4}}}const Ie={name:"plugin-list",displayName:"plugin list",description:"Send your plugin list to the current channel",displayDescription:"Send your plugin list to the current channel",options:[{name:"detailed",description:"Whether to send a list with detailed information.",type:5,required:!1,displayName:"detailed",displayDescription:"Whether to send a list with detailed information."}],execute:we,applicationId:"-1",inputType:1,type:1},Ee={name:"theme-list",displayName:"theme list",description:"Send your theme list to the current channel",displayDescription:"Send your theme list to the current channel",options:[{name:"detailed",description:"Whether to send a list with detailed information.",type:5,required:!1,displayName:"detailed",displayDescription:"Whether to send a list with detailed information."}],execute:be,applicationId:"-1",inputType:1,type:1},Ne=p.findByStoreName("UserStore"),De=p.findByProps("sendMessage"),Ae={name:"petpet",displayName:"petpet",description:"PetPet someone",displayDescription:"PetPet someone",options:[{name:"user",description:"The user(or their id) to be patted",type:6,required:!0,displayName:"user",displayDescription:"The user(or their id) to be patted"}],execute:async function(e,t){try{const n=(await Ne.getUser(e[0].value)).getAvatarURL(512),o=await ye(n),i=Date.now().toString();return De.sendMessage(t.channel.id,{content:o.url},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[PetPet] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},ve=p.findByProps("sendMessage"),Re=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),H=async function(e){const t="https://konachan.com/post.json",n=e?"rating:explicit":"rating:safe",o=Math.floor(Math.random()*100);try{const i=await(await fetch(`${t}?tags=${n}&limit=1&page=${o}`)).json();return!Array.isArray(i)||i.length===0?null:i[0].file_url}catch(i){return console.error("[KonoChan Randomizer] Error fetching image:",i),null}},X=function(){return h.alerts.showConfirmationAlert({title:"NSFW Content Warning",content:"NSFW content can only be sent in NSFW channels!",confirmText:"Okay",cancelText:null,confirmColor:"brand",isDismissable:!0})},Y={name:"nsfw",description:"Include NSFW content?",type:5,required:!1,displayName:"nsfw",displayDescription:"Include NSFW content?"},Te={name:"konoself",displayName:"konoself",description:"Fetch a random image from KonoChan for yourself.",displayDescription:"Fetch a random image from KonoChan for yourself.",options:[Y],execute:async function(e,t){try{const n=new Map(e.map(function(i){return[i.name,i]})).get("nsfw")?.value||!1;if(n&&!t.channel.nsfw)return X(),{type:4};const o=await H(n);return o?(Re.sendBotMessage(t.channel.id,`Here's your random image: ${o}`),{type:4}):{type:4}}catch(n){return console.error("[KonoSelf] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},Le={name:"konosend",displayName:"konosend",description:"Fetch a random image from KonoChan and send it to the channel.",displayDescription:"Fetch a random image from KonoChan and send it to the channel.",options:[Y],execute:async function(e,t){try{const n=new Map(e.map(function(r){return[r.name,r]})).get("nsfw")?.value||!1;if(n&&!t.channel.nsfw)return X(),{type:4};const o=await H(n);if(!o)return{type:4};const i=Date.now().toString();return ve.sendMessage(t.channel.id,{content:o},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[KonoSend] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},Q=p.findByProps("getAPIBaseURL","get"),ke=p.findByProps("sendMessage"),k=async function(e,t,n){const o=t?`&author_id=${t}`:"",i=n?`&channel_id=${n}`:"",r=t?"":"&min_id=0";return(await Q.get({url:`/guilds/${e}/messages/search`,query:`include_nsfw=true${o}${i}${r}&sort_by=timestamp&sort_order=asc&offset=0`})).body.messages[0][0]},Z=async function(e,t){const n=t?`&author_id=${t}`:"",o=t?"":"&min_id=0";return(await Q.get({url:`/channels/${e}/messages/search`,query:`&sort_by=timestamp&sort_order=asc&offset=0${n}${o}`})).body.messages[0][0]},$e={name:"firstmessage",displayName:"firstmessage",description:"Tired of scrolling to first message?",displayDescription:"Tired of scrolling to first message?",options:[{name:"user",displayName:"user",description:"Target user to get their first message in this server/dm",displayDescription:"Target user to get their first message in this server/dm",type:6,required:!1},{name:"channel",displayName:"channel",description:"Target channel to get first message of",displayDescription:"Target channel to get first message of",type:7,required:!1},{name:"send",displayName:"send",description:"Whether to send the resulting url",displayDescription:"Whether to send the resulting url",type:5,required:!1}],execute:async function(e,t){try{const n=new Map(e.map(function(C){return[C.name,C]})),o=n.get("user")?.value,i=n.get("channel")?.value,r=n.get("send")?.value,c=t.guild?.id,g=t.channel.id,f=t.channel.type===1;let d="https://discord.com/channels/",u;if(!o&&!i)f?(u=await Z(g),d+=`@me/${g}/${u.id}`):(u=await k(c),d+=`${c}/${u.channel_id}/${u.id}`);else if(o)f?(u=await Z(g,o),d+=`@me/${g}/${u.id}`):(u=await k(c,o),d+=`${c}/${u.channel_id}/${u.id}`);else if(i){if(f)return{type:4};u=await k(c,null,i),d+=`${c}/${i}/${u.id}`}else{if(f)return{type:4};u=await k(c,o,i),d+=`${c}/${i}/${u.id}`}if(r){const C=Date.now().toString();return ke.sendMessage(t.channel.id,{content:d},void 0,{nonce:C}),{type:4}}else return a.url.openDeeplink(d),{type:4}}catch(n){return console.error("[FirstMessage] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},Be=p.findByProps("sendMessage"),Me=p.findByProps("sendBotMessage","sendMessage","receiveMessage");function Pe(){let{height:e,width:t,scale:n}=a.ReactNative.Dimensions.get("screen");return e*=n,t*=n,{width:t,height:e}}function _e(){try{const e=p.findByProps("memory");if(!e)return{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A",netInfo:"N/A"};const{cpuCoreCount:t,cpuPercentage:n,memory:o}=e,i=n?n.toFixed(2)+"%":"N/A",r=o?parseFloat((o/1e3).toPrecision(3))+" MB":"N/A";let c="N/A";try{const g=p.findByProps("useNetInfo");if(g){const f=Object.values(g.fetch()).filter(function(d){return d?.type})[0];if(f){const{type:d,details:u}=f;c={wifi:"WiFi",ethernet:"Ethernet",other:"Unknown",bluetooth:"Bluetooth",wimax:"WiMAX",vpn:"VPN",cellular:u?.cellularGeneration?.toUpperCase()||"Cellular"}[d]??d}}}catch(g){console.warn("Network info unavailable:",g)}return{cpuCoreCount:t,cpuPerc:i,memUsage:r,netInfo:c}}catch(e){return console.warn("Hardware info unavailable:",e),{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A",netInfo:"N/A"}}}function xe(){try{const{NativeModules:e}=a.ReactNative;return(e.InfoDictionaryManager??e.RTNClientInfoManager)||{}}catch(e){return console.warn("Discord info unavailable:",e),{}}}function Oe(){try{const{cpuCoreCount:e,cpuPerc:t,memUsage:n,netInfo:o}=_e(),i=xe(),{vendetta:r,discord:c,react:g,hermes:f,os:d,device:u}=oe.getDebugInfo(),{version:C,bytecodeVersion:N}=f||{},{version:D,nativeVersion:B}=g||{},{name:te,version:at,sdk:ne}=d||{},{manufacturer:st,brand:ae,model:se,codename:rt}=u||{},{version:ot}=r||{},{version:it,build:ct}=c||{},{ReleaseChannel:lt}=i,dt=te=="iOS"?rt:`${ae} ${se}`,{width:ut,height:yt}=Pe();let M={Device:{Device:dt||"Unknown",Model:se||"Unknown",Manufacturer:st||"Unknown",Brand:ae||"Unknown",Display:`${ut}x${yt}`},Hardware:{"CPU Cores":e||"N/A",Network:o},Software:{OS:te||"Unknown",Version:at||"Unknown"},Discord:{Branch:lt||"Unknown",Version:it||"Unknown",Build:ct||"Unknown",Vendetta:ot||"Unknown","CPU Usage":t,"Memory Usage":n},React:{Version:D||"Unknown","Hermes Bytecode":N||"Unknown",Hermes:C||"Unknown",Native:B||"Unknown"}};return window.enmity&&(M.Discord.Enmity=window.enmity.version),window.aliucord&&(M.Discord.Aliucord=window.aliucord.version),ne&&(M.Software["SDK Version"]=ne),M}catch(e){throw console.error("Error generating system info:",e),e}}const J=["device","hardware","software","discord","react","ephemeral"];for(const e of J)s.storage[e]===void 0&&(s.storage[e]=!0);function Ue(e,t){try{let n=[`__System Information__ +`];const o=Oe();Object.keys(o).forEach(function(c){const g=s.storage[c.toLowerCase()],f=e.find(function(d){return d.name==c.toLowerCase()})?.value??g;(f||g)&&!(g&&!f)&&(n.push(`[**${c}**]`),Object.keys(o[c]).forEach(function(d){n.push(`> ${d}: ${o[c][d]}`)}))});const i=s.storage.ephemeral,r=e.find(function(c){return c.name=="ephemeral"})?.value??i;if((r||i)&&!(i&&!r))return Me.sendBotMessage(t.channel.id,n.join(` +`)),{type:4};{const c=Date.now().toString();return Be.sendMessage(t.channel.id,{content:n.join(` +`)},void 0,{nonce:c}),{type:4}}}catch(n){return console.error("[Sysinfo] Error:",n),{type:4}}}const Ve={name:"sysinfo",displayName:"sysinfo",description:"Display system information",displayDescription:"Display system information",options:[{name:"ephemeral",displayName:"ephemeral",description:"Keep sysinfo ephemeral (default: true)",displayDescription:"Keep sysinfo ephemeral (default: true)",type:5,required:!1},...J.slice(0,-1).map(function(e){return{name:e,displayName:e,description:`Display the ${e} section. Set default in settings.`,displayDescription:`Display the ${e} section. Set default in settings.`,type:5,required:!1}})],execute:Ue,applicationId:"-1",inputType:1,type:1},ee=p.findByProps("sendMessage","receiveMessage"),je=p.findByStoreName("SpotifyStore");async function Fe(e,t){return s.storage.enabledCommands?.spotifyTrack?$(t,function(n){return`https://open.spotify.com/track/${n.id}`}):{type:4}}async function Ge(e,t){return s.storage.enabledCommands?.spotifyAlbum?$(t,function(n){return`https://open.spotify.com/album/${n.album.id}`}):{type:4}}async function We(e,t){return s.storage.enabledCommands?.spotifyArtists?$(t,function(n){return n.artists.map(function(o){return`[${o.name}](${o.external_urls.spotify})`}).join(` +`)}):{type:4}}async function Ke(e,t){return s.storage.enabledCommands?.spotifyCover?$(t,function(n){return n.album.image.url}):{type:4}}async function $(e,t){try{const n=e.channel.id,o=je?.getTrack?.();if(!o){const c=Date.now().toString();return ee.sendMessage(n,{content:"You are not listening to any track."},void 0,{nonce:c}),{type:4}}const i=t(o),r=Date.now().toString();return ee.sendMessage(n,{content:i},void 0,{nonce:r}),{type:4}}catch(n){return console.error("[Spotify Command] Error:",n),{type:4}}}const ze={name:"spotify track",displayName:"spotify track",description:"Sends your current Spotify track",displayDescription:"Sends your current Spotify track",applicationId:"-1",inputType:1,type:1,execute:Fe},qe={name:"spotify album",displayName:"spotify album",description:"Sends your current track's album",displayDescription:"Sends your current track's album",applicationId:"-1",inputType:1,type:1,execute:Ge},He={name:"spotify artists",displayName:"spotify artists",description:"Sends your current track's artists",displayDescription:"Sends your current track's artists",applicationId:"-1",inputType:1,type:1,execute:We},Xe={name:"spotify cover",displayName:"spotify cover",description:"Sends your current track's cover",displayDescription:"Sends your current track's cover",applicationId:"-1",inputType:1,type:1,execute:Ke},Ye=p.findByProps("sendMessage"),Qe={name:"gary",displayName:"gary",description:"Send a random Gary image to the channel.",displayDescription:"Send a random Gary image to the channel.",options:[],execute:async function(e,t){try{let n="gary";s.storage.garySettings?.useCatAPI?n="catapi":s.storage.garySettings?.useMinkerAPI?n="minker":s.storage.garySettings?.useGooberAPI&&(n="goober");const o=await ge(n);if(!o)return{type:4};const i=Date.now().toString();return Ye.sendMessage(t.channel.id,{content:o},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[Gary] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},{ScrollView:Ze}=p.findByProps("ScrollView");p.findByProps("TableSwitchRow","TableRowGroup","Stack","TableRow");const{FormRow:y,FormSwitchRow:m}=ce.Forms;function S({title:e,icon:t,children:n,padding:o=!1}){const i=a.stylesheet.createThemedStyleSheet({main:{backgroundColor:h.semanticColors.CARD_PRIMARY_BG,borderColor:h.semanticColors.BORDER_FAINT,borderWidth:1,borderRadius:16,overflow:"hidden",flex:1},titleContainer:{marginBottom:8,marginHorizontal:0,marginTop:8,gap:4,flexDirection:"row",alignItems:"center"},icon:{width:16,height:16,marginTop:1.5,tintColor:h.semanticColors.TEXT_MUTED},titleText:{fontSize:14,fontWeight:"600",color:h.semanticColors.TEXT_MUTED}});return a.React.createElement(a.ReactNative.View,{style:{marginHorizontal:16,marginTop:16}},e&&a.React.createElement(a.ReactNative.View,{style:i.titleContainer},t&&a.React.createElement(a.ReactNative.Image,{style:i.icon,source:t,resizeMode:"cover"}),a.React.createElement(a.ReactNative.Text,{style:i.titleText},e.toUpperCase())),a.React.createElement(a.ReactNative.View,{style:i.main},o?a.React.createElement(a.ReactNative.View,{style:{paddingHorizontal:16,paddingVertical:16}},n):n))}function Je(){const e=a.stylesheet.createThemedStyleSheet({container:{flexDirection:"column",alignItems:"center",paddingVertical:24,paddingHorizontal:16},title:{fontSize:28,fontWeight:"700",color:h.semanticColors.TEXT_NORMAL,marginBottom:4},subtitle:{fontSize:16,fontWeight:"500",color:h.semanticColors.TEXT_MUTED},iconContainer:{backgroundColor:h.semanticColors.BACKGROUND_SECONDARY,borderRadius:16,padding:12,marginBottom:16},icon:{width:32,height:32,tintColor:h.semanticColors.TEXT_NORMAL}});return a.React.createElement(a.ReactNative.View,{style:e.container},a.React.createElement(a.ReactNative.View,{style:e.iconContainer},a.React.createElement(a.ReactNative.Image,{source:l.getAssetIDByName("SettingsIcon"),style:e.icon})),a.React.createElement(a.ReactNative.Text,{style:e.title},"Commands"),a.React.createElement(a.ReactNative.Text,{style:e.subtitle},"A collection of useful commands"))}s.storage.factSettings||(s.storage.factSettings={sendAsReply:!0,includeCitation:!1}),s.storage.listSettings||(s.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),s.storage.garySettings||(s.storage.garySettings={imageSource:"gary"}),s.storage.enabledCommands||(s.storage.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0,firstmessage:!0,sysinfo:!0,spotifyTrack:!0,spotifyAlbum:!0,spotifyArtists:!0,spotifyCover:!0,gary:!0}),s.storage.pendingRestart||(s.storage.pendingRestart=!1);function et(){ie.useProxy(s.storage);const[e,t]=a.React.useReducer(function(r){return r+1},0),n=a.stylesheet.createThemedStyleSheet({container:{flex:1,backgroundColor:h.semanticColors.BACKGROUND_PRIMARY},spacing:{height:16}});a.React.useEffect(function(){return function(){s.storage.pendingRestart&&(s.storage.pendingRestart=!1,h.alerts.showConfirmationAlert({title:"Restart Required",content:"You have made changes to commands. Please restart Discord to apply these changes.",confirmText:"Okay",cancelText:null}))}},[]);const o=function(r,c){s.storage.enabledCommands[r]=c,s.storage.pendingRestart=!0,t()},i=function(){h.alerts.showConfirmationAlert({title:"Choose Gary Image Source",content:"Select an image source for the Gary command:",confirmText:"Gary API",cancelText:"Other Options",confirmColor:"brand",onConfirm:function(){s.storage.garySettings.imageSource="gary",t()},onCancel:function(){h.alerts.showConfirmationAlert({title:"Choose Image Source",content:"Select from remaining options:",confirmText:"Cat API",cancelText:"More Options",confirmColor:"brand",onConfirm:function(){s.storage.garySettings.imageSource="catapi",t()},onCancel:function(){h.alerts.showConfirmationAlert({title:"Choose Image Source",content:"Select from final options:",confirmText:"Minker API",cancelText:"Goober API",confirmColor:"brand",onConfirm:function(){s.storage.garySettings.imageSource="minker",t()},onCancel:function(){s.storage.garySettings.imageSource="goober",t()}})}})}})};return a.React.createElement(a.ReactNative.View,{style:n.container},a.React.createElement(Ze,{style:{flex:1},contentContainerStyle:{paddingBottom:38},showsVerticalScrollIndicator:!1},a.React.createElement(Je,null),a.React.createElement(S,{title:"Facts Commands",icon:l.getAssetIDByName("BookIcon")},a.React.createElement(m,{label:"Send as Reply",subLabel:"Send facts as a reply to the command message",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("ReplyIcon")}),value:s.storage.factSettings?.sendAsReply??!0,onValueChange:function(r){s.storage.factSettings.sendAsReply=r,t()}}),a.React.createElement(m,{label:"Include Source Citation",subLabel:"Include the source of facts when available",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("LinkIcon")}),value:s.storage.factSettings?.includeCitation??!1,onValueChange:function(r){s.storage.factSettings.includeCitation=r,t()}}),a.React.createElement(m,{label:"/catfact",subLabel:"Get random cat facts",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("ic_cat")}),value:s.storage.enabledCommands?.catfact??!0,onValueChange:function(r){return o("catfact",r)}}),a.React.createElement(m,{label:"/dogfact",subLabel:"Get random dog facts",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("ic_dog")}),value:s.storage.enabledCommands?.dogfact??!0,onValueChange:function(r){return o("dogfact",r)}}),a.React.createElement(m,{label:"/useless",subLabel:"Get random useless facts",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("QuestionMarkIcon")}),value:s.storage.enabledCommands?.useless??!0,onValueChange:function(r){return o("useless",r)}})),a.React.createElement(S,{title:"List Commands",icon:l.getAssetIDByName("ListIcon")},a.React.createElement(m,{label:"Always Send Detailed Plugin List",subLabel:"Always use detailed mode when listing plugins",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("PuzzlePieceIcon")}),value:s.storage.listSettings?.pluginListAlwaysDetailed??!1,onValueChange:function(r){s.storage.listSettings.pluginListAlwaysDetailed=r,t()}}),a.React.createElement(m,{label:"Always Send Detailed Theme List",subLabel:"Always use detailed mode when listing themes",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("PaintPaletteIcon")}),value:s.storage.listSettings?.themeListAlwaysDetailed??!1,onValueChange:function(r){s.storage.listSettings.themeListAlwaysDetailed=r,t()}}),a.React.createElement(m,{label:"/plugin-list",subLabel:"List all installed plugins",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("PuzzlePieceIcon")}),value:s.storage.enabledCommands?.pluginList??!0,onValueChange:function(r){return o("pluginList",r)}}),a.React.createElement(m,{label:"/theme-list",subLabel:"List all installed themes",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("PaintPaletteIcon")}),value:s.storage.enabledCommands?.themeList??!0,onValueChange:function(r){return o("themeList",r)}})),a.React.createElement(S,{title:"Image Commands",icon:l.getAssetIDByName("ImageIcon")},a.React.createElement(m,{label:"/petpet",subLabel:"Create pet-pet GIF of a user",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("HandIcon")}),value:s.storage.enabledCommands?.petpet??!0,onValueChange:function(r){return o("petpet",r)}})),a.React.createElement(S,{title:"Gary Commands",icon:l.getAssetIDByName("ic_cat")},a.React.createElement(m,{label:"/gary",subLabel:"Send random Gary images to channel",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("ic_cat")}),value:s.storage.enabledCommands?.gary??!0,onValueChange:function(r){return o("gary",r)}}),a.React.createElement(y,{label:"Gary Image Source",subLabel:`Current: ${s.storage.garySettings?.imageSource==="gary"?"Gary API":s.storage.garySettings?.imageSource==="catapi"?"Cat API":s.storage.garySettings?.imageSource==="minker"?"Minker API":s.storage.garySettings?.imageSource==="goober"?"Goober API":"Gary API"}`,leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("DownloadIcon")}),trailing:a.React.createElement(y.Arrow,null),onPress:i})),a.React.createElement(S,{title:"KonoChan Commands",icon:l.getAssetIDByName("ImageIcon")},a.React.createElement(m,{label:"/konoself",subLabel:"Get random image from KonoChan (private)",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("EyeIcon")}),value:s.storage.enabledCommands?.konoself??!0,onValueChange:function(r){return o("konoself",r)}}),a.React.createElement(m,{label:"/konosend",subLabel:"Send random image from KonoChan to channel",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("ImageIcon")}),value:s.storage.enabledCommands?.konosend??!0,onValueChange:function(r){return o("konosend",r)}})),a.React.createElement(S,{title:"Message Commands",icon:l.getAssetIDByName("ChatIcon")},a.React.createElement(m,{label:"/firstmessage",subLabel:"Get the first message in a channel",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("ChatIcon")}),value:s.storage.enabledCommands?.firstmessage??!0,onValueChange:function(r){return o("firstmessage",r)}})),a.React.createElement(S,{title:"System Commands",icon:l.getAssetIDByName("SettingsIcon")},a.React.createElement(m,{label:"/sysinfo",subLabel:"Display system information",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("SettingsIcon")}),value:s.storage.enabledCommands?.sysinfo??!0,onValueChange:function(r){return o("sysinfo",r)}})),a.React.createElement(S,{title:"Spotify Commands",icon:l.getAssetIDByName("SpotifyIcon")},a.React.createElement(m,{label:"/spotify track",subLabel:"Share your current Spotify track",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("SpotifyIcon")}),value:s.storage.enabledCommands?.spotifyTrack??!0,onValueChange:function(r){return o("spotifyTrack",r)}}),a.React.createElement(m,{label:"/spotify album",subLabel:"Share your current track's album",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("SpotifyIcon")}),value:s.storage.enabledCommands?.spotifyAlbum??!0,onValueChange:function(r){return o("spotifyAlbum",r)}}),a.React.createElement(m,{label:"/spotify artists",subLabel:"Share your current track's artists",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("SpotifyIcon")}),value:s.storage.enabledCommands?.spotifyArtists??!0,onValueChange:function(r){return o("spotifyArtists",r)}}),a.React.createElement(m,{label:"/spotify cover",subLabel:"Share your current track's cover",leading:a.React.createElement(y.Icon,{source:l.getAssetIDByName("SpotifyIcon")}),value:s.storage.enabledCommands?.spotifyCover??!0,onValueChange:function(r){return o("spotifyCover",r)}})),a.React.createElement(S,{title:"Credits",icon:l.getAssetIDByName("PeopleIcon"),padding:!0},a.React.createElement(a.ReactNative.Text,{style:{fontSize:14,color:h.semanticColors.TEXT_MUTED,lineHeight:20}},"Facts Commands by jdev082",` +`,"List Commands by Kitomanari",` +`,"PetPet Command by wolfieeee",` +`,"KonoChan Commands by btmc727 & Rico040",` +`,"FirstMessage Command by sapphire",` +`,"Sysinfo Command by mugman",` +`,"Spotify Commands by Kitomanari",` +`,"Gary Command by Zach Orange")),a.React.createElement(a.ReactNative.View,{style:n.spacing})))}s.storage.factSettings||(s.storage.factSettings={sendAsReply:!0,includeCitation:!1}),s.storage.listSettings||(s.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),s.storage.garySettings||(s.storage.garySettings={imageSource:"gary"}),s.storage.enabledCommands||(s.storage.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0,firstmessage:!0,sysinfo:!0,spotifyTrack:!0,spotifyAlbum:!0,spotifyArtists:!0,spotifyCover:!0,gary:!0});const tt={catfact:fe,dogfact:pe,useless:me,petpet:Ae,pluginList:Ie,themeList:Ee,konoself:Te,konosend:Le,firstmessage:$e,sysinfo:Ve,spotifyTrack:ze,spotifyAlbum:qe,spotifyArtists:He,spotifyCover:Xe,gary:Qe};let U=[];var nt={onLoad:function(){console.log("[All-In-One Commands] Loading plugin...");for(const[e,t]of Object.entries(tt))s.storage.enabledCommands[e]&&U.push(re.registerCommand(t));console.log("[All-In-One Commands] Plugin loaded successfully!")},onUnload:function(){console.log("[All-In-One Commands] Unloading plugin..."),U.forEach(function(e){return e()}),U=[],console.log("[All-In-One Commands] Plugin unloaded successfully!")},settings:et};return P.default=nt,Object.defineProperty(P,"__esModule",{value:!0}),P})({},vendetta.commands,vendetta.plugin,vendetta.metro,vendetta.themes,vendetta.plugins,vendetta.ui,vendetta.metro.common,vendetta.debug,vendetta.storage,vendetta.ui.assets,vendetta.ui.components); diff --git a/Commands/manifest.json b/Commands/manifest.json index 739dddc..87c6b79 100644 --- a/Commands/manifest.json +++ b/Commands/manifest.json @@ -1 +1 @@ -{"authors":[{"name":"kmmiio99o","id":"879393496627306587"}],"main":"index.js","name":"Commands","description":"A collection of fixed commands including facts, petpet, and more.","vendetta":{"icon":"ic_badge_staff","original":"plugins/all-in-one"},"version":"1.0.0","hash":"7709990c63de73598fe835096aa19392bf235355b8bfbcc2211e19916ee84df1"} \ No newline at end of file +{"authors":[{"name":"kmmiio99o","id":"879393496627306587"}],"main":"index.js","name":"Commands","description":"A collection of fixed commands including facts, petpet, and more.","vendetta":{"icon":"ic_badge_staff","original":"plugins/all-in-one"},"version":"1.0.0","hash":"5a61a50bfe6dbf2ea1871dbabdeb1b35361ce532b691dc0ea915c9acca360941"} \ No newline at end of file