vd-plugins/Commands/index.js

15 lines
59 KiB
JavaScript
Raw Normal View History

(function(q,Ae,r,g,m,M,N,w,n,ne,b,E,_,Le,X){"use strict";const De=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}},$e=async function(){return{text:(await(await fetch("https://dogapi.dog/api/v2/facts?limit=1")).json()).data[0].attributes.body}},Pe=async function(){const e=await(await fetch("https://catfact.ninja/fact")).json();return{text:e.fact,length:e.length}},xe=async function(e,t){try{const a=await fetch(`https://api.obamabot.me/v2/image/petpet?image=${e.replace("webp","png")}`);if(a.ok){const s=await a.json();if(s&&s.url)return s}}catch(a){console.warn("[PetPet] Obama API failed, falling back to .ru:",a)}if(t)return{url:`https://ptc.pwn3t.ru/${t}.gif`};throw new Error("All PetPet APIs are down")},Be=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}},Y=g.findByProps("sendMessage"),J=function(e){let t=e.text;return r.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 Pe(),s=Date.now().toString();return Y.sendMessage(t.channel.id,{content:J(a)},void 0,{nonce:s}),null}catch(a){return console.error("[CatFact] Error:",a),m.showToast("Failed to fetch cat fact",3e3),null}}},Me={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 $e(),s=Date.now().toString();return Y.sendMessage(t.channel.id,{content:J(a)},void 0,{nonce:s}),null}catch(a){return console.error("[DogFact] Error:",a),m.showToast("Failed to fetch dog fact",3e3),null}}},_e={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 De(),s=Date.now().toString();return Y.sendMessage(t.channel.id,{content:J(a)},void 0,{nonce:s}),null}catch(a){return console.error("[UselessFact] Error:",a),m.showToast("Failed to fetch useless fact",3e3),null}}},D={CONTENT:"This list is over 2000 characters. Send anyway?",CONFIRM:"Send",CANCEL:"Cancel"},Ve={DETAILED:"detailed"},Q="",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."},ae={SEMICOL:"; ",NEW_LINE:`
`},Ue="Nothing to see here, huh...",re="github.com/fres621/vendetta-plugins",I={ENABLED:"\u2705",DISABLED:"\u274C",SELECTED:"\u2705",NOT_SELECTED:"\u274C"},We=g.findByProps("sendMessage","receiveMessage"),$=g.findByProps("sendBotMessage"),se=(function(){try{return g.findByStoreName("UserStore").getCurrentUser()?.premiumType===2?4e3:2e3}catch{return 2e3}})(),ie=function(e){return Object.keys(e).includes(re)},oe=function(e){return Object.values(e).find(function(t){return t.id==re})?.enabled},ce=function(e){return e.find(function(t){return t.name===Ve.DETAILED})?.value??!1},U=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(ae.SEMICOL)||"Unknown"},le=function(e){return e.join(ae.NEW_LINE).trimEnd()},W=function(e){return le(e).length},O=async function(e,t){const a=Date.now().toString();await We.sendMessage(e,{content:le(t)},void 0,{nonce:a})},de=function(e,t){return[`**My ${e} List | ${t} ${e}s**`,Q]};async function Oe(e,t){try{const a=ce(e),s=r.storage.themeListAlwaysDetailed??!1;if(!M.themes||typeof M.themes!="object"){const d=t.channel.id;return $.sendBotMessage(d,"No themes found or themes not loaded yet."),null}const i=Object.values(M.themes),o=t.channel.id,c=de("Theme",Object.keys(M.themes).length);if(i.length)for(const d of i){if(!d||typeof d!="object")continue;const{selected:u,data:f,id:C}=d,k=f?.name||"Unknown Theme",T=f?.description||"No description",P=f?.authors;a||s?c.push(`> **Name**: ${k}`,`> **Selected**: ${u?I.SELECTED:I.NOT_SELECTED}`,`> **Description**: ${T}`,`> **Authors**: ${U(P)}`,`> **[Install!](${C||"unknown"})**`,Q):c.push(`> ${u?I.SELECTED:I.NOT_SELECTED} **${k}** by ${U(P)}`)}else c.push(Ue);const l=W(c)>se;if(l&&!ie(N.plugins))$.sendBotMessage(o,V.SLM_NOT_INSTALLED);else if(l&&!oe(N.plugins))$.sendBotMessage(o,V.SLM_NOT_ENABLED);else{if(W(c)>2e3)return w.alerts.showConfirmationAlert({content:D.CONTENT,confirmText:D.CONFIRM,cancelText:D.CANCEL,onConfirm:async function(){return await O(o,c)}});await O(o,c)}}catch(a){return console.error("[ThemeList] Error:",a),null}}async function Ge(e,t){try{const a=ce(e),s=r.storage.pluginListAlwaysDetailed??!1,i=t.channel.id;if(!N.plugins||typeof N.plugins!="object")return $.sendBotMessage(i,"No plugins found or plugins not loaded yet."),null;const o=de("Plugin",Object.keys(N.plugins).length);for(const l of Object.values(N.plugins)){if(!l||typeof l!="object")continue;const{enabled:d,manifest:u,id:f}=l,C=u?.name||"Unknown Plugin",k=u?.description||"No description",T=u?.authors;a||s?o.push(`> **Name**: ${C}`,`> **Status**: ${d?I.ENABLED:I.DISABLED}`,`> **Description**: ${k}`,`> **Authors**: ${U(T)}`,`> **[Install!](${f||"unknown"})**`,Q):o.push(`> ${d?I.ENABLED:I.DISABLED} **${C}** by ${U(T)}`)}const c=W(o)>se;if(c&&!ie(N.plugins))$.sendBotMessage(i,V.SLM_NOT_INSTALLED);else if(c&&!oe(N.plugins))$.sendBotMessage(i,V.SLM_NOT_ENABLED);else{if(W(o)>2e3)return w.alerts.showConfirmationAlert({content:D.CONTENT,confirmText:D.CONFIRM,cancelText:D.CANCEL,onConfirm:async function(){return await O(i,o)}});await O(i,o)}}catch(a){return console.error("[PluginList] Error:",a),null}}const je={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:Ge,applicationId:"-1",inputType:1,type:1},He={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:Oe,applicationId:"-1",inputType
`],s=lt();Object.keys(s).forEach(function(c){const l=r.storage[c.toLowerCase()],d=e.find(function(u){return u.name==c.toLowerCase()})?.value??l;(d||l)&&!(l&&!d)&&(a.push(`[**${c}**]`),Object.keys(s[c]).forEach(function(u){a.push(`> ${u}: ${s[c][u]}`)}))});const i=r.storage.ephemeral,o=e.find(function(c){return c.name=="ephemeral"})?.value??i;if((o||i)&&!(i&&!o))return rt.sendBotMessage(t.channel.id,a.join(`
`)),null;{const c=Date.now().toString();return at.sendMessage(t.channel.id,{content:a.join(`
`)},void 0,{nonce:c}),null}}catch(a){return console.error("[Sysinfo] Error:",a),null}}const ut={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},...ye.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:dt,applicationId:"-1",inputType:1,type:1},pe=g.findByProps("sendMessage","receiveMessage"),ft=g.findByStoreName("SpotifyStore");async function gt(e,t){return r.storage.enabledCommands?.spotifyTrack?G(t,function(a){return`https://open.spotify.com/track/${a.id}`}):null}async function mt(e,t){return r.storage.enabledCommands?.spotifyAlbum?G(t,function(a){return`https://open.spotify.com/album/${a.album.id}`}):null}async function yt(e,t){return r.storage.enabledCommands?.spotifyArtists?G(t,function(a){return a.artists.map(function(s){return`[${s.name}](${s.external_urls.spotify})`}).join(`
`)}):null}async function pt(e,t){return r.storage.enabledCommands?.spotifyCover?G(t,function(a){return a.album.image.url}):null}async function G(e,t){try{const a=e.channel.id,s=ft?.getTrack?.();if(!s){const c=Date.now().toString();return pe.sendMessage(a,{content:"You are not listening to any track."},void 0,{nonce:c}),null}const i=t(s),o=Date.now().toString();return pe.sendMessage(a,{content:i},void 0,{nonce:o}),null}catch(a){return console.error("[Spotify Command] Error:",a),null}}const ht={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:gt},bt={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:mt},vt={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:yt},Ct={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},wt=g.findByProps("sendMessage"),St={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{r.storage.garySettings||(r.storage.garySettings={imageSource:"gary"});const a=r.storage.garySettings.imageSource||"gary";console.log(`[Gary Command] Using image source: ${a}`);const s=await Be(a);if(!s)return console.log("[Gary Command] No image URL received"),null;console.log(`[Gary Command] Sending image: ${s}`);const i=Date.now().toString();return wt.sendMessage(t.channel.id,{content:s},void 0,{nonce:i}),{type:4}}catch(a){return console.error("[Gary] Error:",a),null}},applicationId:"-1",inputType:1,type:1},he=g.findByProps("sendMessage","receiveMessage"),Rt=g.findByProps("getLastSelectedChannelId"),Et=g.findByProps("createBotMessage"),Nt=g.findByProps("BOT_AVATARS");function j(e,t,a){const s=e??Rt?.getChannelId?.(),i=Et.createBotMessage({channelId:s,content:"",embeds:a});i.author.username="Astolfo",i.author.avatar="Astolfo",Nt.BOT_AVATARS.Astolfo="https://i.pinimg.com/736x/50/77/1f/50771f45b1c015cfbb8b0853ba7b8521.jpg",typeof t=="string"?i.content=t:Object.assign(i,t),he.receiveMessage(s,i)}const It={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(e,t){try{const a=e.find(function(l){return l.name==="nsfw"})?.value;let s=e.find(function(l){return l.name==="sort"})?.value;const i=e.find(function(l){return l.name==="silent"})?.value;if(typeof s>"u"&&(s=r.storage.sortdefs),!["best","hot","new","rising","top","controversial"].includes(s)){j(t.channel.id,"Incorrect sorting type. Valid options are\n`best`, `hot`, `new`, `rising`, `top`, `controversial`.",[]);return}if(a&&!await new Promise(function(l){w.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 null;let o=await fetch(`https://w
(You can disable this check in plugin settings)`,[]);return}a&&(o=await fetch(`https://www.reddit.com/r/femboys/${s}.json?limit=100`).then(function(l){return l.json()})),o=o.data?.children?.[Math.floor(Math.random()*o.data?.children?.length)]?.data;const c=await fetch(`https://www.reddit.com/u/${o?.author}/about.json`).then(function(l){return l.json()});if(i??!0)j(t.channel.id,"",[{type:"rich",title:o?.title,url:`https://reddit.com${o?.permalink}`,author:{name:`u/${o?.author} \u2022 r/${o?.subreddit}`,proxy_icon_url:c?.data.icon_img.split("?")[0],icon_url:c?.data.icon_img.split("?")[0]},image:{proxy_url:o?.url_overridden_by_dest?.replace(/.gifv$/g,".gif")??o?.url.replace(/.gifv$/g,".gif"),url:o?.url_overridden_by_dest?.replace(/.gifv$/g,".gif")??o?.url?.replace(/.gifv$/g,".gif"),width:o?.preview?.images?.[0]?.source?.width,height:o?.preview?.images?.[0]?.source?.height},color:"0xf4b8e4"}]);else{const l=Date.now().toString();he.sendMessage(t.channel.id,{content:o?.url_overridden_by_dest??o?.url},void 0,{nonce:l})}}catch(a){console.error("[LoveFemboys] Error:",a),j(t.channel.id,"ERROR !!!!!!!!!!!! \u{1F62D}\u{1F62D}\u{1F62D} Check debug logs!! \u{1F97A}\u{1F97A}\u{1F97A}",[])}}},kt=g.findByProps("sendMessage"),Tt=g.findByProps("sendBotMessage","sendMessage","receiveMessage"),At={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(e,t){try{const a=e.find(function(u){return u.name==="query"})?.value,s=e.find(function(u){return u.name==="send"})?.value||!1,i=e.find(function(u){return u.name==="ephemeral"})?.value||!1;if(!a){const u="\u274C Query parameter is required!";return i?{type:4,data:{content:u,flags:64}}:(m.showToast(u,b.getAssetIDByName("CircleXIcon")),null)}!i&&!s&&m.showToast(`Looking up IP information for ${a}...`,b.getAssetIDByName("DownloadIcon"));const o=`http://ipwhois.app/json/${encodeURIComponent(a)}?objects=success,ip,type,as,org,isp,continent,country,country_capital,city,region,country_phone,latitude,longitude,timezone,currency,completed_requests`,c=await fetch(o);if(!c.ok)throw new Error(`HTTP ${c.status}: ${c.statusText}`);const l=await c.json();if(!l.success){const u=`\u274C Failed to lookup IP information for: ${a}`;return i?{type:4,data:{content:u,flags:64}}:(m.showToast(u,b.getAssetIDByName("CircleXIcon")),null)}const d=`\`\`\`json
${JSON.stringify(l,null,4)}
\`\`\``;if(i)return{type:4,data:{content:d,flags:64}};if(s){const u=Date.now().toString();return kt.sendMessage(t.channel.id,{content:d},void 0,{nonce:u}),{type:4}}else return Tt.sendBotMessage(t.channel.id,d),null}catch(a){console.error("[IP] Command error:",a);const s=`\u274C An error occurred while looking up IP information: ${a.message||"Unknown error"}`;return e?.find?.(function(i){return i.name==="ephemeral"})?.value??!1?{type:4,data:{content:s,flags:64}}:(m.showToast(s,b.getAssetIDByName("CircleXIcon")),null)}},applicationId:"-1",inputType:1,type:1},Lt=g.findByProps("sendMessage"),Dt=g.findByProps("sendBotMessage","sendMessage","receiveMessage"),$t=["avatar","classic","cuddle","fox_girl","gecg","holo","kemonomimi","kiss","neko","ngif","smug","spank","tickle","waifu","wallpaper","woof"];async function Pt(e,t){const a=[];for(let s=0;s<t;s++)try{s>0&&await new Promise(function(c){return setTimeout(c,1e3)});const i=await fetch(`https://nekos.life/api/v2/img/${e}`);if(!i.ok){console.error(`[NekosLife] API request failed: ${i.status}`);continue}const o=await i.json();o.url&&a.push(o.url)}catch(i){console.error(`[NekosLife] Error fetching image ${s+1}:`,i)}return a}function xt(e){return!e||typeof e!="string"?!1:$t.includes(e.toLowerCase().trim())}const Bt={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(e,t){try{console.log("[NekosLife] Command executed with args:",e);const a=e.find(function(f){return f.name==="category"})?.value,s=e.find(function(f){return f.name==="limit"})?.value,i=e.find(function(f){return f.name==="send"})?.value||!1,o=e.find(function(f){return f.name==="ephemeral"})?.value||!1;if(console.log("[NekosLife] Parsed values:",{categoryInput:a,limitInput:s,shouldSend:i,isEphemeral:o}),!a||typeof a!="string"){const f="\u274C Category is required! Examples: neko, waifu, cuddle, kiss";return console.error("[NekosLife] No category provided"),o?{type:4,data:{content:f,flags:64}}:(m.showToast(f,b.getAssetIDByName("CircleXIcon")),null)}const c=a.toLowerCase().trim();if(!xt(c)){const f=`\u274C Invalid SFW category "${a}". Valid: neko, waifu, cuddle, kiss, holo, etc.`;return o?{type:4,data:{content:f,flags:64}}:(m.showToast(f,b.getAssetIDByName("CircleXIcon")),null)}let l=1;s!=null&&(l=parseInt(String(s))||1,l=Math.max(1,Math.min(5,l))),console.log("[NekosLife] Processing SFW request:",{category:c,limit:l,shouldSend:i,isEphemeral:o}),o||m.showToast(`Fetching ${l} SFW image(s) from nekos.life...`,b.getAssetIDByName("DownloadIcon"));const d=await Pt(c,l);if(d.length===0){const f="\u274C Failed to fetch images from nekos.life. Try again later!";return o?{type:4,data:{content:f,flags:64}}:(m.showToast(f,b.getAssetIDByName("CircleXIcon")),null)}const u=d.join(`
`);if(o)return console.log("[NekosLife] Sending ephemeral response"),{type:4,data:{content:u,flags:64}};if(i){console.log("[NekosLife] Sending to chat");const f=Date.now().toString();return Lt.sendMessage(t.channel.id,{content:u},void 0,{nonce:f}),null}else return console.log("[NekosLife] Sending as bot message"),Dt.sendBotMessage(t.channel.id,u),null}catch(a){console.error("[NekosLife] Command error:",a);const s="\u274C An error occurred while fetching images.";return e?.find?.(function(i){return i.name==="ephemeral"})?.value??!1?{type:4,data:{content:s,flags:64}}:(m.showToast(s,b.getAssetIDByName("CircleXIcon")),null)}},applicationId:"-1",inputType:1,type:1},Ft=g.findByProps("sendBotMessage","sendMessage"),x=g.findByProps("getAllFriendInvites","createFriendInvite","revokeFriendInvites"),Mt=g.findByProps("getCurrentUser")?.getCurrentUser;function be(e,t){const a=Date.now().toString();Ft.sendMessage(e.channel.id,{content:t},void 0,{nonce:a})}const _t={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(e,t){try{if(!Mt?.().phone)return m.showToast("You need a phone number connected to your account!",b.getAssetIDByName("Small")),null;const a=await x.createFriendInvite({code:null,recipient_phone_number_or_email:null,contact_visibility:0,filter_visibilities:[],filtered_invite_suggestions_index:0});if(a?.code){const s=Math.floor(new Date(a.expires_at).getTime()/1e3),i=`https://discord.gg/${a.code} \xB7 Expires: <t:${s}:R>`;be(t,i),m.showToast("Friend invite created!",b.getAssetIDByName("Check"))}else throw new Error("No invite code generated");return null}catch(a){return console.error("[FriendInvite] Create error:",a),m.showToast("Error creating friend invite",b.getAssetIDByName("Small")),null}}},Vt={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(e,t){try{const a=await x.getAllFriendInvites();if(!a?.length)return m.showToast("No active friend invites found",b.getAssetIDByName("Info")),null;const s=a.map(function(i){const o=Math.floor(new Date(i.expires_at).getTime()/1e3);return`_https://discord.gg/${i.code}_ \xB7 Expires: <t:${o}:R> \xB7 Uses: \`${i.uses}/${i.max_uses}\``});return be(t,`**Your Active Friend Invites:**
${s.join(`
`)}`),null}catch(a){return console.error("[FriendInvite] View error:",a),m.showToast("Error viewing friend invites",b.getAssetIDByName("Small")),null}}},Ut={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(e,t){try{const a=await x.getAllFriendInvites();if(!a?.length)return m.showToast("No active friend invites to revoke",b.getAssetIDByName("Info")),null;await x.revokeFriendInvites();const s=await x.getAllFriendInvites();return s.length===0?m.showToast(`Successfully revoked all ${a.length} friend invite(s)!`,b.getAssetIDByName("Check")):m.showToast(`\u26A0\uFE0F Partially revoked invites. ${s.length} invite(s) remain active.`,b.getAssetIDByName("Warning")),null}catch(a){return console.error("[FriendInvite] Revoke error:",a),m.showToast("Error revoking friend invites",b.getAssetIDByName("Small")),null}}},{ScrollView:S}=g.findByProps("ScrollView"),{TableRowGroup:h,TableSwitchRow:y,TableCheckboxRow:vn,TableRadioGroup:Wt,TableRadioRow:H,Stack:R,TableRow:p}=g.findByProps("TableSwitchRow","TableCheckboxRow","TableRadioGroup","TableRadioRow","TableRowGroup","Stack","TableRow"),{TextInput:Cn}=g.findByProps("TextInput"),ve=g.findByProps("TextStyleSheet").TextStyleSheet,Ot=g.findByStoreName("ThemeStore"),Ce=g.findByProps("colors","unsafe_rawColors"),Gt=Ce?.internal??Ce?.meta;function we(e,t){const a=Ot?.theme;return e&&Gt?.resolveSemanticColor(a,e)||"#000000"}function jt(){const[e,t]=n.React.useState(0),[a,s]=n.React.useState(null),[i,o]=n.React.useState(null),[c,l]=n.React.useState(!1);n.React.useEffect(function(){r.storage.sidebarEnabled===void 0&&(r.storage.sidebarEnabled=!0)},[]);let d=null;try{d=g.findByProps("getUser","getCurrentUser")?.getCurrentUser?.()}catch(v){console.warn("[Commands Header] Failed to get current user:",v)}let u=null,f=null;try{u=g.findByProps("getUserAvatarURL")?.getUserAvatarURL}catch(v){console.warn("[Commands Header] Failed to get getUserAvatarURL:",v)}try{f=g.findByProps("getDefaultAvatarURL")?.getDefaultAvatarURL}catch(v){console.warn("[Commands Header] Failed to get getDefaultAvatarURL:",v)}const C=n.ReactNative.StyleSheet.create({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,justifyContent:"center",alignItems:"center",overflow:"hidden",borderWidth:2,borderColor:w.semanticColors.MOBILE_CHATINPUT_BORDER_DEFAULT},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:w.semanticColors.INTERACTIVE_ACTIVE},textContainer:{flex:1,marginLeft:4,justifyContent:"center"},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"},avatarPlaceholder:{width:48,height:48,tintColor:w.semanticColors.INTERACTIVE_NORMAL}});n.React.useEffect(function(){if(d){let v,A=!1;const F=d.avatar?.startsWith("a_");if(u&&d.avatar)try{v=u(d,F),A=F}catch(L){console.warn("[Commands Header] Error getting custom avatar:",L),v=null}if(!v&&f&&typeof f=="function")try{v=f(d)}catch(L){console.warn("[Commands Header] Error getting default avatar URL:",L),v=null}if(!v&&d.avatar){const L=d.avatar.startsWith("a_");v=`https://cdn.discordapp.com/avatars/${d.id}/${d.avatar}.${L?"gif":"png"}?size=256`,A=L}else v||(v=`https://cdn.discordapp.com/embed/avatars/${d.discriminator?parseInt(d.discriminator)%5:(parseInt(d.id)>>22)%6}.png`);o(v),l(A)}},[d]);const k=function(){if(r.storage.hiddenSett