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