From c42048baf4d04a7d4d930f586a6b36385bda9284 Mon Sep 17 00:00:00 2001 From: kmmiio99o <164557248+kmmiio99o@users.noreply.github.com> Date: Sat, 27 Sep 2025 23:29:34 +0200 Subject: [PATCH] deploy --- Commands/index.js | 6 +++--- Commands/manifest.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Commands/index.js b/Commands/index.js index 2bc8831..3bfbca9 100644 --- a/Commands/index.js +++ b/Commands/index.js @@ -1,4 +1,4 @@ -(function(R,q,s,m,A,C,b,i,K,G){"use strict";const U=m.findByProps("sendMessage"),g=function(n,t,a,e,o){if(!t)return{type:4};if(o)return{type:4,data:{content:t,flags:64}};const c={content:t,...a&&e?.factSettings?.sendAsReply?{messageReference:{messageId:a}}:{}};return U.sendMessage(n,c,void 0,{nonce:(Date.now()*4194304).toString()}),{type:4}},z=async function(){const n=await(await fetch("https://uselessfacts.jsph.pl/api/v2/facts/random")).json();return{text:n.text,source:n.source,language:n.language}},H=async function(){return{text:(await(await fetch("https://dogapi.dog/api/v2/facts?limit=1")).json()).data[0].attributes.body}},Y=async function(){const n=await(await fetch("https://catfact.ninja/fact")).json();return{text:n.fact,length:n.length}},J=async function(n){return await(await fetch(`https://api.obamabot.me/v2/image/petpet?image=${n.replace("webp","png")}`)).json()},v=function(n){let t=n.text;return s.storage.factSettings?.includeCitation&&n.source&&(t+=` +(function(R,q,s,m,A,C,b,i,G,K){"use strict";const U=m.findByProps("sendMessage"),g=function(n,t,a,e,o){if(!t)return{type:4};if(o)return{type:4,data:{content:t,flags:64}};const c={content:t,...a&&e?.factSettings?.sendAsReply?{messageReference:{messageId:a}}:{}};return U.sendMessage(n,c,void 0,{nonce:(Date.now()*4194304).toString()}),{type:4}},z=async function(){const n=await(await fetch("https://uselessfacts.jsph.pl/api/v2/facts/random")).json();return{text:n.text,source:n.source,language:n.language}},H=async function(){return{text:(await(await fetch("https://dogapi.dog/api/v2/facts?limit=1")).json()).data[0].attributes.body}},Y=async function(){const n=await(await fetch("https://catfact.ninja/fact")).json();return{text:n.fact,length:n.length}},J=async function(n){return await(await fetch(`https://api.obamabot.me/v2/image/petpet?image=${n.replace("webp","png")}`)).json()},v=function(n){let t=n.text;return s.storage.factSettings?.includeCitation&&n.source&&(t+=` -Source: ${n.source}`),t},Q={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(n,t){const a=await Y();return g(t.channel.id,v(a),t.message?.id,s.storage)}},X={name:"dogfact",displayName:"dogfact",description:"Sends a dog fact.",displayDescription:"Sends a dog fact.",applicationId:"-1",inputType:1,type:1,execute:async function(n,t){const a=await H();return g(t.channel.id,v(a),t.message?.id,s.storage)}},Z={name:"useless",displayName:"useless",description:"Sends a useless fact.",displayDescription:"Sends a useless fact.",applicationId:"-1",inputType:1,type:1,execute:async function(n,t){const a=await z();return g(t.channel.id,v(a),t.message?.id,s.storage)}},L="https://vd-plugins.github.io/proxy/actuallythesun.github.io/vendetta-plugins/SplitLargeMessages/",p={ENABLED:"\u{1F7E2}",DISABLED:"\u{1F534}",SELECTED:"\u{1F536}",NOT_SELECTED:"\u{1F537}"},$=function(n){return n.map(function(t){return t.name}).join(", ")},w=function(n){return n.join(` -`).trimEnd()},N=function(n){return w(n).length},M=function(){return Object.keys(C.plugins).includes(L)},x=function(){return Object.values(C.plugins).find(function(n){return n.id===L})?.enabled??!1},k=function(){return b.alerts.showConfirmationAlert({title:"Large Message Warning",content:"This list is too long to send! Would you like to install the Split Large Messages plugin?",confirmText:"Install Plugin",cancelText:"Cancel",confirmColor:"brand",onConfirm:function(){i.openURL(L)}})},P=function(){return b.alerts.showConfirmationAlert({title:"Plugin Disabled",content:"The Split Large Messages plugin is installed but disabled. Would you like to enable it now?",confirmText:"Enable Plugin",cancelText:"Cancel",confirmColor:"brand",onConfirm:function(){const n=Object.values(C.plugins).find(function(t){return t.id===L});n&&(n.enabled=!0)}})};async function ee(n,t){const a=s.storage.listSettings?.pluginListAlwaysDetailed??!1,e=[`**My Plugin List | ${Object.keys(C.plugins).length} Plugins**`,""];for(const o of Object.values(C.plugins)){const{enabled:c,manifest:u,id:f}=o,{name:h,description:r,authors:l}=u;n||a?e.push(`> **Name**: ${h}`,`> **Status**: ${c?p.ENABLED:p.DISABLED}`,`> **Description**: ${r}`,`> **Authors**: ${$(l)}`,`> **[Install!](${f})**`,""):e.push(`> ${c?p.ENABLED:p.DISABLED} **${h}** by ${$(l)}`)}return N(e)>2e3?M()?x()?b.alerts.showConfirmationAlert({title:"Large Message",content:"This list is over 2000 characters. Send anyway?",confirmText:"Send",cancelText:"Cancel",onConfirm:function(){return g(t.channel.id,w(e))}}):P():k():g(t.channel.id,w(e))}async function te(n,t){const a=s.storage.themeListAlwaysDetailed??!1,e=[`**My Theme List | ${Object.keys(A.themes).length} Themes**`,""],o=Object.values(A.themes);if(o.length)for(const c of o){const{selected:u,data:f,id:h}=c,{name:r,description:l,authors:W}=f;n||a?e.push(`> **Name**: ${r}`,`> **Selected**: ${u?p.SELECTED:p.NOT_SELECTED}`,`> **Description**: ${l}`,`> **Authors**: ${$(W)}`,`> **[Install!](${h})**`,""):e.push(`> ${u?p.SELECTED:p.NOT_SELECTED} **${r}** by ${$(W)}`)}else e.push("Nothing to see here, huh...");return N(e)>2e3?M()?x()?b.alerts.showConfirmationAlert({title:"Large Message",content:"This list is over 2000 characters. Send anyway?",confirmText:"Send",cancelText:"Cancel",onConfirm:function(){return g(t.channel.id,w(e))}}):P():k():g(t.channel.id,w(e))}const ne={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:async function(n,t){const a=n.find(function(e){return e.name==="detailed"})?.value??!1;return ee(a,t)},applicationId:"-1",inputType:1,type:1},ae={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:async function(n,t){const a=n.find(function(e){return e.name==="detailed"})?.value??!1;return te(a,t)},applicationId:"-1",inputType:1,type:1},se=m.findByStoreName("UserStore"),ie={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(n,t){const a=(await se.getUser(n[0].value)).getAvatarURL(512),e=await J(a);return g(t.channel.id,e.url,t.message?.id)},applicationId:"-1",inputType:1,type:1},I=m.findByProps("sendMessage"),B=m.findByProps("sendBotMessage","sendMessage","receiveMessage"),F=async function(n){const t="https://konachan.com/post.json",a=n?"rating:explicit":"rating:safe",e=Math.floor(Math.random()*100);try{const o=await(await fetch(`${t}?tags=${a}&limit=1&page=${e}`)).json();return!Array.isArray(o)||o.length===0?null:o[0].file_url}catch(o){return console.error("[KonoChan Randomizer] Error fetching image:",o),null}},j=function(){return b.alerts.showConfirmationAlert({title:"NSFW Content Warning",content:"NSFW content can only be sent in NSFW channels!",confirmText:"Okay",cancelText:null,confirmColor:"brand",isDismissable:!0})},O={name:"nsfw",description:"Include NSFW content?",type:5,required:!1,displayName:"nsfw",displayDescription:"Include NSFW content?"},oe={name:"konoself",displayName:"konoself",description:"Fetch a random image from KonoChan for yourself.",displayDescription:"Fetch a random image from KonoChan for yourself.",options:[O],execute:async function(n,t){const a=new Map(n.map(function(o){return[o.name,o]})).get("nsfw")?.value||!1;if(a&&!t.channel.nsfw)return j(),{type:4};const e=await F(a);return e?(B.sendBotMessage(t.channel.id,`Here's your random image: ${e}`),{type:4}):(B.sendBotMessage(t.channel.id,"No image found. Try again later."),{type:4})},applicationId:"-1",inputType:1,type:1},le={name:"konosend",displayName:"konosend",description:"Fetch a random image from KonoChan and send it to the channel.",displayDescription:"Fetch a random image from KonoChan and send it to the channel.",options:[O],execute:async function(n,t){const a=new Map(n.map(function(c){return[c.name,c]})).get("nsfw")?.value||!1;if(a&&!t.channel.nsfw)return j(),{type:4};const e=await F(a);if(!e){const c=Date.now().toString();return I.sendMessage(t.channel.id,{content:"No image found. Try again later."},void 0,{nonce:c}),{type:4}}const o=Date.now().toString();return I.sendMessage(t.channel.id,{content:e},void 0,{nonce:o}),{type:4}},applicationId:"-1",inputType:1,type:1},D=m.findByProps("sendBotMessage","sendMessage","receiveMessage"),_=m.findByProps("getAPIBaseURL","get"),E=async function(n,t,a){const e=t?`&author_id=${t}`:"",o=a?`&channel_id=${a}`:"",c=t?"":"&min_id=0";return(await _.get({url:`/guilds/${n}/messages/search`,query:`include_nsfw=true${e}${o}${c}&sort_by=timestamp&sort_order=asc&offset=0`})).body.messages[0][0]},V=async function(n,t){const a=t?`&author_id=${t}`:"",e=t?"":"&min_id=0";return(await _.get({url:`/channels/${n}/messages/search`,query:`&sort_by=timestamp&sort_order=asc&offset=0${a}${e}`})).body.messages[0][0]},re={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}],applicationId:"-1",inputType:1,type:1,execute:async function(n,t){const a=new Map(n.map(function(r){return[r.name,r]})),e=a.get("user")?.value,o=a.get("channel")?.value,c=a.get("send")?.value,u=t.guild?.id,f=t.channel.id,h=t.channel.type===1;try{if(h&&(o||e&&o))return D.sendBotMessage(f,"This combination cannot be used in DMs!"),{type:4};let r="https://discord.com/channels/";if(!e&&!o)if(h){const l=await V(f);r+=`@me/${f}/${l.id}`}else{const l=await E(u);r+=`${u}/${l.channel_id}/${l.id}`}else if(e)if(h){const l=await V(f,e);r+=`@me/${f}/${l.id}`}else{const l=await E(u,e);r+=`${u}/${l.channel_id}/${l.id}`}else if(o){const l=await E(u,null,o);r+=`${u}/${o}/${l.id}`}else{const l=await E(u,e,o);r+=`${u}/${o}/${l.id}`}return c?(D.sendBotMessage(f,r),{type:4}):i.url.openDeeplink(r)}catch{return D.sendBotMessage(f,"Failed to fetch the first message. Please try again."),{type:4}}}},{ScrollView:ce}=m.findByProps("ScrollView"),{TableRowGroup:y,TableSwitchRow:d,Stack:de,TableRow:S}=m.findByProps("TableSwitchRow","TableRowGroup","Stack","TableRow");s.storage.factSettings||(s.storage.factSettings={sendAsReply:!0,includeCitation:!1}),s.storage.listSettings||(s.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),s.storage.enabledCommands||(s.storage.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0,firstmessage:!0}),s.storage.pendingRestart||(s.storage.pendingRestart=!1);function ue(){K.useProxy(s.storage);const[n,t]=i.React.useReducer(function(e){return e+1},0);i.React.useEffect(function(){return function(){s.storage.pendingRestart&&(s.storage.pendingRestart=!1,b.alerts.showConfirmationAlert({title:"Restart Required",content:"You have made changes to commands. Please restart Discord to apply these changes.",confirmText:"Okay",cancelText:null}))}},[]);const a=function(e,o){s.storage.enabledCommands[e]=o,s.storage.pendingRestart=!0,t()};return i.React.createElement(G.View,{style:{flex:1}},i.React.createElement(ce,{style:{flex:1},contentContainerStyle:{paddingBottom:38}},i.React.createElement(de,{spacing:8},i.React.createElement(y,{title:"Facts Commands"},i.React.createElement(d,{label:"Send as Reply",subLabel:"Send facts as a reply to the command message",value:s.storage.factSettings?.sendAsReply??!0,onValueChange:function(e){s.storage.factSettings.sendAsReply=e,t()}}),i.React.createElement(d,{label:"Include Source Citation",subLabel:"Include the source of facts when available",value:s.storage.factSettings?.includeCitation??!1,onValueChange:function(e){s.storage.factSettings.includeCitation=e,t()}}),i.React.createElement(d,{label:"/catfact",subLabel:"Get random cat facts",value:s.storage.enabledCommands?.catfact??!0,onValueChange:function(e){return a("catfact",e)}}),i.React.createElement(d,{label:"/dogfact",subLabel:"Get random dog facts",value:s.storage.enabledCommands?.dogfact??!0,onValueChange:function(e){return a("dogfact",e)}}),i.React.createElement(d,{label:"/useless",subLabel:"Get random useless facts",value:s.storage.enabledCommands?.useless??!0,onValueChange:function(e){return a("useless",e)}})),i.React.createElement(y,{title:"List Commands"},i.React.createElement(d,{label:"Always Send Detailed Plugin List",subLabel:"Always use detailed mode when listing plugins",value:s.storage.listSettings?.pluginListAlwaysDetailed??!1,onValueChange:function(e){s.storage.listSettings.pluginListAlwaysDetailed=e,t()}}),i.React.createElement(d,{label:"Always Send Detailed Theme List",subLabel:"Always use detailed mode when listing themes",value:s.storage.listSettings?.themeListAlwaysDetailed??!1,onValueChange:function(e){s.storage.listSettings.themeListAlwaysDetailed=e,t()}}),i.React.createElement(d,{label:"/plugin-list",subLabel:"List all installed plugins",value:s.storage.enabledCommands?.pluginList??!0,onValueChange:function(e){return a("pluginList",e)}}),i.React.createElement(d,{label:"/theme-list",subLabel:"List all installed themes",value:s.storage.enabledCommands?.themeList??!0,onValueChange:function(e){return a("themeList",e)}})),i.React.createElement(y,{title:"Image Commands"},i.React.createElement(d,{label:"/petpet",subLabel:"Create pet-pet GIF of a user",value:s.storage.enabledCommands?.petpet??!0,onValueChange:function(e){return a("petpet",e)}})),i.React.createElement(y,{title:"KonoChan Commands"},i.React.createElement(d,{label:"/konoself",subLabel:"Get random image from KonoChan (private)",value:s.storage.enabledCommands?.konoself??!0,onValueChange:function(e){return a("konoself",e)}}),i.React.createElement(d,{label:"/konosend",subLabel:"Send random image from KonoChan to channel",value:s.storage.enabledCommands?.konosend??!0,onValueChange:function(e){return a("konosend",e)}})),i.React.createElement(y,{title:"Message Commands"},i.React.createElement(d,{label:"/firstmessage",subLabel:"Get the first message in a channel",value:s.storage.enabledCommands?.firstmessage??!0,onValueChange:function(e){return a("firstmessage",e)}})),i.React.createElement(y,{title:"Credits"},i.React.createElement(S,{label:"Facts Commands",subLabel:"by jdev082"}),i.React.createElement(S,{label:"List Commands",subLabel:"by Kitomanari"}),i.React.createElement(S,{label:"PetPet Command",subLabel:"by wolfieeee"}),i.React.createElement(S,{label:"KonoChan Commands",subLabel:"by btmc727 & Rico040"})),i.React.createElement(y,{title:"About"},i.React.createElement(S,{label:"All-In-One Commands",subLabel:"A collection of useful commands"})))))}s.storage.factSettings||(s.storage.factSettings={sendAsReply:!0,includeCitation:!1}),s.storage.listSettings||(s.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),s.storage.enabledCommands||(s.storage.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0,firstmessage:!0});const fe={catfact:Q,dogfact:X,useless:Z,petpet:ie,pluginList:ne,themeList:ae,konoself:oe,konosend:le,firstmessage:re};let T=[];var me={onLoad:function(){console.log("[All-In-One Commands] Loading plugin...");for(const[n,t]of Object.entries(fe))s.storage.enabledCommands[n]&&T.push(q.registerCommand(t));console.log("[All-In-One Commands] Plugin loaded successfully!")},onUnload:function(){console.log("[All-In-One Commands] Unloading plugin..."),T.forEach(function(n){return n()}),T=[],console.log("[All-In-One Commands] Plugin unloaded successfully!")},settings:ue};return R.default=me,Object.defineProperty(R,"__esModule",{value:!0}),R})({},vendetta.commands,vendetta.plugin,vendetta.metro,vendetta.themes,vendetta.plugins,vendetta.ui,vendetta.metro.common,vendetta.storage,vendetta.metro.common.ReactNative); +Source: ${n.source}`),t},Q={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(n,t){const a=await Y();return g(t.channel.id,v(a),t.message?.id,s.storage)}},X={name:"dogfact",displayName:"dogfact",description:"Sends a dog fact.",displayDescription:"Sends a dog fact.",applicationId:"-1",inputType:1,type:1,execute:async function(n,t){const a=await H();return g(t.channel.id,v(a),t.message?.id,s.storage)}},Z={name:"useless",displayName:"useless",description:"Sends a useless fact.",displayDescription:"Sends a useless fact.",applicationId:"-1",inputType:1,type:1,execute:async function(n,t){const a=await z();return g(t.channel.id,v(a),t.message?.id,s.storage)}},L="https://vd-plugins.github.io/proxy/actuallythesun.github.io/vendetta-plugins/SplitLargeMessages/",p={ENABLED:"\u{1F7E2}",DISABLED:"\u{1F534}",SELECTED:"\u{1F536}",NOT_SELECTED:"\u{1F537}"},E=function(n){return n.map(function(t){return t.name}).join(", ")},w=function(n){return n.join(` +`).trimEnd()},N=function(n){return w(n).length},M=function(){return Object.keys(C.plugins).includes(L)},x=function(){return Object.values(C.plugins).find(function(n){return n.id===L})?.enabled??!1},k=function(){return b.alerts.showConfirmationAlert({title:"Large Message Warning",content:"This list is too long to send! Would you like to install the Split Large Messages plugin?",confirmText:"Install Plugin",cancelText:"Cancel",confirmColor:"brand",onConfirm:function(){i.openURL(L)}})},P=function(){return b.alerts.showConfirmationAlert({title:"Plugin Disabled",content:"The Split Large Messages plugin is installed but disabled. Would you like to enable it now?",confirmText:"Enable Plugin",cancelText:"Cancel",confirmColor:"brand",onConfirm:function(){const n=Object.values(C.plugins).find(function(t){return t.id===L});n&&(n.enabled=!0)}})};async function ee(n,t){const a=s.storage.listSettings?.pluginListAlwaysDetailed??!1,e=[`**My Plugin List | ${Object.keys(C.plugins).length} Plugins**`,""];for(const o of Object.values(C.plugins)){const{enabled:c,manifest:u,id:f}=o,{name:h,description:r,authors:l}=u;n||a?e.push(`> **Name**: ${h}`,`> **Status**: ${c?p.ENABLED:p.DISABLED}`,`> **Description**: ${r}`,`> **Authors**: ${E(l)}`,`> **[Install!](${f})**`,""):e.push(`> ${c?p.ENABLED:p.DISABLED} **${h}** by ${E(l)}`)}return N(e)>2e3?M()?x()?b.alerts.showConfirmationAlert({title:"Large Message",content:"This list is over 2000 characters. Send anyway?",confirmText:"Send",cancelText:"Cancel",onConfirm:function(){return g(t.channel.id,w(e))}}):P():k():g(t.channel.id,w(e))}async function te(n,t){const a=s.storage.themeListAlwaysDetailed??!1,e=[`**My Theme List | ${Object.keys(A.themes).length} Themes**`,""],o=Object.values(A.themes);if(o.length)for(const c of o){const{selected:u,data:f,id:h}=c,{name:r,description:l,authors:W}=f;n||a?e.push(`> **Name**: ${r}`,`> **Selected**: ${u?p.SELECTED:p.NOT_SELECTED}`,`> **Description**: ${l}`,`> **Authors**: ${E(W)}`,`> **[Install!](${h})**`,""):e.push(`> ${u?p.SELECTED:p.NOT_SELECTED} **${r}** by ${E(W)}`)}else e.push("Nothing to see here, huh...");return N(e)>2e3?M()?x()?b.alerts.showConfirmationAlert({title:"Large Message",content:"This list is over 2000 characters. Send anyway?",confirmText:"Send",cancelText:"Cancel",onConfirm:function(){return g(t.channel.id,w(e))}}):P():k():g(t.channel.id,w(e))}const ne={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:async function(n,t){const a=n.find(function(e){return e.name==="detailed"})?.value??!1;return ee(a,t)},applicationId:"-1",inputType:1,type:1},ae={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:async function(n,t){const a=n.find(function(e){return e.name==="detailed"})?.value??!1;return te(a,t)},applicationId:"-1",inputType:1,type:1},se=m.findByStoreName("UserStore"),ie={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(n,t){const a=(await se.getUser(n[0].value)).getAvatarURL(512),e=await J(a);return g(t.channel.id,e.url,t.message?.id)},applicationId:"-1",inputType:1,type:1},I=m.findByProps("sendMessage"),B=m.findByProps("sendBotMessage","sendMessage","receiveMessage"),F=async function(n){const t="https://konachan.com/post.json",a=n?"rating:explicit":"rating:safe",e=Math.floor(Math.random()*100);try{const o=await(await fetch(`${t}?tags=${a}&limit=1&page=${e}`)).json();return!Array.isArray(o)||o.length===0?null:o[0].file_url}catch(o){return console.error("[KonoChan Randomizer] Error fetching image:",o),null}},j=function(){return b.alerts.showConfirmationAlert({title:"NSFW Content Warning",content:"NSFW content can only be sent in NSFW channels!",confirmText:"Okay",cancelText:null,confirmColor:"brand",isDismissable:!0})},O={name:"nsfw",description:"Include NSFW content?",type:5,required:!1,displayName:"nsfw",displayDescription:"Include NSFW content?"},oe={name:"konoself",displayName:"konoself",description:"Fetch a random image from KonoChan for yourself.",displayDescription:"Fetch a random image from KonoChan for yourself.",options:[O],execute:async function(n,t){const a=new Map(n.map(function(o){return[o.name,o]})).get("nsfw")?.value||!1;if(a&&!t.channel.nsfw)return j(),{type:4};const e=await F(a);return e?(B.sendBotMessage(t.channel.id,`Here's your random image: ${e}`),{type:4}):(B.sendBotMessage(t.channel.id,"No image found. Try again later."),{type:4})},applicationId:"-1",inputType:1,type:1},le={name:"konosend",displayName:"konosend",description:"Fetch a random image from KonoChan and send it to the channel.",displayDescription:"Fetch a random image from KonoChan and send it to the channel.",options:[O],execute:async function(n,t){const a=new Map(n.map(function(c){return[c.name,c]})).get("nsfw")?.value||!1;if(a&&!t.channel.nsfw)return j(),{type:4};const e=await F(a);if(!e){const c=Date.now().toString();return I.sendMessage(t.channel.id,{content:"No image found. Try again later."},void 0,{nonce:c}),{type:4}}const o=Date.now().toString();return I.sendMessage(t.channel.id,{content:e},void 0,{nonce:o}),{type:4}},applicationId:"-1",inputType:1,type:1},D=m.findByProps("sendBotMessage","sendMessage","receiveMessage"),_=m.findByProps("getAPIBaseURL","get"),$=async function(n,t,a){const e=t?`&author_id=${t}`:"",o=a?`&channel_id=${a}`:"",c=t?"":"&min_id=0";return(await _.get({url:`/guilds/${n}/messages/search`,query:`include_nsfw=true${e}${o}${c}&sort_by=timestamp&sort_order=asc&offset=0`})).body.messages[0][0]},V=async function(n,t){const a=t?`&author_id=${t}`:"",e=t?"":"&min_id=0";return(await _.get({url:`/channels/${n}/messages/search`,query:`&sort_by=timestamp&sort_order=asc&offset=0${a}${e}`})).body.messages[0][0]},re={name:"firstmessage",displayName:"firstmessage",description:"Get the first message in the channel",displayDescription:"Get the first message in the channel",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}],applicationId:"-1",inputType:1,type:1,async execute(n,t){const a=new Map(n.map(function(r){return[r.name,r]})),e=a.get("user")?.value,o=a.get("channel")?.value,c=a.get("send")?.value,u=t.guild?.id,f=t.channel.id,h=t.channel.type===1;try{if(h&&(o||e&&o))return D.sendBotMessage(f,"This combination cannot be used in DMs!"),{type:4};let r="https://discord.com/channels/";if(!e&&!o)if(h){const l=await V(f);r+=`@me/${f}/${l.id}`}else{const l=await $(u);r+=`${u}/${l.channel_id}/${l.id}`}else if(e)if(h){const l=await V(f,e);r+=`@me/${f}/${l.id}`}else{const l=await $(u,e);r+=`${u}/${l.channel_id}/${l.id}`}else if(o){const l=await $(u,null,o);r+=`${u}/${o}/${l.id}`}else{const l=await $(u,e,o);r+=`${u}/${o}/${l.id}`}return c?(D.sendBotMessage(f,r),{type:4}):i.url.openDeeplink(r)}catch{return D.sendBotMessage(f,"Failed to fetch the first message. Please try again."),{type:4}}}},{ScrollView:ce}=m.findByProps("ScrollView"),{TableRowGroup:y,TableSwitchRow:d,Stack:de,TableRow:S}=m.findByProps("TableSwitchRow","TableRowGroup","Stack","TableRow");s.storage.factSettings||(s.storage.factSettings={sendAsReply:!0,includeCitation:!1}),s.storage.listSettings||(s.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),s.storage.enabledCommands||(s.storage.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0,firstmessage:!0}),s.storage.pendingRestart||(s.storage.pendingRestart=!1);function ue(){G.useProxy(s.storage);const[n,t]=i.React.useReducer(function(e){return e+1},0);i.React.useEffect(function(){return function(){s.storage.pendingRestart&&(s.storage.pendingRestart=!1,b.alerts.showConfirmationAlert({title:"Restart Required",content:"You have made changes to commands. Please restart Discord to apply these changes.",confirmText:"Okay",cancelText:null}))}},[]);const a=function(e,o){s.storage.enabledCommands[e]=o,s.storage.pendingRestart=!0,t()};return i.React.createElement(K.View,{style:{flex:1}},i.React.createElement(ce,{style:{flex:1},contentContainerStyle:{paddingBottom:38}},i.React.createElement(de,{spacing:8},i.React.createElement(y,{title:"Facts Commands"},i.React.createElement(d,{label:"Send as Reply",subLabel:"Send facts as a reply to the command message",value:s.storage.factSettings?.sendAsReply??!0,onValueChange:function(e){s.storage.factSettings.sendAsReply=e,t()}}),i.React.createElement(d,{label:"Include Source Citation",subLabel:"Include the source of facts when available",value:s.storage.factSettings?.includeCitation??!1,onValueChange:function(e){s.storage.factSettings.includeCitation=e,t()}}),i.React.createElement(d,{label:"/catfact",subLabel:"Get random cat facts",value:s.storage.enabledCommands?.catfact??!0,onValueChange:function(e){return a("catfact",e)}}),i.React.createElement(d,{label:"/dogfact",subLabel:"Get random dog facts",value:s.storage.enabledCommands?.dogfact??!0,onValueChange:function(e){return a("dogfact",e)}}),i.React.createElement(d,{label:"/useless",subLabel:"Get random useless facts",value:s.storage.enabledCommands?.useless??!0,onValueChange:function(e){return a("useless",e)}})),i.React.createElement(y,{title:"List Commands"},i.React.createElement(d,{label:"Always Send Detailed Plugin List",subLabel:"Always use detailed mode when listing plugins",value:s.storage.listSettings?.pluginListAlwaysDetailed??!1,onValueChange:function(e){s.storage.listSettings.pluginListAlwaysDetailed=e,t()}}),i.React.createElement(d,{label:"Always Send Detailed Theme List",subLabel:"Always use detailed mode when listing themes",value:s.storage.listSettings?.themeListAlwaysDetailed??!1,onValueChange:function(e){s.storage.listSettings.themeListAlwaysDetailed=e,t()}}),i.React.createElement(d,{label:"/plugin-list",subLabel:"List all installed plugins",value:s.storage.enabledCommands?.pluginList??!0,onValueChange:function(e){return a("pluginList",e)}}),i.React.createElement(d,{label:"/theme-list",subLabel:"List all installed themes",value:s.storage.enabledCommands?.themeList??!0,onValueChange:function(e){return a("themeList",e)}})),i.React.createElement(y,{title:"Image Commands"},i.React.createElement(d,{label:"/petpet",subLabel:"Create pet-pet GIF of a user",value:s.storage.enabledCommands?.petpet??!0,onValueChange:function(e){return a("petpet",e)}})),i.React.createElement(y,{title:"KonoChan Commands"},i.React.createElement(d,{label:"/konoself",subLabel:"Get random image from KonoChan (private)",value:s.storage.enabledCommands?.konoself??!0,onValueChange:function(e){return a("konoself",e)}}),i.React.createElement(d,{label:"/konosend",subLabel:"Send random image from KonoChan to channel",value:s.storage.enabledCommands?.konosend??!0,onValueChange:function(e){return a("konosend",e)}})),i.React.createElement(y,{title:"Message Commands"},i.React.createElement(d,{label:"/firstmessage",subLabel:"Get the first message in a channel",value:s.storage.enabledCommands?.firstmessage??!0,onValueChange:function(e){return a("firstmessage",e)}})),i.React.createElement(y,{title:"Credits"},i.React.createElement(S,{label:"Facts Commands",subLabel:"by jdev082"}),i.React.createElement(S,{label:"List Commands",subLabel:"by Kitomanari"}),i.React.createElement(S,{label:"PetPet Command",subLabel:"by wolfieeee"}),i.React.createElement(S,{label:"KonoChan Commands",subLabel:"by btmc727 & Rico040"})),i.React.createElement(y,{title:"About"},i.React.createElement(S,{label:"All-In-One Commands",subLabel:"A collection of useful commands"})))))}s.storage.factSettings||(s.storage.factSettings={sendAsReply:!0,includeCitation:!1}),s.storage.listSettings||(s.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),s.storage.enabledCommands||(s.storage.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0,firstmessage:!0});const fe={catfact:Q,dogfact:X,useless:Z,petpet:ie,pluginList:ne,themeList:ae,konoself:oe,konosend:le,firstmessage:re};let T=[];var me={onLoad:function(){console.log("[All-In-One Commands] Loading plugin...");for(const[n,t]of Object.entries(fe))s.storage.enabledCommands[n]&&T.push(q.registerCommand(t));console.log("[All-In-One Commands] Plugin loaded successfully!")},onUnload:function(){console.log("[All-In-One Commands] Unloading plugin..."),T.forEach(function(n){return n()}),T=[],console.log("[All-In-One Commands] Plugin unloaded successfully!")},settings:ue};return R.default=me,Object.defineProperty(R,"__esModule",{value:!0}),R})({},vendetta.commands,vendetta.plugin,vendetta.metro,vendetta.themes,vendetta.plugins,vendetta.ui,vendetta.metro.common,vendetta.storage,vendetta.metro.common.ReactNative); diff --git a/Commands/manifest.json b/Commands/manifest.json index 98e73b7..0136999 100644 --- a/Commands/manifest.json +++ b/Commands/manifest.json @@ -1 +1 @@ -{"authors":[{"name":"kmmiio99o","id":"879393496627306587"}],"main":"index.js","name":"Commands","description":"A collection of fixed commands including facts, petpet, and more.","vendetta":{"icon":"ic_badge_staff","original":"plugins/all-in-one"},"version":"1.0.0","hash":"fc92d3809155dc8ef896330a1f8c1b717a56dfd927391f34638da610ee6803fc"} \ No newline at end of file +{"authors":[{"name":"kmmiio99o","id":"879393496627306587"}],"main":"index.js","name":"Commands","description":"A collection of fixed commands including facts, petpet, and more.","vendetta":{"icon":"ic_badge_staff","original":"plugins/all-in-one"},"version":"1.0.0","hash":"613d3d5876d7bd4744e684495ea811d4dab44e0b3889cbd0eb3a2d8fe23d122a"} \ No newline at end of file