vd-plugins/Commands/index.js

20 lines
69 KiB
JavaScript
Raw Normal View History

(function(ne,He,r,p,W,w,u,e,ye,b,o,I,v,G,re,Ke){"use strict";const qe=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}},Ye=async function(){return{text:(await(await fetch("https://dogapi.dog/api/v2/facts?limit=1")).json()).data[0].attributes.body}},Xe=async function(){const t=await(await fetch("https://catfact.ninja/fact")).json();return{text:t.fact,length:t.length}},Je=async function(t){return await(await fetch(`https://api.obamabot.me/v2/image/petpet?image=${t.replace("webp","png")}`)).json()},Qe=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}},ie=p.findByProps("sendMessage"),se=function(t){let a=t.text;return r.storage.factSettings?.includeCitation&&t.source&&(a+=`
2025-09-27 19:17:53 +02:00
Source: ${t.source}`),a},Ze={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 Xe(),i=Date.now().toString();return ie.sendMessage(a.channel.id,{content:se(n)},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[CatFact] Error:",n),{type:4}}}},et={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 Ye(),i=Date.now().toString();return ie.sendMessage(a.channel.id,{content:se(n)},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[DogFact] Error:",n),{type:4}}}},tt={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 qe(),i=Date.now().toString();return ie.sendMessage(a.channel.id,{content:se(n)},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[UselessFact] Error:",n),{type:4}}}},T={CONTENT:"This list is over 2000 characters. Send anyway?",CONFIRM:"Send",CANCEL:"Cancel"},at={DETAILED:"detailed"},oe="",O={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."},pe={SEMICOL:"; ",NEW_LINE:`
`},nt="Nothing to see here, huh...",me="github.com/fres621/vendetta-plugins",S={ENABLED:"\u2705",DISABLED:"\u274C",SELECTED:"\u2705",NOT_SELECTED:"\u274C"},rt=p.findByProps("sendMessage","receiveMessage"),D=p.findByProps("sendBotMessage"),he=(function(){try{return p.findByStoreName("UserStore").getCurrentUser()?.premiumType===2?4e3:2e3}catch{return 2e3}})(),Ce=function(t){return Object.keys(t).includes(me)},be=function(t){return Object.values(t).find(function(a){return a.id==me})?.enabled},Re=function(t){return t.find(function(a){return a.name===at.DETAILED})?.value??!1},z=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(pe.SEMICOL)||"Unknown"},ve=function(t){return t.join(pe.NEW_LINE).trimEnd()},j=function(t){return ve(t).length},H=async function(t,a){const n=Date.now().toString();await rt.sendMessage(t,{content:ve(a)},void 0,{nonce:n})},Ie=function(t,a){return[`**My ${t} List | ${a} ${t}s**`,oe]};async function it(t,a){try{const n=Re(t),i=r.storage.themeListAlwaysDetailed??!1;if(!W.themes||typeof W.themes!="object"){const g=a.channel.id;return D.sendBotMessage(g,"No themes found or themes not loaded yet."),{type:4}}const s=Object.values(W.themes),c=a.channel.id,d=Ie("Theme",Object.keys(W.themes).length);if(s.length)for(const g of s){if(!g||typeof g!="object")continue;const{selected:f,data:y,id:C}=g,E=y?.name||"Unknown Theme",N=y?.description||"No description",k=y?.authors;n||i?d.push(`> **Name**: ${E}`,`> **Selected**: ${f?S.SELECTED:S.NOT_SELECTED}`,`> **Description**: ${N}`,`> **Authors**: ${z(k)}`,`> **[Install!](${C||"unknown"})**`,oe):d.push(`> ${f?S.SELECTED:S.NOT_SELECTED} **${E}** by ${z(k)}`)}else d.push(nt);const l=j(d)>he;if(l&&!Ce(w.plugins))D.sendBotMessage(c,O.SLM_NOT_INSTALLED);else if(l&&!be(w.plugins))D.sendBotMessage(c,O.SLM_NOT_ENABLED);else{if(j(d)>2e3)return u.alerts.showConfirmationAlert({content:T.CONTENT,confirmText:T.CONFIRM,cancelText:T.CANCEL,onConfirm:async function(){return await H(c,d)}});await H(c,d)}}catch(n){return console.error("[ThemeList] Error:",n),{type:4}}}async function st(t,a){try{const n=Re(t),i=r.storage.pluginListAlwaysDetailed??!1,s=a.channel.id;if(!w.plugins||typeof w.plugins!="object")return D.sendBotMessage(s,"No plugins found or plugins not loaded yet."),{type:4};const c=Ie("Plugin",Object.keys(w.plugins).length);for(const l of Object.values(w.plugins)){if(!l||typeof l!="object")continue;const{enabled:g,manifest:f,id:y}=l,C=f?.name||"Unknown Plugin",E=f?.description||"No description",N=f?.authors;n||i?c.push(`> **Name**: ${C}`,`> **Status**: ${g?S.ENABLED:S.DISABLED}`,`> **Description**: ${E}`,`> **Authors**: ${z(N)}`,`> **[Install!](${y||"unknown"})**`,oe):c.push(`> ${g?S.ENABLED:S.DISABLED} **${C}** by ${z(N)}`)}const d=j(c)>he;if(d&&!Ce(w.plugins))D.sendBotMessage(s,O.SLM_NOT_INSTALLED);else if(d&&!be(w.plugins))D.sendBotMessage(s,O.SLM_NOT_ENABLED);else{if(j(c)>2e3)return u.alerts.showConfirmationAlert({content:T.CONTENT,confirmText:T.CONFIRM,cancelText:T.CANCEL,onConfirm:async function(){return await H(s,c)}});await H(s,c)}}catch(n){return console.error("[PluginList] Error:",n),{type:4}}}const ot={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:st,applicationId:"-1",inputType:1,type:1},ct={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:it,applicati
`],i=Nt();Object.keys(i).forEach(function(d){const l=r.storage[d.toLowerCase()],g=t.find(function(f){return f.name==d.toLowerCase()})?.value??l;(g||l)&&!(l&&!g)&&(n.push(`[**${d}**]`),Object.keys(i[d]).forEach(function(f){n.push(`> ${f}: ${i[d][f]}`)}))});const s=r.storage.ephemeral,c=t.find(function(d){return d.name=="ephemeral"})?.value??s;if((c||s)&&!(s&&!c))return vt.sendBotMessage(a.channel.id,n.join(`
`)),{type:4};{const d=Date.now().toString();return Rt.sendMessage(a.channel.id,{content:n.join(`
`)},void 0,{nonce:d}),{type:4}}}catch(n){return console.error("[Sysinfo] Error:",n),{type:4}}}const Tt={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},...Ae.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:At,applicationId:"-1",inputType:1,type:1},Te=p.findByProps("sendMessage","receiveMessage"),Dt=p.findByStoreName("SpotifyStore");async function kt(t,a){return r.storage.enabledCommands?.spotifyTrack?K(a,function(n){return`https://open.spotify.com/track/${n.id}`}):{type:4}}async function Bt(t,a){return r.storage.enabledCommands?.spotifyAlbum?K(a,function(n){return`https://open.spotify.com/album/${n.album.id}`}):{type:4}}async function xt(t,a){return r.storage.enabledCommands?.spotifyArtists?K(a,function(n){return n.artists.map(function(i){return`[${i.name}](${i.external_urls.spotify})`}).join(`
`)}):{type:4}}async function Pt(t,a){return r.storage.enabledCommands?.spotifyCover?K(a,function(n){return n.album.image.url}):{type:4}}async function K(t,a){try{const n=t.channel.id,i=Dt?.getTrack?.();if(!i){const d=Date.now().toString();return Te.sendMessage(n,{content:"You are not listening to any track."},void 0,{nonce:d}),{type:4}}const s=a(i),c=Date.now().toString();return Te.sendMessage(n,{content:s},void 0,{nonce:c}),{type:4}}catch(n){return console.error("[Spotify Command] Error:",n),{type:4}}}const $t={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:kt},Lt={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:Bt},Ft={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:xt},Mt={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:Pt},_t=p.findByProps("sendMessage"),Vt={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{r.storage.garySettings||(r.storage.garySettings={imageSource:"gary"});const n=r.storage.garySettings.imageSource||"gary";console.log(`[Gary Command] Using image source: ${n}`);const i=await Qe(n);if(!i)return console.log("[Gary Command] No image URL received"),{type:4};console.log(`[Gary Command] Sending image: ${i}`);const s=Date.now().toString();return _t.sendMessage(a.channel.id,{content:i},void 0,{nonce:s}),{type:4}}catch(n){return console.error("[Gary] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},De=p.findByProps("sendMessage","receiveMessage"),Ut=p.findByProps("getLastSelectedChannelId"),Wt=p.findByProps("createBotMessage"),Gt=p.findByProps("BOT_AVATARS");function q(t,a,n){const i=t??Ut?.getChannelId?.(),s=Wt.createBotMessage({channelId:i,content:"",embeds:n});s.author.username="Astolfo",s.author.avatar="Astolfo",Gt.BOT_AVATARS.Astolfo="https://i.pinimg.com/736x/50/77/1f/50771f45b1c015cfbb8b0853ba7b8521.jpg",typeof a=="string"?s.content=a:Object.assign(s,a),De.receiveMessage(i,s)}const Ot={name:"lovefemboys",displayName:"lovefemboys",description:"Get an image of a femboy",displayDescription:"Get an image of a femboy",options:[{name:"nsfw",displayName:"nsfw",description:"Get the result from r/femboys instead of r/femboy (NSFW)",displayDescription:"Get the result from r/femboys instead of r/femboy (NSFW)",required:!1,type:5},{name:"sort",displayName:"sort",description:"Changes the way reddit sorts.",displayDescription:"Changes the way reddit sorts",required:!1,type:3},{name:"silent",displayName:"silent",description:"Makes it so only you can see the message.",displayDescription:"Makes it so only you can see the message.",required:!1,type:5}],applicationId:"-1",inputType:1,type:1,execute:async function(t,a){try{const n=t.find(function(l){return l.name==="nsfw"})?.value;let i=t.find(function(l){return l.name==="sort"})?.value;const s=t.find(function(l){return l.name==="silent"})?.value;if(typeof i>"u"&&(i=r.storage.sortdefs),!["best","hot","new","rising","top","controversial"].includes(i)){q(a.channel.id,"Incorrect sorting type. Valid options are\n`best`, `hot`, `new`, `rising`, `top`, `controversial`.",[]);return}if(n&&!await new Promise(function(l){u.alerts.showConfirmationAlert({title:"\u26A0\uFE0F NSFW Content Warning",content:"This command will send NSFW (Not Safe For Work) content from r/femboys. Are you sure you want to continue?",confirmText:"Yes, Continue",onConfirm:function(){return l(!0)},cancelText:"Cancel",onCancel:function(){return l(!1)}})}))return{type:
(You can disable this check in plugin settings)`,[]);return}n&&(c=await fetch(`https://www.reddit.com/r/femboys/${i}.json?limit=100`).then(function(l){return l.json()})),c=c.data?.children?.[Math.floor(Math.random()*c.data?.children?.length)]?.data;const d=await fetch(`https://www.reddit.com/u/${c?.author}/about.json`).then(function(l){return l.json()});if(s??!0)q(a.channel.id,"",[{type:"rich",title:c?.title,url:`https://reddit.com${c?.permalink}`,author:{name:`u/${c?.author} \u2022 r/${c?.subreddit}`,proxy_icon_url:d?.data.icon_img.split("?")[0],icon_url:d?.data.icon_img.split("?")[0]},image:{proxy_url:c?.url_overridden_by_dest?.replace(/.gifv$/g,".gif")??c?.url.replace(/.gifv$/g,".gif"),url:c?.url_overridden_by_dest?.replace(/.gifv$/g,".gif")??c?.url?.replace(/.gifv$/g,".gif"),width:c?.preview?.images?.[0]?.source?.width,height:c?.preview?.images?.[0]?.source?.height},color:"0xf4b8e4"}]);else{const l=Date.now().toString();De.sendMessage(a.channel.id,{content:c?.url_overridden_by_dest??c?.url},void 0,{nonce:l})}}catch(n){console.error("[LoveFemboys] Error:",n),q(a.channel.id,"ERROR !!!!!!!!!!!! \u{1F62D}\u{1F62D}\u{1F62D} Check debug logs!! \u{1F97A}\u{1F97A}\u{1F97A}",[])}}},zt=p.findByProps("sendMessage"),jt=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),Ht={name:"ip",displayName:"ip",description:"IP address and domain lookup",displayDescription:"IP address and domain lookup",options:[{name:"query",displayName:"query",description:"Enter IPv4/IPv6 address or domain name",displayDescription:"Enter IPv4/IPv6 address or domain name",type:3,required:!0},{name:"send",displayName:"send",description:"Send to chat",displayDescription:"Send to chat",type:5,required:!1},{name:"ephemeral",displayName:"ephemeral",description:"Send as ephemeral message (only you can see)",displayDescription:"Send as ephemeral message (only you can see)",type:5,required:!1}],execute:async function(t,a){try{const n=t.find(function(f){return f.name==="query"})?.value,i=t.find(function(f){return f.name==="send"})?.value||!1,s=t.find(function(f){return f.name==="ephemeral"})?.value||!1;if(!n){const f="\u274C Query parameter is required!";return s?{type:4,data:{content:f,flags:64}}:(b.showToast(f,o.getAssetIDByName("CircleXIcon")),{type:4})}!s&&!i&&b.showToast(`Looking up IP information for ${n}...`,o.getAssetIDByName("DownloadIcon"));const c=`http://ipwhois.app/json/${encodeURIComponent(n)}?objects=success,ip,type,as,org,isp,continent,country,country_capital,city,region,country_phone,latitude,longitude,timezone,currency,completed_requests`,d=await fetch(c);if(!d.ok)throw new Error(`HTTP ${d.status}: ${d.statusText}`);const l=await d.json();if(!l.success){const f=`\u274C Failed to lookup IP information for: ${n}`;return s?{type:4,data:{content:f,flags:64}}:(b.showToast(f,o.getAssetIDByName("CircleXIcon")),{type:4})}const g=`\`\`\`json
${JSON.stringify(l,null,4)}
\`\`\``;if(s)return{type:4,data:{content:g,flags:64}};if(i){const f=Date.now().toString();return zt.sendMessage(a.channel.id,{content:g},void 0,{nonce:f}),{type:4}}else return jt.sendBotMessage(a.channel.id,g),{type:4}}catch(n){console.error("[IP] Command error:",n);const i=`\u274C An error occurred while looking up IP information: ${n.message||"Unknown error"}`;return t?.find?.(function(s){return s.name==="ephemeral"})?.value??!1?{type:4,data:{content:i,flags:64}}:(b.showToast(i,o.getAssetIDByName("CircleXIcon")),{type:4})}},applicationId:"-1",inputType:1,type:1},Kt=p.findByProps("sendMessage"),qt=p.findByProps("sendBotMessage","sendMessage","receiveMessage"),Yt=["avatar","classic","cuddle","fox_girl","gecg","holo","kemonomimi","kiss","neko","ngif","smug","spank","tickle","waifu","wallpaper","woof"];async function Xt(t,a){const n=[];for(let i=0;i<a;i++)try{i>0&&await new Promise(function(d){return setTimeout(d,1e3)});const s=await fetch(`https://nekos.life/api/v2/img/${t}`);if(!s.ok){console.error(`[NekosLife] API request failed: ${s.status}`);continue}const c=await s.json();c.url&&n.push(c.url)}catch(s){console.error(`[NekosLife] Error fetching image ${i+1}:`,s)}return n}function Jt(t){return!t||typeof t!="string"?!1:Yt.includes(t.toLowerCase().trim())}const Qt={name:"nekoslife",displayName:"nekoslife",description:"Get SFW images/gifs from nekos.life",displayDescription:"Get SFW images/gifs from nekos.life",options:[{name:"category",displayName:"category",description:"Category name (e.g. neko, waifu, cuddle, etc.)",displayDescription:"Category name (e.g. neko, waifu, cuddle, etc.)",type:3,required:!0},{name:"limit",displayName:"limit",description:"Number of images (1-5, default: 1)",displayDescription:"Number of images (1-5, default: 1)",type:4,required:!1},{name:"send",displayName:"send",description:"Send to chat",displayDescription:"Send to chat",type:5,required:!1},{name:"ephemeral",displayName:"ephemeral",description:"Send as ephemeral message (only you can see)",displayDescription:"Send as ephemeral message (only you can see)",type:5,required:!1}],execute:async function(t,a){try{console.log("[NekosLife] Command executed with args:",t);const n=t.find(function(y){return y.name==="category"})?.value,i=t.find(function(y){return y.name==="limit"})?.value,s=t.find(function(y){return y.name==="send"})?.value||!1,c=t.find(function(y){return y.name==="ephemeral"})?.value||!1;if(console.log("[NekosLife] Parsed values:",{categoryInput:n,limitInput:i,shouldSend:s,isEphemeral:c}),!n||typeof n!="string"){const y="\u274C Category is required! Examples: neko, waifu, cuddle, kiss";return console.error("[NekosLife] No category provided"),c?{type:4,data:{content:y,flags:64}}:(b.showToast(y,o.getAssetIDByName("CircleXIcon")),{type:4})}const d=n.toLowerCase().trim();if(!Jt(d)){const y=`\u274C Invalid SFW category "${n}". Valid: neko, waifu, cuddle, kiss, holo, etc.`;return c?{type:4,data:{content:y,flags:64}}:(b.showToast(y,o.getAssetIDByName("CircleXIcon")),{type:4})}let l=1;i!=null&&(l=parseInt(String(i))||1,l=Math.max(1,Math.min(5,l))),console.log("[NekosLife] Processing SFW request:",{category:d,limit:l,shouldSend:s,isEphemeral:c}),c||b.showToast(`Fetching ${l} SFW image(s) from nekos.life...`,o.getAssetIDByName("DownloadIcon"));const g=await Xt(d,l);if(g.length===0){const y="\u274C Failed to fetch images from nekos.life. Try again later!";return c?{type:4,data:{content:y,flags:64}}:(b.showToast(y,o.getAssetIDByName("CircleXIcon")),{type:4})}const f=g.join(`
`);if(c)return console.log("[NekosLife] Sending ephemeral response"),{type:4,data:{content:f,flags:64}};if(s){console.log("[NekosLife] Sending to chat");const y=Date.now().toString();return Kt.sendMessage(a.channel.id,{content:f},void 0,{nonce:y}),{type:4}}else return console.log("[NekosLife] Sending as bot message"),qt.sendBotMessage(a.channel.id,f),{type:4}}catch(n){console.error("[NekosLife] Command error:",n);const i="\u274C An error occurred while fetching images.";return t?.find?.(function(s){return s.name==="ephemeral"})?.value??!1?{type:4,data:{content:i,flags:64}}:(b.showToast(i,o.getAssetIDByName("CircleXIcon")),{type:4})}},applicationId:"-1",inputType:1,type:1},Zt=p.findByProps("sendBotMessage","sendMessage"),B=p.findByProps("getAllFriendInvites","createFriendInvite","revokeFriendInvites");p.findByProps("get","post");const ea=p.findByProps("getCurrentUser")?.getCurrentUser;function Y(t,a){const n=Date.now().toString();Zt.sendMessage(t.channel.id,{content:a},void 0,{nonce:n})}const ta={name:"invite create",displayName:"invite create",description:"Generates a friend invite link.",displayDescription:"Generates a friend invite link.",type:1,applicationId:"-1",inputType:1,execute:async function(t,a){try{if(!ea?.().phone)return b.showToast("You need a phone number connected to your account!",o.getAssetIDByName("Small")),{type:4};const n=await B.createFriendInvite({code:null,recipient_phone_number_or_email:null,contact_visibility:0,filter_visibilities:[],filtered_invite_suggestions_index:0});if(n?.code){const i=Math.floor(new Date(n.expires_at).getTime()/1e3),s=`https://discord.gg/${n.code} \xB7 Expires: <t:${i}:R>`;Y(a,s),b.showToast("Friend invite created!",o.getAssetIDByName("Check"))}else throw new Error("No invite code generated");return{type:4}}catch(n){return console.error("[FriendInvite] Create error:",n),b.showToast("Error creating friend invite",o.getAssetIDByName("Small")),{type:4}}}},aa={name:"view invites",displayName:"view invites",description:"View your current friend invite links that you've made.",displayDescription:"View your current friend invite links that you've made.",type:1,applicationId:"-1",execute:async function(t,a){try{const n=await B.getAllFriendInvites();if(!n?.length)return b.showToast("No active friend invites found",o.getAssetIDByName("Info")),{type:4};const i=n.map(function(s){const c=Math.floor(new Date(s.expires_at).getTime()/1e3);return`_https://discord.gg/${s.code}_ \xB7 Expires: <t:${c}:R> \xB7 Uses: \`${s.uses}/${s.max_uses}\``});return Y(a,`**Your Active Friend Invites:**
${i.join(`
`)}`),{type:4}}catch(n){return console.error("[FriendInvite] View error:",n),b.showToast("Error viewing friend invites",o.getAssetIDByName("Small")),{type:4}}}},na={name:"revoke invites",displayName:"revoke invites",description:"Revoke all your friend invite links.",displayDescription:"Revoke all your friend invite links.",type:1,applicationId:"-1",inputType:1,execute:async function(t,a){try{const n=await B.getAllFriendInvites();if(!n?.length)return b.showToast("No active friend invites to revoke",o.getAssetIDByName("Info")),{type:4};await B.revokeFriendInvites();const i=await B.getAllFriendInvites();return i.length===0?(Y(a,`\u2705 Successfully revoked all ${n.length} friend invite(s)!`),b.showToast(`Revoked ${n.length} invite(s)`,o.getAssetIDByName("Check"))):(Y(a,`\u26A0\uFE0F Partially revoked invites. ${i.length} invite(s) remain active.`),b.showToast("Partial revocation",o.getAssetIDByName("Warning"))),{type:4}}catch(n){return console.error("[FriendInvite] Revoke error:",n),b.showToast("Error revoking friend invites",o.getAssetIDByName("Small")),{type:4}}}};function ra(){const[t,a]=e.React.useState(0),[n,i]=e.React.useState(null),[s,c]=e.React.useState(null),[d,l]=e.React.useState(!1);e.React.useEffect(function(){r.storage.sidebarEnabled===void 0&&(r.storage.sidebarEnabled=!0)},[]);const g=p.findByProps("getUser","getCurrentUser")?.getCurrentUser?.(),{getUserAvatarURL:f}=p.findByProps("getUserAvatarURL")||{},{getDefaultAvatarURL:y}=p.findByProps("getDefaultAvatarURL")||{},C=e.stylesheet.createThemedStyleSheet({container:{flexDirection:"row",alignItems:"center",paddingVertical:24,paddingHorizontal:16,width:"100%",justifyContent:"center"},leftSection:{flexDirection:"row",alignItems:"center",flex:1,gap:20,maxWidth:500},avatarContainer:{position:"relative",width:96,height:96,justifyContent:"center",alignItems:"center"},avatarWrapper:{width:96,height:96,borderRadius:24,backgroundColor:u.semanticColors.BACKGROUND_SECONDARY,justifyContent:"center",alignItems:"center",overflow:"hidden",borderWidth:2,borderColor:u.semanticColors.BACKGROUND_TERTIARY},avatar:{width:92,height:92,borderRadius:22},cogwheelBackground:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",borderRadius:24,justifyContent:"center",alignItems:"center",opacity:0},cogwheelIcon:{width:32,height:32,tintColor:u.semanticColors.INTERACTIVE_ACTIVE},textContainer:{flex:1,marginLeft:4},title:{fontSize:28,fontWeight:"700",color:u.semanticColors.MOBILE_TEXT_HEADING_PRIMARY,marginBottom:4,textAlign:"left"},subtitle:{fontSize:14,color:u.semanticColors.TEXT_MUTED,textAlign:"left",lineHeight:20},avatarPlaceholder:{width:48,height:48,tintColor:u.semanticColors.INTERACTIVE_NORMAL},animatedIndicator:{position:"absolute",top:8,right:8,backgroundColor:"rgba(0, 0, 0, 0.7)",borderRadius:10,width:20,height:20,justifyContent:"center",alignItems:"center",zIndex:1},gifText:{color:"#FFFFFF",fontSize:10,fontWeight:"bold"}});e.React.useEffect(function(){if(g){let R,A=!1;const U=g.avatar?.startsWith("a_");if(f&&g.avatar)R=f(g,U),A=U;else if(y)R=y(g);else if(g.avatar){const ae=g.avatar.startsWith("a_");R=`https://cdn.discordapp.com/avatars/${g.id}/${g.avatar}.${ae?"gif":"png"}?size=256`,A=ae}else R=`https://cdn.discordapp.com/embed/avatars/${g.discriminator?parseInt(g.discriminator)%5:(parseInt(g.id)>>22)%6}.png`;c(R),l(A)}},[g]);const E=function(){if(r.storage.hiddenSettings?.enabled){r.storage.hiddenSettings.visible=!r.storage.hiddenSettings.visible,b.showToast(`Hidden settings ${r.storage.hiddenSettings.visible?"visible":"hidden"}`,o.getAssetIDByName("SettingsIcon"));return}n&&clearTimeout(n);const R=setTimeout(function(){a(0)},1e3);i(R);const A=t+1;a(A),!(A<10)&&(b.showToast("Hidden settings unlocked!",o.getAssetIDByName("CheckmarkIcon")),r.storage.hiddenSettings={...r.storage.hiddenSettings,enabled:!0,visible:!0},a(0))},N=function(){const R=!r.storage.sidebarEnabled;r.storage.sidebarEnabled=R,r.storage.pendingRestart=!0,b.showToast(`Sidebar ${R?"enabled":"disabled"}. Restart Discord to apply.`,o.getAssetIDByName(R?"CheckmarkIcon":"XIcon"))},[k,
`,"Use these category names with the /nekoslife command.",`
`,"All categories are Safe For Work (SFW).")),e.React.createElement(m,{title:"\u{1F4CB} SFW Categories",icon:o.getAssetIDByName("ListViewIcon")},e.React.createElement(e.ReactNative.View,{style:t.tableHeader},e.React.createElement(e.ReactNative.Text,{style:[t.headerText,t.nameHeader]},"Category Name"),e.React.createElement(e.ReactNative.Text,{style:[t.headerText,t.codeHeader]},"Command Code"),e.React.createElement(e.ReactNative.Text,{style:[t.headerText,t.badgeHeader]},"Type")),n.map(function(i,s){return e.React.createElement(e.ReactNative.View,{key:s,style:t.categoryItem},e.React.createElement(e.ReactNative.Text,{style:t.categoryName},i.name),e.React.createElement(e.ReactNative.Text,{style:t.categoryValue},i.value),e.React.createElement(e.ReactNative.View,{style:t.sfwBadgeContainer},e.React.createElement(e.ReactNative.View,{style:t.sfwBadge},e.React.createElement(e.ReactNative.Text,{style:t.badgeText},"SFW"))))})))}const{FormSwitchRow:ke,FormRow:F}=v.Forms;function ua(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(n){return n+1},0),a=e.NavigationNative.useNavigation();return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"IP Commands",icon:o.getAssetIDByName("GlobeEarthIcon")},e.React.createElement(ke,{label:"/ip",subLabel:"Get your current IP address",leading:e.React.createElement(F.Icon,{source:o.getAssetIDByName("GlobeEarthIcon")}),value:r.storage.enabledCommands.ip,onValueChange:function(n){r.storage.enabledCommands.ip=n,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"NekosLife Commands",icon:o.getAssetIDByName("ImageIcon")},e.React.createElement(ke,{label:"/nekoslife",subLabel:"Get images/gifs from nekos.life",leading:e.React.createElement(F.Icon,{source:o.getAssetIDByName("ImageIcon")}),value:r.storage.enabledCommands.nekoslife,onValueChange:function(n){r.storage.enabledCommands.nekoslife=n,r.storage.pendingRestart=!0,t()}}),e.React.createElement(F,{label:"View Categories",subLabel:"See all 16 available categories",leading:e.React.createElement(F.Icon,{source:o.getAssetIDByName("BookOpenIcon")}),trailing:e.React.createElement(F.Arrow,null),onPress:function(){return a.push("VendettaCustomPage",{title:"NekosLife Categories",render:da})}})),e.React.createElement(e.ReactNative.View,{style:{height:32}}))}const{FormSwitchRow:M,FormRow:Be}=v.Forms;function ga(){I.useProxy(r.storage);const[,t]=e.React.useReducer(function(a){return a+1},0);return e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,paddingVertical:16,maxWidth:"100%"}},e.React.createElement(m,{title:"Message Commands",icon:o.getAssetIDByName("ChatIcon")},e.React.createElement(M,{label:"/firstmessage",subLabel:"Get the first message in a channel",leading:e.React.createElement(Be.Icon,{source:o.getAssetIDByName("ChatIcon")}),value:r.storage.enabledCommands.firstmessage,onValueChange:function(a){r.storage.enabledCommands.firstmessage=a,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"System Commands",icon:o.getAssetIDByName("SettingsIcon")},e.React.createElement(M,{label:"/sysinfo",subLabel:"Display system information",leading:e.React.createElement(Be.Icon,{source:o.getAssetIDByName("SettingsIcon")}),value:r.storage.enabledCommands.sysinfo,onValueChange:function(a){r.storage.enabledCommands.sysinfo=a,r.storage.pendingRestart=!0,t()}})),e.React.createElement(m,{title:"Friend Invites",icon:o.getAssetIDByName("UserAddIcon")},e.React.createElement(M,{label:"/invite create",subLabel:"Generate a friend invite link",value:r.storage.enabledCommands.friendInviteCreate,onValueChange:function(a){r.storage.enabledCommands.friendInviteCreate=a,r.storage.pendingRestart=!0,t()}}),e.React.createElement(M,{label:"/view invites",subLabel:"View your current friend invites",value:r.storage.enabledCommands.friendInviteView,onValueChange:function(a){r.storage.enabledC
`,"Tap any developer to visit their GitHub profile.")),a.map(function(l){return e.React.createElement(e.ReactNative.View,{key:l.github,style:t.groupWrapper},e.React.createElement(e.ReactNative.View,{style:t.groupMain},e.React.createElement(e.ReactNative.View,{style:t.rippleContainer},e.React.createElement(e.ReactNative.Pressable,{style:t.cardPressable,onPress:function(){return n(l.github)},android_ripple:{color:u.semanticColors.ANDROID_RIPPLE,borderless:!1,radius:200},accessibilityRole:"button"},e.React.createElement(e.ReactNative.View,{style:t.avatarContainer},e.React.createElement(e.ReactNative.Image,{source:{uri:l.avatar},style:t.avatar})),e.React.createElement(e.ReactNative.View,{style:t.textContainer},e.React.createElement(e.ReactNative.Text,{numberOfLines:1,style:t.commandText},l.command),e.React.createElement(e.ReactNative.Text,{numberOfLines:1,style:t.authorText},"by ",l.author))))))}),e.React.createElement(m,{title:"About",icon:d,padding:!0},e.React.createElement(e.ReactNative.Text,{style:t.versionText},"Commands Plugin Collection",`
`,"Version 1.3.0")))}var xe,Pe,$e,Le,Fe,Me,_e;const{FormRow:h}=v.Forms;(xe=r.storage).factSettings??(xe.factSettings={sendAsReply:!0,includeCitation:!1}),(Pe=r.storage).listSettings??(Pe.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),($e=r.storage).garySettings??($e.garySettings={imageSource:"gary"}),(Le=r.storage).enabledCommands??(Le.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,ip:!0,lovefemboys:!1,nekoslife:!1,friendInviteCreate:!0,friendInviteView:!0,friendInviteRevoke:!0}),(Fe=r.storage).pendingRestart??(Fe.pendingRestart=!1),(Me=r.storage).hiddenSettings??(Me.hiddenSettings={enabled:!1,visible:!1,konochanBypassNsfw:!1}),(_e=r.storage).sidebarEnabled??(_e.sidebarEnabled=!0);function Ve(){I.useProxy(r.storage);const t=e.NavigationNative.useNavigation();return e.React.useEffect(function(){return function(){r.storage.pendingRestart&&(r.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,onConfirm:function(){}}))}},[]),e.React.createElement(e.ReactNative.View,{style:{flex:1}},e.React.createElement(e.ReactNative.ScrollView,{style:{flex:1,backgroundColor:u.semanticColors.BACKGROUND_PRIMARY},contentContainerStyle:{flexGrow:1,maxWidth:"100%"},showsVerticalScrollIndicator:!1},e.React.createElement(ra,null),e.React.createElement(m,{title:"Command Categories",icon:o.getAssetIDByName("ChannelListIcon")},e.React.createElement(h,{label:"Facts Commands",subLabel:"Cat facts, dog facts, and useless facts",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("BookmarkIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Facts Commands",render:ia})}}),e.React.createElement(h,{label:"List Commands",subLabel:"Plugin lists and theme lists",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("ListViewIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"List Commands",render:sa})}}),e.React.createElement(h,{label:"Image Commands",subLabel:"PetPet, KonoChan, and image utilities",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("ImageIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Image Commands",render:oa})}}),e.React.createElement(h,{label:"Gary Commands",subLabel:`Gary images - Current: ${r.storage.garySettings.imageSource==="gary"?"Gary API":r.storage.garySettings.imageSource==="catapi"?"Cat API":r.storage.garySettings.imageSource==="minker"?"Minker API":r.storage.garySettings.imageSource==="goober"?"Goober API":"Gary API"}`,leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("CameraIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Gary Commands",render:ca})}}),e.React.createElement(h,{label:"Spotify Commands",subLabel:"Share your Spotify activity",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("SpotifyNeutralIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Spotify Commands",render:la})}}),e.React.createElement(h,{label:"Aliucord Commands",subLabel:"Commands from Aliucord",leading:e.React.createElement(h.Icon,{source:{uri:"https://avatars.githubusercontent.com/u/78881422?s=200&v=4"}}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Aliucord",render:ua})}}),e.React.createElement(h,{label:"Other Commands",subLabel:"Utility and system commands",leading:e.React.createElement(h.Icon,{source:o.getAssetIDByName("WrenchIcon")}),trailing:e.React.createElement(h.Arrow,null),onPress:function(){return t.push("VendettaCustomPage",{title:"Other Commands",render:ga}