diff --git a/Commands/index.js b/Commands/index.js index 0f36fc1..dedf3ae 100644 --- a/Commands/index.js +++ b/Commands/index.js @@ -1,7 +1,7 @@ (function(F,pe,r,C,D,S,u,e,he,b,o,N,Ce){"use strict";const be=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}},Re=async function(){return{text:(await(await fetch("https://dogapi.dog/api/v2/facts?limit=1")).json()).data[0].attributes.body}},Ie=async function(){const t=await(await fetch("https://catfact.ninja/fact")).json();return{text:t.fact,length:t.length}},Ne=async function(t){return await(await fetch(`https://api.obamabot.me/v2/image/petpet?image=${t.replace("webp","png")}`)).json()},Se=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}},O=C.findByProps("sendMessage"),U=function(t){let a=t.text;return r.storage.factSettings?.includeCitation&&t.source&&(a+=` Source: ${t.source}`),a},Ee={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 Ie(),s=Date.now().toString();return O.sendMessage(a.channel.id,{content:U(n)},void 0,{nonce:s}),{type:4}}catch(n){return console.error("[CatFact] Error:",n),{type:4}}}},ve={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 Re(),s=Date.now().toString();return O.sendMessage(a.channel.id,{content:U(n)},void 0,{nonce:s}),{type:4}}catch(n){return console.error("[DogFact] Error:",n),{type:4}}}},we={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 be(),s=Date.now().toString();return O.sendMessage(a.channel.id,{content:U(n)},void 0,{nonce:s}),{type:4}}catch(n){return console.error("[UselessFact] Error:",n),{type:4}}}},v={CONTENT:"This list is over 2000 characters. Send anyway?",CONFIRM:"Send",CANCEL:"Cancel"},Ae={DETAILED:"detailed"},W="",k={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."},H={SEMICOL:"; ",NEW_LINE:` -`},Te="Nothing to see here, huh...",j="github.com/fres621/vendetta-plugins",E={ENABLED:"\u2705",DISABLED:"\u274C",SELECTED:"\u2705",NOT_SELECTED:"\u274C"},De=C.findByProps("sendMessage","receiveMessage"),w=C.findByProps("sendBotMessage"),K=(function(){try{return C.findByStoreName("UserStore").getCurrentUser()?.premiumType===2?4e3:2e3}catch{return 2e3}})(),z=function(t){return Object.keys(t).includes(j)},q=function(t){return Object.values(t).find(function(a){return a.id==j})?.enabled},X=function(t){return t.find(function(a){return a.name===Ae.DETAILED})?.value??!1},B=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(H.SEMICOL)||"Unknown"},Y=function(t){return t.join(H.NEW_LINE).trimEnd()},L=function(t){return Y(t).length},P=async function(t,a){const n=Date.now().toString();await De.sendMessage(t,{content:Y(a)},void 0,{nonce:n})},J=function(t,a){return[`**My ${t} List | ${a} ${t}s**`,W]};async function ke(t,a){try{const n=X(t),s=r.storage.themeListAlwaysDetailed??!1;if(!D.themes||typeof D.themes!="object"){const p=a.channel.id;return w.sendBotMessage(p,"No themes found or themes not loaded yet."),{type:4}}const i=Object.values(D.themes),c=a.channel.id,d=J("Theme",Object.keys(D.themes).length);if(i.length)for(const p of i){if(!p||typeof p!="object")continue;const{selected:f,data:y,id:I}=p,A=y?.name||"Unknown Theme",T=y?.description||"No description",_=y?.authors;n||s?d.push(`> **Name**: ${A}`,`> **Selected**: ${f?E.SELECTED:E.NOT_SELECTED}`,`> **Description**: ${T}`,`> **Authors**: ${B(_)}`,`> **[Install!](${I||"unknown"})**`,W):d.push(`> ${f?E.SELECTED:E.NOT_SELECTED} **${A}** by ${B(_)}`)}else d.push(Te);const g=L(d)>K;if(g&&!z(S.plugins))w.sendBotMessage(c,k.SLM_NOT_INSTALLED);else if(g&&!q(S.plugins))w.sendBotMessage(c,k.SLM_NOT_ENABLED);else{if(L(d)>2e3)return u.alerts.showConfirmationAlert({content:v.CONTENT,confirmText:v.CONFIRM,cancelText:v.CANCEL,onConfirm:async function(){return await P(c,d)}});await P(c,d)}}catch(n){return console.error("[ThemeList] Error:",n),{type:4}}}async function Be(t,a){try{const n=X(t),s=r.storage.pluginListAlwaysDetailed??!1,i=a.channel.id;if(!S.plugins||typeof S.plugins!="object")return w.sendBotMessage(i,"No plugins found or plugins not loaded yet."),{type:4};const c=J("Plugin",Object.keys(S.plugins).length);for(const g of Object.values(S.plugins)){if(!g||typeof g!="object")continue;const{enabled:p,manifest:f,id:y}=g,I=f?.name||"Unknown Plugin",A=f?.description||"No description",T=f?.authors;n||s?c.push(`> **Name**: ${I}`,`> **Status**: ${p?E.ENABLED:E.DISABLED}`,`> **Description**: ${A}`,`> **Authors**: ${B(T)}`,`> **[Install!](${y||"unknown"})**`,W):c.push(`> ${p?E.ENABLED:E.DISABLED} **${I}** by ${B(T)}`)}const d=L(c)>K;if(d&&!z(S.plugins))w.sendBotMessage(i,k.SLM_NOT_INSTALLED);else if(d&&!q(S.plugins))w.sendBotMessage(i,k.SLM_NOT_ENABLED);else{if(L(c)>2e3)return u.alerts.showConfirmationAlert({content:v.CONTENT,confirmText:v.CONFIRM,cancelText:v.CANCEL,onConfirm:async function(){return await P(i,c)}});await P(i,c)}}catch(n){return console.error("[PluginList] Error:",n),{type:4}}}const Le={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:Be,applicationId:"-1",inputType:1,type:1},Pe={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:ke,applicationId:"-1",inputType:1,type:1},xe=C.findByStoreName("UserStore"),$e=C.findByProps("sendMessage"),Me={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 xe.getUser(t[0].value)).getAvatarURL(512),s=await Ne(n),i=Date.now().toString();return $e.sendMessage(a.channel.id,{content:s.url},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[PetPet] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},_e=C.findByProps("sendMessage"),Ve=C.findByProps("sendBotMessage","sendMessage","receiveMessage"),Q=async function(t){const a="https://konachan.com/post.json",n=t?"rating:explicit":"rating:safe",s=Math.floor(Math.random()*100);try{const i=await(await fetch(`${a}?tags=${n}&limit=1&page=${s}`)).json();return!Array.isArray(i)||i.length===0?null:i[0].file_url}catch(i){return console.error("[KonoChan Randomizer] Error fetching image:",i),null}},Z=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})},ee={name:"nsfw",description:"Include NSFW content?",type:5,required:!1,displayName:"nsfw",displayDescription:"Include NSFW content?"},Fe={name:"konoself",displayName:"konoself",description:"Fetch a random image from KonoChan for yourself.",displayDescription:"Fetch a random image from KonoChan for yourself.",options:[ee],execute:async function(t,a){try{const n=new Map(t.map(function(c){return[c.name,c]})).get("nsfw")?.value||!1,s=r.storage.hiddenSettings?.konochanBypassNsfw||!1;if(console.log(`[KonoSelf] NSFW: ${n}, Channel NSFW: ${a.channel.nsfw}, Bypass: ${s}`),n&&!a.channel.nsfw&&!s)return Z(),{type:4};const i=await Q(n);return i?(Ve.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},Oe={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:[ee],execute:async function(t,a){try{const n=new Map(t.map(function(d){return[d.name,d]})).get("nsfw")?.value||!1,s=r.storage.hiddenSettings?.konochanBypassNsfw||!1;if(console.log(`[KonoSend] NSFW: ${n}, Channel NSFW: ${a.channel.nsfw}, Bypass: ${s}`),n&&!a.channel.nsfw&&!s)return Z(),{type:4};const i=await Q(n);if(!i)return{type:4};const c=Date.now().toString();return _e.sendMessage(a.channel.id,{content:i},void 0,{nonce:c}),{type:4}}catch(n){return console.error("[KonoSend] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},te=C.findByProps("getAPIBaseURL","get"),Ue=C.findByProps("sendMessage"),x=async function(t,a,n){const s=a?`&author_id=${a}`:"",i=n?`&channel_id=${n}`:"",c=a?"":"&min_id=0";return(await te.get({url:`/guilds/${t}/messages/search`,query:`include_nsfw=true${s}${i}${c}&sort_by=timestamp&sort_order=asc&offset=0`})).body.messages[0][0]},ae=async function(t,a){const n=a?`&author_id=${a}`:"",s=a?"":"&min_id=0";return(await te.get({url:`/channels/${t}/messages/search`,query:`&sort_by=timestamp&sort_order=asc&offset=0${n}${s}`})).body.messages[0][0]},We={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(I){return[I.name,I]})),s=n.get("user")?.value,i=n.get("channel")?.value,c=n.get("send")?.value,d=a.guild?.id,g=a.channel.id,p=a.channel.type===1;let f="https://discord.com/channels/",y;if(!s&&!i)p?(y=await ae(g),f+=`@me/${g}/${y.id}`):(y=await x(d),f+=`${d}/${y.channel_id}/${y.id}`);else if(s)p?(y=await ae(g,s),f+=`@me/${g}/${y.id}`):(y=await x(d,s),f+=`${d}/${y.channel_id}/${y.id}`);else if(i){if(p)return{type:4};y=await x(d,null,i),f+=`${d}/${i}/${y.id}`}else{if(p)return{type:4};y=await x(d,s,i),f+=`${d}/${i}/${y.id}`}if(c){const I=Date.now().toString();return Ue.sendMessage(a.channel.id,{content:f},void 0,{nonce:I}),{type:4}}else return e.url.openDeeplink(f),{type:4}}catch(n){return console.error("[FirstMessage] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},Ge=C.findByProps("sendMessage"),He=C.findByProps("sendBotMessage","sendMessage","receiveMessage");function je(){let{height:t,width:a,scale:n}=e.ReactNative.Dimensions.get("screen");return t*=n,a*=n,{width:a,height:t}}function Ke(){try{const t=new Date,a=new Date(t.getTime()+t.getTimezoneOffset()*6e4),n=a.getFullYear(),s=String(a.getMonth()+1).padStart(2,"0"),i=String(a.getDate()).padStart(2,"0"),c=String(a.getHours()).padStart(2,"0"),d=String(a.getMinutes()).padStart(2,"0"),g=String(a.getSeconds()).padStart(2,"0");return`${n}-${s}-${i} ${c}:${d}:${g}`}catch{return"Unknown"}}function ze(){try{const t=C.findByProps("memory");if(!t)return{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A"};const{cpuCoreCount:a,cpuPercentage:n,memory:s}=t,i=n?n.toFixed(2)+"%":"N/A",c=s?parseFloat((s/1e3).toPrecision(3))+" MB":"N/A";return{cpuCoreCount:a,cpuPerc:i,memUsage:c}}catch(t){return console.warn("Hardware info unavailable:",t),{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A"}}}function qe(){try{const{NativeModules:t}=e.ReactNative;return(t.InfoDictionaryManager??t.RTNClientInfoManager)||{}}catch(t){return console.warn("Discord info unavailable:",t),{}}}function Xe(){try{const{cpuCoreCount:t,cpuPerc:a,memUsage:n}=ze(),s=qe(),{vendetta:i,discord:c,react:d,hermes:g,os:p,device:f}=he.getDebugInfo(),y=Ke(),{version:I,bytecodeVersion:A}=g||{},{version:T,nativeVersion:_}=d||{},{name:ge,version:Mt,sdk:ye}=p||{},{manufacturer:_t,brand:fe,model:me,codename:Vt}=f||{},{version:Ft}=i||{},{version:Ot,build:Ut}=c||{},Wt=ge=="iOS"?Vt:`${fe} ${me}`,{width:Gt,height:Ht}=je(),V={Device:{Device:Wt||"Unknown",Model:me||"Unknown",Manufacturer:_t||"Unknown",Brand:fe||"Unknown",Display:`${Gt}x${Ht}`},Hardware:{"CPU Cores":t||"N/A","CPU Usage":a,"Memory Usage":n},Software:{OS:ge||"Unknown",Version:Mt||"Unknown"},Discord:{Version:Ot||"Unknown",Build:Ut||"Unknown",Vendetta:Ft||"Unknown"},React:{Version:T||"Unknown","Hermes Bytecode":A||"Unknown",Hermes:I||"Unknown",Native:_||"Unknown"},Time:{UTC:y}};return window.enmity&&(V.Discord.Enmity=window.enmity.version),window.aliucord&&(V.Discord.Aliucord=window.aliucord.version),ye&&(V.Software["SDK Version"]=ye),V}catch(t){throw console.error("Error generating system info:",t),t}}const ne=["device","hardware","software","discord","react","time","ephemeral"];for(const t of ne)r.storage[t]===void 0&&(r.storage[t]=!0);function Ye(t,a){try{const n=[`__System Information__ +`},Te="Nothing to see here, huh...",j="github.com/fres621/vendetta-plugins",E={ENABLED:"\u2705",DISABLED:"\u274C",SELECTED:"\u2705",NOT_SELECTED:"\u274C"},De=C.findByProps("sendMessage","receiveMessage"),w=C.findByProps("sendBotMessage"),K=(function(){try{return C.findByStoreName("UserStore").getCurrentUser()?.premiumType===2?4e3:2e3}catch{return 2e3}})(),z=function(t){return Object.keys(t).includes(j)},q=function(t){return Object.values(t).find(function(a){return a.id==j})?.enabled},X=function(t){return t.find(function(a){return a.name===Ae.DETAILED})?.value??!1},B=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(H.SEMICOL)||"Unknown"},Y=function(t){return t.join(H.NEW_LINE).trimEnd()},L=function(t){return Y(t).length},P=async function(t,a){const n=Date.now().toString();await De.sendMessage(t,{content:Y(a)},void 0,{nonce:n})},J=function(t,a){return[`**My ${t} List | ${a} ${t}s**`,W]};async function ke(t,a){try{const n=X(t),s=r.storage.themeListAlwaysDetailed??!1;if(!D.themes||typeof D.themes!="object"){const p=a.channel.id;return w.sendBotMessage(p,"No themes found or themes not loaded yet."),{type:4}}const i=Object.values(D.themes),c=a.channel.id,d=J("Theme",Object.keys(D.themes).length);if(i.length)for(const p of i){if(!p||typeof p!="object")continue;const{selected:f,data:y,id:I}=p,A=y?.name||"Unknown Theme",T=y?.description||"No description",_=y?.authors;n||s?d.push(`> **Name**: ${A}`,`> **Selected**: ${f?E.SELECTED:E.NOT_SELECTED}`,`> **Description**: ${T}`,`> **Authors**: ${B(_)}`,`> **[Install!](${I||"unknown"})**`,W):d.push(`> ${f?E.SELECTED:E.NOT_SELECTED} **${A}** by ${B(_)}`)}else d.push(Te);const g=L(d)>K;if(g&&!z(S.plugins))w.sendBotMessage(c,k.SLM_NOT_INSTALLED);else if(g&&!q(S.plugins))w.sendBotMessage(c,k.SLM_NOT_ENABLED);else{if(L(d)>2e3)return u.alerts.showConfirmationAlert({content:v.CONTENT,confirmText:v.CONFIRM,cancelText:v.CANCEL,onConfirm:async function(){return await P(c,d)}});await P(c,d)}}catch(n){return console.error("[ThemeList] Error:",n),{type:4}}}async function Be(t,a){try{const n=X(t),s=r.storage.pluginListAlwaysDetailed??!1,i=a.channel.id;if(!S.plugins||typeof S.plugins!="object")return w.sendBotMessage(i,"No plugins found or plugins not loaded yet."),{type:4};const c=J("Plugin",Object.keys(S.plugins).length);for(const g of Object.values(S.plugins)){if(!g||typeof g!="object")continue;const{enabled:p,manifest:f,id:y}=g,I=f?.name||"Unknown Plugin",A=f?.description||"No description",T=f?.authors;n||s?c.push(`> **Name**: ${I}`,`> **Status**: ${p?E.ENABLED:E.DISABLED}`,`> **Description**: ${A}`,`> **Authors**: ${B(T)}`,`> **[Install!](${y||"unknown"})**`,W):c.push(`> ${p?E.ENABLED:E.DISABLED} **${I}** by ${B(T)}`)}const d=L(c)>K;if(d&&!z(S.plugins))w.sendBotMessage(i,k.SLM_NOT_INSTALLED);else if(d&&!q(S.plugins))w.sendBotMessage(i,k.SLM_NOT_ENABLED);else{if(L(c)>2e3)return u.alerts.showConfirmationAlert({content:v.CONTENT,confirmText:v.CONFIRM,cancelText:v.CANCEL,onConfirm:async function(){return await P(i,c)}});await P(i,c)}}catch(n){return console.error("[PluginList] Error:",n),{type:4}}}const Le={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:Be,applicationId:"-1",inputType:1,type:1},Pe={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:ke,applicationId:"-1",inputType:1,type:1},xe=C.findByStoreName("UserStore"),$e=C.findByProps("sendMessage"),Me={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 xe.getUser(t[0].value)).getAvatarURL(512),s=await Ne(n),i=Date.now().toString();return $e.sendMessage(a.channel.id,{content:s.url},void 0,{nonce:i}),{type:4}}catch(n){return console.error("[PetPet] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},_e=C.findByProps("sendMessage"),Ve=C.findByProps("sendBotMessage","sendMessage","receiveMessage"),Q=async function(t){const a="https://konachan.com/post.json",n=t?"rating:explicit":"rating:safe",s=Math.floor(Math.random()*100);try{const i=await(await fetch(`${a}?tags=${n}&limit=1&page=${s}`)).json();return!Array.isArray(i)||i.length===0?null:i[0].file_url}catch(i){return console.error("[KonoChan Randomizer] Error fetching image:",i),null}},Z=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})},ee={name:"nsfw",description:"Include NSFW content?",type:5,required:!1,displayName:"nsfw",displayDescription:"Include NSFW content?"},Fe={name:"konoself",displayName:"konoself",description:"Fetch a random image from KonoChan for yourself.",displayDescription:"Fetch a random image from KonoChan for yourself.",options:[ee],execute:async function(t,a){try{const n=new Map(t.map(function(c){return[c.name,c]})).get("nsfw")?.value||!1,s=r.storage.hiddenSettings?.konochanBypassNsfw||!1;if(console.log(`[KonoSelf] NSFW: ${n}, Channel NSFW: ${a.channel.nsfw}, Bypass: ${s}`),n&&!a.channel.nsfw&&!s)return Z(),{type:4};const i=await Q(n);return i?(Ve.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},Oe={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:[ee],execute:async function(t,a){try{const n=new Map(t.map(function(d){return[d.name,d]})).get("nsfw")?.value||!1,s=r.storage.hiddenSettings?.konochanBypassNsfw||!1;if(console.log(`[KonoSend] NSFW: ${n}, Channel NSFW: ${a.channel.nsfw}, Bypass: ${s}`),n&&!a.channel.nsfw&&!s)return Z(),{type:4};const i=await Q(n);if(!i)return{type:4};const c=Date.now().toString();return _e.sendMessage(a.channel.id,{content:i},void 0,{nonce:c}),{type:4}}catch(n){return console.error("[KonoSend] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},te=C.findByProps("getAPIBaseURL","get"),Ue=C.findByProps("sendMessage"),x=async function(t,a,n){const s=a?`&author_id=${a}`:"",i=n?`&channel_id=${n}`:"",c=a?"":"&min_id=0";return(await te.get({url:`/guilds/${t}/messages/search`,query:`include_nsfw=true${s}${i}${c}&sort_by=timestamp&sort_order=asc&offset=0`})).body.messages[0][0]},ae=async function(t,a){const n=a?`&author_id=${a}`:"",s=a?"":"&min_id=0";return(await te.get({url:`/channels/${t}/messages/search`,query:`&sort_by=timestamp&sort_order=asc&offset=0${n}${s}`})).body.messages[0][0]},We={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(I){return[I.name,I]})),s=n.get("user")?.value,i=n.get("channel")?.value,c=n.get("send")?.value,d=a.guild?.id,g=a.channel.id,p=a.channel.type===1;let f="https://discord.com/channels/",y;if(!s&&!i)p?(y=await ae(g),f+=`@me/${g}/${y.id}`):(y=await x(d),f+=`${d}/${y.channel_id}/${y.id}`);else if(s)p?(y=await ae(g,s),f+=`@me/${g}/${y.id}`):(y=await x(d,s),f+=`${d}/${y.channel_id}/${y.id}`);else if(i){if(p)return{type:4};y=await x(d,null,i),f+=`${d}/${i}/${y.id}`}else{if(p)return{type:4};y=await x(d,s,i),f+=`${d}/${i}/${y.id}`}if(c){const I=Date.now().toString();return Ue.sendMessage(a.channel.id,{content:f},void 0,{nonce:I}),{type:4}}else return e.ReactNative.Linking.openURL(f),{type:4}}catch(n){return console.error("[FirstMessage] Error:",n),{type:4}}},applicationId:"-1",inputType:1,type:1},Ge=C.findByProps("sendMessage"),He=C.findByProps("sendBotMessage","sendMessage","receiveMessage");function je(){let{height:t,width:a,scale:n}=e.ReactNative.Dimensions.get("screen");return t*=n,a*=n,{width:a,height:t}}function Ke(){try{const t=new Date,a=new Date(t.getTime()+t.getTimezoneOffset()*6e4),n=a.getFullYear(),s=String(a.getMonth()+1).padStart(2,"0"),i=String(a.getDate()).padStart(2,"0"),c=String(a.getHours()).padStart(2,"0"),d=String(a.getMinutes()).padStart(2,"0"),g=String(a.getSeconds()).padStart(2,"0");return`${n}-${s}-${i} ${c}:${d}:${g}`}catch{return"Unknown"}}function ze(){try{const t=C.findByProps("memory");if(!t)return{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A"};const{cpuCoreCount:a,cpuPercentage:n,memory:s}=t,i=n?n.toFixed(2)+"%":"N/A",c=s?parseFloat((s/1e3).toPrecision(3))+" MB":"N/A";return{cpuCoreCount:a,cpuPerc:i,memUsage:c}}catch(t){return console.warn("Hardware info unavailable:",t),{cpuCoreCount:"N/A",cpuPerc:"N/A",memUsage:"N/A"}}}function qe(){try{const{NativeModules:t}=e.ReactNative;return(t.InfoDictionaryManager??t.RTNClientInfoManager)||{}}catch(t){return console.warn("Discord info unavailable:",t),{}}}function Xe(){try{const{cpuCoreCount:t,cpuPerc:a,memUsage:n}=ze(),s=qe(),{vendetta:i,discord:c,react:d,hermes:g,os:p,device:f}=he.getDebugInfo(),y=Ke(),{version:I,bytecodeVersion:A}=g||{},{version:T,nativeVersion:_}=d||{},{name:ge,version:Mt,sdk:ye}=p||{},{manufacturer:_t,brand:fe,model:me,codename:Vt}=f||{},{version:Ft}=i||{},{version:Ot,build:Ut}=c||{},Wt=ge=="iOS"?Vt:`${fe} ${me}`,{width:Gt,height:Ht}=je(),V={Device:{Device:Wt||"Unknown",Model:me||"Unknown",Manufacturer:_t||"Unknown",Brand:fe||"Unknown",Display:`${Gt}x${Ht}`},Hardware:{"CPU Cores":t||"N/A","CPU Usage":a,"Memory Usage":n},Software:{OS:ge||"Unknown",Version:Mt||"Unknown"},Discord:{Version:Ot||"Unknown",Build:Ut||"Unknown",Vendetta:Ft||"Unknown"},React:{Version:T||"Unknown","Hermes Bytecode":A||"Unknown",Hermes:I||"Unknown",Native:_||"Unknown"},Time:{UTC:y}};return window.enmity&&(V.Discord.Enmity=window.enmity.version),window.aliucord&&(V.Discord.Aliucord=window.aliucord.version),ye&&(V.Software["SDK Version"]=ye),V}catch(t){throw console.error("Error generating system info:",t),t}}const ne=["device","hardware","software","discord","react","time","ephemeral"];for(const t of ne)r.storage[t]===void 0&&(r.storage[t]=!0);function Ye(t,a){try{const n=[`__System Information__ `],s=Xe();Object.keys(s).forEach(function(d){const g=r.storage[d.toLowerCase()],p=t.find(function(f){return f.name==d.toLowerCase()})?.value??g;(p||g)&&!(g&&!p)&&(n.push(`[**${d}**]`),Object.keys(s[d]).forEach(function(f){n.push(`> ${f}: ${s[d][f]}`)}))});const i=r.storage.ephemeral,c=t.find(function(d){return d.name=="ephemeral"})?.value??i;if((c||i)&&!(i&&!c))return He.sendBotMessage(a.channel.id,n.join(` `)),{type:4};{const d=Date.now().toString();return Ge.sendMessage(a.channel.id,{content:n.join(` `)},void 0,{nonce:d}),{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},...ne.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:Ye,applicationId:"-1",inputType:1,type:1},re=C.findByProps("sendMessage","receiveMessage"),Qe=C.findByStoreName("SpotifyStore");async function Ze(t,a){return r.storage.enabledCommands?.spotifyTrack?$(a,function(n){return`https://open.spotify.com/track/${n.id}`}):{type:4}}async function et(t,a){return r.storage.enabledCommands?.spotifyAlbum?$(a,function(n){return`https://open.spotify.com/album/${n.album.id}`}):{type:4}}async function tt(t,a){return r.storage.enabledCommands?.spotifyArtists?$(a,function(n){return n.artists.map(function(s){return`[${s.name}](${s.external_urls.spotify})`}).join(` diff --git a/Commands/manifest.json b/Commands/manifest.json index 2066e01..86f415e 100644 --- a/Commands/manifest.json +++ b/Commands/manifest.json @@ -1 +1 @@ -{"authors":[{"name":"kmmiio99o","id":"879393496627306587"}],"main":"index.js","vendetta":{"icon":"ic_badge_staff","original":"plugins/all-in-one"},"name":"Commands","description":"A collection of fixed commands including facts, petpet, and more.","version":"1.0.0","hash":"95d099d888fa6ec29e58c48291c36cae8b9b149b74122a5942a56960a231b155"} \ No newline at end of file +{"authors":[{"name":"kmmiio99o","id":"879393496627306587"}],"main":"index.js","vendetta":{"icon":"ic_badge_staff","original":"plugins/all-in-one"},"name":"Commands","description":"A collection of fixed commands including facts, petpet, and more.","version":"1.0.0","hash":"632a319565a4d3ba5016fd6cd98983e0d6656b537a078868dc403421e5add69d"} \ No newline at end of file