diff --git a/Commands/index.js b/Commands/index.js index da5c09f..2bc8831 100644 --- a/Commands/index.js +++ b/Commands/index.js @@ -1,4 +1,4 @@ -(function(E,B,a,f,T,g,m,o,V,W){"use strict";const K=f.findByProps("sendMessage"),c=function(n,t,s,e,i){if(!t)return{type:4};if(i)return{type:4,data:{content:t,flags:64}};const r={content:t,...s&&e?.factSettings?.sendAsReply?{messageReference:{messageId:s}}:{}};return K.sendMessage(n,r,void 0,{nonce:(Date.now()*4194304).toString()}),{type:4}},G=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}},U=async function(){return{text:(await(await fetch("https://dogapi.dog/api/v2/facts?limit=1")).json()).data[0].attributes.body}},_=async function(){const n=await(await fetch("https://catfact.ninja/fact")).json();return{text:n.fact,length:n.length}},q=async function(n){return await(await fetch(`https://api.obamabot.me/v2/image/petpet?image=${n.replace("webp","png")}`)).json()},R=function(n){let t=n.text;return a.storage.factSettings?.includeCitation&&n.source&&(t+=` +(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+=` -Source: ${n.source}`),t},z={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 s=await _();return c(t.channel.id,R(s),t.message?.id,a.storage)}},H={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 s=await U();return c(t.channel.id,R(s),t.message?.id,a.storage)}},Y={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 s=await G();return c(t.channel.id,R(s),t.message?.id,a.storage)}},y="https://vd-plugins.github.io/proxy/actuallythesun.github.io/vendetta-plugins/SplitLargeMessages/",d={ENABLED:"\u{1F7E2}",DISABLED:"\u{1F534}",SELECTED:"\u{1F536}",NOT_SELECTED:"\u{1F537}"},b=function(n){return n.map(function(t){return t.name}).join(", ")},p=function(n){return n.join(` -`).trimEnd()},A=function(n){return p(n).length},$=function(){return Object.keys(g.plugins).includes(y)},N=function(){return Object.values(g.plugins).find(function(n){return n.id===y})?.enabled??!1},x=function(){return m.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(){o.openURL(y)}})},k=function(){return m.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(g.plugins).find(function(t){return t.id===y});n&&(n.enabled=!0)}})};async function J(n,t){const s=a.storage.listSettings?.pluginListAlwaysDetailed??!1,e=[`**My Plugin List | ${Object.keys(g.plugins).length} Plugins**`,""];for(const i of Object.values(g.plugins)){const{enabled:r,manifest:C,id:D}=i,{name:S,description:w,authors:L}=C;n||s?e.push(`> **Name**: ${S}`,`> **Status**: ${r?d.ENABLED:d.DISABLED}`,`> **Description**: ${w}`,`> **Authors**: ${b(L)}`,`> **[Install!](${D})**`,""):e.push(`> ${r?d.ENABLED:d.DISABLED} **${S}** by ${b(L)}`)}return A(e)>2e3?$()?N()?m.alerts.showConfirmationAlert({title:"Large Message",content:"This list is over 2000 characters. Send anyway?",confirmText:"Send",cancelText:"Cancel",onConfirm:function(){return c(t.channel.id,p(e))}}):k():x():c(t.channel.id,p(e))}async function Q(n,t){const s=a.storage.themeListAlwaysDetailed??!1,e=[`**My Theme List | ${Object.keys(T.themes).length} Themes**`,""],i=Object.values(T.themes);if(i.length)for(const r of i){const{selected:C,data:D,id:S}=r,{name:w,description:L,authors:O}=D;n||s?e.push(`> **Name**: ${w}`,`> **Selected**: ${C?d.SELECTED:d.NOT_SELECTED}`,`> **Description**: ${L}`,`> **Authors**: ${b(O)}`,`> **[Install!](${S})**`,""):e.push(`> ${C?d.SELECTED:d.NOT_SELECTED} **${w}** by ${b(O)}`)}else e.push("Nothing to see here, huh...");return A(e)>2e3?$()?N()?m.alerts.showConfirmationAlert({title:"Large Message",content:"This list is over 2000 characters. Send anyway?",confirmText:"Send",cancelText:"Cancel",onConfirm:function(){return c(t.channel.id,p(e))}}):k():x():c(t.channel.id,p(e))}const X={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 s=n.find(function(e){return e.name==="detailed"})?.value??!1;return J(s,t)},applicationId:"-1",inputType:1,type:1},Z={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 s=n.find(function(e){return e.name==="detailed"})?.value??!1;return Q(s,t)},applicationId:"-1",inputType:1,type:1},ee=f.findByStoreName("UserStore"),te={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 s=(await ee.getUser(n[0].value)).getAvatarURL(512),e=await q(s);return c(t.channel.id,e.url,t.message?.id)},applicationId:"-1",inputType:1,type:1},I=f.findByProps("sendMessage"),M=f.findByProps("sendBotMessage","sendMessage","receiveMessage"),P=async function(n){const t="https://konachan.com/post.json",s=n?"rating:explicit":"rating:safe",e=Math.floor(Math.random()*100);try{const i=await(await fetch(`${t}?tags=${s}&limit=1&page=${e}`)).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}},F=function(){return m.alerts.showConfirmationAlert({title:"NSFW Content Warning",content:"NSFW content can only be sent in NSFW channels!",confirmText:"Okay",cancelText:null,confirmColor:"brand",isDismissable:!0})},j={name:"nsfw",description:"Include NSFW content?",type:5,required:!1,displayName:"nsfw",displayDescription:"Include NSFW content?"},ne={name:"konoself",displayName:"konoself",description:"Fetch a random image from KonoChan for yourself.",displayDescription:"Fetch a random image from KonoChan for yourself.",options:[j],execute:async function(n,t){const s=new Map(n.map(function(i){return[i.name,i]})).get("nsfw")?.value||!1;if(s&&!t.channel.nsfw)return F(),{type:4};const e=await P(s);return e?(M.sendBotMessage(t.channel.id,`Here's your random image: ${e}`),{type:4}):(M.sendBotMessage(t.channel.id,"No image found. Try again later."),{type:4})},applicationId:"-1",inputType:1,type:1},ae={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:[j],execute:async function(n,t){const s=new Map(n.map(function(r){return[r.name,r]})).get("nsfw")?.value||!1;if(s&&!t.channel.nsfw)return F(),{type:4};const e=await P(s);if(!e){const r=Date.now().toString();return I.sendMessage(t.channel.id,{content:"No image found. Try again later."},void 0,{nonce:r}),{type:4}}const i=Date.now().toString();return I.sendMessage(t.channel.id,{content:e},void 0,{nonce:i}),{type:4}},applicationId:"-1",inputType:1,type:1},{ScrollView:se}=f.findByProps("ScrollView"),{TableRowGroup:u,TableSwitchRow:l,Stack:oe,TableRow:h}=f.findByProps("TableSwitchRow","TableRowGroup","Stack","TableRow");a.storage.factSettings||(a.storage.factSettings={sendAsReply:!0,includeCitation:!1}),a.storage.listSettings||(a.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),a.storage.enabledCommands||(a.storage.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0,firstmessage:!0}),a.storage.pendingRestart||(a.storage.pendingRestart=!1);function ie(){V.useProxy(a.storage);const[n,t]=o.React.useReducer(function(e){return e+1},0);o.React.useEffect(function(){return function(){a.storage.pendingRestart&&(a.storage.pendingRestart=!1,m.alerts.showConfirmationAlert({title:"Restart Required",content:"You have made changes to commands. Please restart Discord to apply these changes.",confirmText:"Okay",cancelText:null}))}},[]);const s=function(e,i){a.storage.enabledCommands[e]=i,a.storage.pendingRestart=!0,t()};return o.React.createElement(W.View,{style:{flex:1}},o.React.createElement(se,{style:{flex:1},contentContainerStyle:{paddingBottom:38}},o.React.createElement(oe,{spacing:8},o.React.createElement(u,{title:"Facts Commands"},o.React.createElement(l,{label:"Send as Reply",subLabel:"Send facts as a reply to the command message",value:a.storage.factSettings?.sendAsReply??!0,onValueChange:function(e){a.storage.factSettings.sendAsReply=e,t()}}),o.React.createElement(l,{label:"Include Source Citation",subLabel:"Include the source of facts when available",value:a.storage.factSettings?.includeCitation??!1,onValueChange:function(e){a.storage.factSettings.includeCitation=e,t()}}),o.React.createElement(l,{label:"/catfact",subLabel:"Get random cat facts",value:a.storage.enabledCommands?.catfact??!0,onValueChange:function(e){return s("catfact",e)}}),o.React.createElement(l,{label:"/dogfact",subLabel:"Get random dog facts",value:a.storage.enabledCommands?.dogfact??!0,onValueChange:function(e){return s("dogfact",e)}}),o.React.createElement(l,{label:"/useless",subLabel:"Get random useless facts",value:a.storage.enabledCommands?.useless??!0,onValueChange:function(e){return s("useless",e)}})),o.React.createElement(u,{title:"List Commands"},o.React.createElement(l,{label:"Always Send Detailed Plugin List",subLabel:"Always use detailed mode when listing plugins",value:a.storage.listSettings?.pluginListAlwaysDetailed??!1,onValueChange:function(e){a.storage.listSettings.pluginListAlwaysDetailed=e,t()}}),o.React.createElement(l,{label:"Always Send Detailed Theme List",subLabel:"Always use detailed mode when listing themes",value:a.storage.listSettings?.themeListAlwaysDetailed??!1,onValueChange:function(e){a.storage.listSettings.themeListAlwaysDetailed=e,t()}}),o.React.createElement(l,{label:"/plugin-list",subLabel:"List all installed plugins",value:a.storage.enabledCommands?.pluginList??!0,onValueChange:function(e){return s("pluginList",e)}}),o.React.createElement(l,{label:"/theme-list",subLabel:"List all installed themes",value:a.storage.enabledCommands?.themeList??!0,onValueChange:function(e){return s("themeList",e)}})),o.React.createElement(u,{title:"Image Commands"},o.React.createElement(l,{label:"/petpet",subLabel:"Create pet-pet GIF of a user",value:a.storage.enabledCommands?.petpet??!0,onValueChange:function(e){return s("petpet",e)}})),o.React.createElement(u,{title:"KonoChan Commands"},o.React.createElement(l,{label:"/konoself",subLabel:"Get random image from KonoChan (private)",value:a.storage.enabledCommands?.konoself??!0,onValueChange:function(e){return s("konoself",e)}}),o.React.createElement(l,{label:"/konosend",subLabel:"Send random image from KonoChan to channel",value:a.storage.enabledCommands?.konosend??!0,onValueChange:function(e){return s("konosend",e)}})),o.React.createElement(u,{title:"Message Commands"},o.React.createElement(l,{label:"/firstmessage",subLabel:"Get the first message in a channel",value:a.storage.enabledCommands?.firstmessage??!0,onValueChange:function(e){return s("firstmessage",e)}})),o.React.createElement(u,{title:"Credits"},o.React.createElement(h,{label:"Facts Commands",subLabel:"by jdev082"}),o.React.createElement(h,{label:"List Commands",subLabel:"by Kitomanari"}),o.React.createElement(h,{label:"PetPet Command",subLabel:"by wolfieeee"}),o.React.createElement(h,{label:"KonoChan Commands",subLabel:"by btmc727 & Rico040"})),o.React.createElement(u,{title:"About"},o.React.createElement(h,{label:"All-In-One Commands",subLabel:"A collection of useful commands"})))))}a.storage.factSettings||(a.storage.factSettings={sendAsReply:!0,includeCitation:!1}),a.storage.listSettings||(a.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),a.storage.enabledCommands||(a.storage.enabledCommands={catfact:!0,dogfact:!0,useless:!0,petpet:!0,pluginList:!0,themeList:!0,konoself:!0,konosend:!0});const le={catfact:z,dogfact:H,useless:Y,petpet:te,pluginList:X,themeList:Z,konoself:ne,konosend:ae};let v=[];var re={onLoad:function(){console.log("[All-In-One Commands] Loading plugin...");for(const[n,t]of Object.entries(le))a.storage.enabledCommands[n]&&v.push(B.registerCommand(t));console.log("[All-In-One Commands] Plugin loaded successfully!")},onUnload:function(){console.log("[All-In-One Commands] Unloading plugin..."),v.forEach(function(n){return n()}),v=[],console.log("[All-In-One Commands] Plugin unloaded successfully!")},settings:ie};return E.default=re,Object.defineProperty(E,"__esModule",{value:!0}),E})({},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}"},$=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); diff --git a/Commands/manifest.json b/Commands/manifest.json index 0a0f603..98e73b7 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":"57e9f63d7140fd1e3f5f56eb76173ee8f7a11d3e1245a8d87f2bce4ea7ad79c0"} \ 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":"fc92d3809155dc8ef896330a1f8c1b717a56dfd927391f34638da610ee6803fc"} \ No newline at end of file