vd-plugins/Commands/index.js
2025-10-01 14:29:28 +00:00

10 lines
35 KiB
JavaScript

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