deploy
This commit is contained in:
parent
081a44cc34
commit
debb17efde
2 changed files with 6 additions and 3 deletions
|
|
@ -1,3 +1,6 @@
|
|||
(function(u,i,p,t,S,w,c,y){"use strict";const{FormSwitchRow:o,FormIcon:l,FormSection:f,FormDivider:h}=y.Forms,r={List:c.getAssetIDByName("ic_list"),Copy:c.getAssetIDByName("ic_copy_message_link"),Settings:c.getAssetIDByName("ic_settings"),Fact:c.getAssetIDByName("ic_info")};t.storage.factSettings||(t.storage.factSettings={sendAsReply:!0,includeCitation:!1}),t.storage.listSettings||(t.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1});function A(){return w.useProxy(t.storage),React.createElement(y.ErrorBoundary,null,React.createElement(S.ReactNative.ScrollView,{style:{flex:1}},React.createElement(f,{title:"Plugin List Settings",titleStyleType:"no_border"},React.createElement(o,{label:"Always send detailed plugin list",subLabel:"Always use detailed mode when listing plugins",leading:React.createElement(l,{source:r.List}),onValueChange:function(e){t.storage.listSettings.pluginListAlwaysDetailed=e},value:t.storage.listSettings.pluginListAlwaysDetailed}),React.createElement(h,null),React.createElement(o,{label:"Always send detailed theme list",subLabel:"Always use detailed mode when listing themes",leading:React.createElement(l,{source:r.List}),onValueChange:function(e){t.storage.listSettings.themeListAlwaysDetailed=e},value:t.storage.listSettings.themeListAlwaysDetailed})),React.createElement(f,{title:"Fact Commands Settings",titleStyleType:"no_border"},React.createElement(o,{label:"Send as Reply",subLabel:"Send facts as a reply to the command message",leading:React.createElement(l,{source:r.Copy}),onValueChange:function(e){t.storage.factSettings.sendAsReply=e},value:t.storage.factSettings.sendAsReply}),React.createElement(h,null),React.createElement(o,{label:"Include Source Citation",subLabel:"Include the source of the fact when available",leading:React.createElement(l,{source:r.Fact}),onValueChange:function(e){t.storage.factSettings.includeCitation=e},value:t.storage.factSettings.includeCitation}))))}const R=p.findByStoreName("UserStore"),b=p.findByProps("sendMessage");let s=[];t.storage.factSettings||(t.storage.factSettings={sendAsReply:!0,includeCitation:!1}),t.storage.listSettings||(t.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1});const v=async function(){const e=await(await fetch("https://uselessfacts.jsph.pl/api/v2/facts/random")).json();return{text:e.text,source:e.source,language:e.language}},C=async function(){return{text:(await(await fetch("https://dogapi.dog/api/v2/facts?limit=1")).json()).data[0].attributes.body}},D=async function(){const e=await(await fetch("https://catfact.ninja/fact")).json();return{text:e.fact,length:e.length}};async function L(e){return await(await fetch(`https://api.obamabot.me/v2/image/petpet?image=${e.replace("webp","png")}`)).json()}const g=function(e){let a=e.text;return t.storage.factSettings.includeCitation&&e.source&&(a+=`
|
||||
(function(C,d,T,a,$,p,B,U,V,u,P){"use strict";const{FormSwitchRow:g,FormIcon:m,FormSection:N,FormDivider:W}=P.Forms,h={List:u.getAssetIDByName("ic_list"),Message:u.getAssetIDByName("ic_message"),Copy:u.getAssetIDByName("ic_copy_message_link"),Info:u.getAssetIDByName("ic_info"),Theme:u.getAssetIDByName("ic_theme"),Plugin:u.getAssetIDByName("ic_plugins")};function k(){return V.useProxy(a.storage),a.storage.factSettings||(a.storage.factSettings={sendAsReply:!0,includeCitation:!1}),a.storage.listSettings||(a.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1}),React.createElement(P.ErrorBoundary,null,React.createElement(U.ReactNative.ScrollView,{style:{flex:1}},React.createElement(N,{title:"Fact Commands",titleStyleType:"no_border"},React.createElement(g,{label:"Send as Reply",subLabel:"Send facts as a reply to the command message",leading:React.createElement(m,{source:h.Message}),onValueChange:function(e){a.storage.factSettings.sendAsReply=e},value:a.storage.factSettings.sendAsReply}),React.createElement(W,null),React.createElement(g,{label:"Include Source Citation",subLabel:"Include the source of facts when available",leading:React.createElement(m,{source:h.Info}),onValueChange:function(e){a.storage.factSettings.includeCitation=e},value:a.storage.factSettings.includeCitation})),React.createElement(N,{title:"Plugin List",titleStyleType:"no_border"},React.createElement(g,{label:"Always Send Detailed List",subLabel:"Always use detailed mode when listing plugins",leading:React.createElement(m,{source:h.Plugin}),onValueChange:function(e){a.storage.listSettings.pluginListAlwaysDetailed=e},value:a.storage.listSettings.pluginListAlwaysDetailed})),React.createElement(N,{title:"Theme List",titleStyleType:"no_border"},React.createElement(g,{label:"Always Send Detailed List",subLabel:"Always use detailed mode when listing themes",leading:React.createElement(m,{source:h.Theme}),onValueChange:function(e){a.storage.listSettings.themeListAlwaysDetailed=e},value:a.storage.listSettings.themeListAlwaysDetailed}))))}const M=T.findByStoreName("UserStore"),x=T.findByProps("sendMessage"),y=T.findByProps("sendBotMessage"),_=M.getCurrentUser()?.premiumType===2?4e3:2e3;let i=[];const o={ENABLED:"\u{1F7E2}",DISABLED:"\u{1F534}",SELECTED:"\u{1F536}",NOT_SELECTED:"\u{1F537}"},f="https://vd-plugins.github.io/proxy/actuallythesun.github.io/vendetta-plugins/SplitLargeMessages/",q=async function(){const e=await(await fetch("https://uselessfacts.jsph.pl/api/v2/facts/random")).json();return{text:e.text,source:e.source,language:e.language}},z=async function(){return{text:(await(await fetch("https://dogapi.dog/api/v2/facts?limit=1")).json()).data[0].attributes.body}},G=async function(){const e=await(await fetch("https://catfact.ninja/fact")).json();return{text:e.fact,length:e.length}};async function H(e){return await(await fetch(`https://api.obamabot.me/v2/image/petpet?image=${e.replace("webp","png")}`)).json()}const I=function(e){let t=e.text;return a.storage.factSettings?.includeCitation&&e.source&&(t+=`
|
||||
|
||||
Source: ${e.source}`),a},d=function(e,a,n){const m=Date.now().toString(),N={content:a,...n&&t.storage.factSettings.sendAsReply?{messageReference:{messageId:n}}:{}};return b.sendMessage(e,N,void 0,{nonce:m}),{type:4}},E=function(){s.push(i.registerCommand({name:"catfact",displayName:"catfact",description:"Sends a random cat fact.",displayDescription:"Sends a random cat fact.",applicationId:"-1",inputType:1,type:1,execute:async function(e,a){const n=await D();return d(a.channel.id,g(n),a.message?.id)}})),s.push(i.registerCommand({name:"dogfact",displayName:"dogfact",description:"Sends a dog fact.",displayDescription:"Sends a dog fact.",applicationId:"-1",inputType:1,type:1,execute:async function(e,a){const n=await C();return d(a.channel.id,g(n),a.message?.id)}})),s.push(i.registerCommand({name:"useless",displayName:"useless",description:"Sends a useless fact.",displayDescription:"Sends a useless fact.",applicationId:"-1",inputType:1,type:1,execute:async function(e,a){const n=await v();return d(a.channel.id,g(n),a.message?.id)}})),s.push(i.registerCommand({name:"petpet",displayName:"petpet",displayDescription:"PetPet someone",description:"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(e,a){const n=(await R.getUser(e[0].value)).getAvatarURL(512),m=await L(n);return d(a.channel.id,m.url,a.message?.id)},applicationId:"-1",inputType:1,type:1}))};var I={onLoad:function(){console.log("[All-In-One Commands] Plugin loaded!"),E()},onUnload:function(){console.log("[All-In-One Commands] Plugin unloaded!"),s.forEach(function(e){return e()}),s=[]},settings:A};return u.default=I,Object.defineProperty(u,"__esModule",{value:!0}),u})({},vendetta.commands,vendetta.metro,vendetta.plugin,vendetta.metro.common,vendetta.storage,vendetta.ui.assets,vendetta.ui.components);
|
||||
Source: ${e.source}`),t},S=function(e,t,s){const n=Date.now().toString(),c={content:t,...s&&a.storage.factSettings?.sendAsReply?{messageReference:{messageId:s}}:{}};return x.sendMessage(e,c,void 0,{nonce:n}),{type:4}},w=function(e){return e.map(function(t){return t.name}).join(", ")},j=function(e){return e.join(`
|
||||
`).trimEnd()},D=function(e){return j(e).length},E=async function(e,t){const s=Date.now().toString();await x.sendMessage(e,{content:j(t)},void 0,{nonce:s})},O=function(){return Object.keys(p.plugins).includes(f)},F=function(){return Object.values(p.plugins).find(function(e){return e.id===f})?.enabled??!1};async function J(e,t){const s=a.storage.themeListAlwaysDetailed??!1,n=[`**My Theme List | ${Object.keys($.themes).length} Themes**`,""],c=Object.values($.themes);if(c.length)for(const r of c){const{selected:b,data:R,id:v}=r,{name:L,description:A,authors:Y}=R;e||s?n.push(`> **Name**: ${L}`,`> **Selected**: ${b?o.SELECTED:o.NOT_SELECTED}`,`> **Description**: ${A}`,`> **Authors**: ${w(Y)}`,`> **[Install!](${v})**`,""):n.push(`> ${b?o.SELECTED:o.NOT_SELECTED} **${L}** by ${w(Y)}`)}else n.push("Nothing to see here, huh...");const l=D(n)>_;if(l&&!O()){const r=Date.now().toString();return y.sendBotMessage(t.channel.id,`Your list is too long to send it! Please install the [Split Large Messages](${f}) plugin.`,void 0,{nonce:r}),{type:4}}else if(l&&!F()){const r=Date.now().toString();return y.sendBotMessage(t.channel.id,`Your list is too long to send it! You have the Split Large Messages plugin installed, but it's not enabled!
|
||||
> Please enable it in order to send the list.`,void 0,{nonce:r}),{type:4}}return D(n)>2e3?B.alerts.showConfirmationAlert({content:"Your list is over than 2000 characters. Are you sure?",confirmText:"Yes",cancelText:"No",onConfirm:async function(){return await E(t.channel.id,n)}}):(await E(t.channel.id,n),{type:4})}async function K(e,t){const s=a.storage.pluginListAlwaysDetailed??!1,n=[`**My Plugin List | ${Object.keys(p.plugins).length} Plugins**`,""];for(const l of Object.values(p.plugins)){const{enabled:r,manifest:b,id:R}=l,{name:v,description:L,authors:A}=b;e||s?n.push(`> **Name**: ${v}`,`> **Status**: ${r?o.ENABLED:o.DISABLED}`,`> **Description**: ${L}`,`> **Authors**: ${w(A)}`,`> **[Install!](${R})**`,""):n.push(`> ${r?o.ENABLED:o.DISABLED} **${v}** by ${w(A)}`)}const c=D(n)>_;if(c&&!O()){const l=Date.now().toString();return y.sendBotMessage(t.channel.id,`Your list is too long to send it! Please install the [Split Large Messages](${f}) plugin.`,void 0,{nonce:l}),{type:4}}else if(c&&!F()){const l=Date.now().toString();return y.sendBotMessage(t.channel.id,`Your list is too long to send it! You have the Split Large Messages plugin installed, but it's not enabled!
|
||||
> Please enable it in order to send the list.`,void 0,{nonce:l}),{type:4}}return D(n)>2e3?B.alerts.showConfirmationAlert({content:"Your list is over than 2000 characters. Are you sure?",confirmText:"Yes",cancelText:"No",onConfirm:async function(){return await E(t.channel.id,n)}}):(await E(t.channel.id,n),{type:4})}const Q=function(){i.push(d.registerCommand({name:"catfact",displayName:"catfact",description:"Sends a random cat fact.",displayDescription:"Sends a random cat fact.",applicationId:"-1",inputType:1,type:1,execute:async function(e,t){const s=await G();return S(t.channel.id,I(s),t.message?.id)}})),i.push(d.registerCommand({name:"dogfact",displayName:"dogfact",description:"Sends a dog fact.",displayDescription:"Sends a dog fact.",applicationId:"-1",inputType:1,type:1,execute:async function(e,t){const s=await z();return S(t.channel.id,I(s),t.message?.id)}})),i.push(d.registerCommand({name:"useless",displayName:"useless",description:"Sends a useless fact.",displayDescription:"Sends a useless fact.",applicationId:"-1",inputType:1,type:1,execute:async function(e,t){const s=await q();return S(t.channel.id,I(s),t.message?.id)}})),i.push(d.registerCommand({name:"petpet",displayName:"petpet",displayDescription:"PetPet someone",description:"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(e,t){const s=(await M.getUser(e[0].value)).getAvatarURL(512),n=await H(s);return S(t.channel.id,n.url,t.message?.id)},applicationId:"-1",inputType:1,type:1})),i.push(d.registerCommand({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(e,t){const s=e.find(function(n){return n.name==="detailed"})?.value??!1;return K(s,t)},applicationId:"-1",inputType:1,type:1})),i.push(d.registerCommand({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(e,t){const s=e.find(function(n){return n.name==="detailed"})?.value??!1;return J(s,t)},applicationId:"-1",inputType:1,type:1}))};a.storage.factSettings||(a.storage.factSettings={sendAsReply:!0,includeCitation:!1}),a.storage.listSettings||(a.storage.listSettings={pluginListAlwaysDetailed:!1,themeListAlwaysDetailed:!1});var X={onLoad:function(){console.log("[All-In-One Commands] Plugin loaded!"),Q()},onUnload:function(){console.log("[All-In-One Commands] Plugin unloaded!"),i.forEach(function(e){return e()}),i=[]},settings:k};return C.default=X,Object.defineProperty(C,"__esModule",{value:!0}),C})({},vendetta.commands,vendetta.metro,vendetta.plugin,vendetta.themes,vendetta.plugins,vendetta.ui,vendetta.metro.common,vendetta.storage,vendetta.ui.assets,vendetta.ui.components);
|
||||
|
|
|
|||
|
|
@ -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":"cc98e56b08026da889adb33eda0938182c318327b4fd827369920f13346c6f4e"}
|
||||
{"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":"7e618de64ee12b9042b77a9c2ba805850336a7561c1767968facb315fe60a21e"}
|
||||
Loading…
Add table
Reference in a new issue