diff --git a/HideGiftButton/index.js b/HideGiftButton/index.js index 0278075..47779b7 100644 --- a/HideGiftButton/index.js +++ b/HideGiftButton/index.js @@ -1 +1 @@ -(function(t,n,i){"use strict";let o;const e=i.findByDisplayName("ChatInput");var u={onLoad:function(){n.logger.log("Starting HideGiftButton..."),o=e.defaultProps.hideGiftButton,e.defaultProps.hideGiftButton=!0},onUnload:function(){n.logger.log("Unloading HideGiftButton.."),e.defaultProps.hideGiftButton=o}};return t.default=u,Object.defineProperty(t,"__esModule",{value:!0}),t})({},vendetta,vendetta.metro); +!function(t,n,o){"use strict";let e;let i=o.findByDisplayName("ChatInput"),a=function(){function t(){!function(t,n){if(!(t instanceof n))throw TypeError("Cannot call a class as a function")}(this,t)}var o=t.prototype;return o.onLoad=function(){n.logger.log("Starting HideGiftButton..."),e=i.defaultProps.hideGiftButton,i.defaultProps.hideGiftButton=!0},o.onUnload=function(){n.logger.log("Unloading HideGiftButton.."),i.defaultProps.hideGiftButton=e},t}();t.default=a,Object.defineProperty(t,"__esModule",{value:!0})}({},vendetta,vendetta.metro); \ No newline at end of file diff --git a/HideGiftButton/manifest.json b/HideGiftButton/manifest.json index f0e7288..d291160 100644 --- a/HideGiftButton/manifest.json +++ b/HideGiftButton/manifest.json @@ -1 +1 @@ -{"name":"HideGiftButton","description":"Hides the gift button in the chat input.","authors":[{"name":"amsyarasyiq","id":"492949202121261067"}],"main":"index.js","vendetta":{"icon":"ic_gift_24px"},"hash":"0d69138f425fce968b34d7b97fee6d6b1c30d6b8136c8b75c68072533fe6f407"} \ No newline at end of file +{"name":"HideGiftButton","description":"Hides the gift button in the chat input.","authors":[{"name":"amsyarasyiq","id":"492949202121261067"}],"main":"index.js","vendetta":{"icon":"ic_gift_24px"},"hash":"dc67a237c1d3b7742a0fb004f5783ce77538d638c6fb3582f2df7bd5d83e2af5"} \ No newline at end of file diff --git a/Last.fm/index.js b/Last.fm/index.js index 8eb0461..286a931 100644 --- a/Last.fm/index.js +++ b/Last.fm/index.js @@ -1 +1 @@ -(function(o,w,h,a,u,L,g,S,A){"use strict";const c={DEFAULT_APP_NAME:"Music",DEFAULT_TIME_INTERVAL:5,APPLICATION_ID:"1054951789318909972",LFM_API_KEY:"615322f0047e12aedbc610d9d71f7430",LFM_DEFAULT_COVER_HASHES:["2a96cbd8b46e442fc41c2b86b821562f","c6f59c1e5e7240a4c0d427abd71f3dbb"]},E=h.findByProps("getAssetIds");async function R(){const e=new URLSearchParams({method:"user.getrecenttracks",user:l.username,api_key:c.LFM_API_KEY,format:"json",limit:"1",extended:"1"}).toString(),t=await fetch(`https://ws.audioscrobbler.com/2.0/?${e}`);if(!t.ok)throw new Error(`Failed to fetch the latest scrobble: ${t.statusText}`);const n=await t.json(),s=n?.recenttracks?.track?.[0];if(!s)throw n;return{name:s.name,artist:s.artist.name,album:s.album["#text"],albumArt:await N(s.image[3]["#text"]),url:s.url,date:s.date?.["#text"]??"now",nowPlaying:Boolean(s["@attr"]?.nowplaying),loved:s.loved==="1"}}async function N(e){return c.LFM_DEFAULT_COVER_HASHES.some(function(t){return e.includes(t)})?null:e}function f(){return r.lastActivity&&i("--> Clearing activity..."),I(null)}function I(e){r.pluginStopped&&(console.log("--> Plugin is unloaded, aborting..."),r.updateInterval&&clearInterval(r.updateInterval),e=null),r.lastActivity=e,a.FluxDispatcher.dispatch({type:"LOCAL_ACTIVITY_UPDATE",activity:e})}async function P(e,t=c.APPLICATION_ID){return e?typeof e=="string"?(await E.getAssetIds(t,[e]))[0]:await E.getAssetIds(t,e):null}async function b(){if(i("--> Fetching last track..."),!l.username)throw A.showToast("Last.fm username is not set!",g.getAssetIDByName("Small")),p(),new Error("Username is not set");const e=await R().catch(async function(n){throw i("--> An error occurred while fetching the last track, aborting..."),f(),n});if(!e.nowPlaying){i("--> Last track is not currently playing, aborting..."),f();return}if(i("--> Track fetched!"),r.lastTrackUrl===e.url){i("--> Last track is the same as the previous one, aborting...");return}const t={name:l.appName||c.DEFAULT_APP_NAME,flags:0,type:l.listeningTo?2:0,details:e.name,state:`by ${e.artist}`,application_id:c.APPLICATION_ID};if(r.lastTrackUrl=e.url,t.name.includes("{{"))for(const n in e)t.name=t.name.replace(`{{${n}}}`,e[n]);l.showTimestamp&&(t.timestamps={start:Date.now()/1e3|0}),e.album&&(t.assets={large_image:await P(e.albumArt),large_text:`on ${e.album}`}),i("--> Setting activity..."),i(t);try{I(t)}catch(n){throw i("--> An error occurred while setting the activity"),f(),n}i("--> Successfully set activity!")}function p(){console.log("--> Flushing..."),r.lastActivity=null,r.lastTrackUrl=null,r.updateInterval&&clearInterval(r.updateInterval),f()}async function T(){if(console.log("--> Initializing..."),r.pluginStopped)throw new Error("Plugin is already stopped!");p();let e=0;await b().catch(function(t){console.error(t),e++}),r.updateInterval=setInterval(function(){return b().then(function(){e=0}).catch(function(t){console.error(t),++e>3&&(console.error("Failed to fetch/set activity 3 times, aborting..."),p())})},(l.timeInterval||c.DEFAULT_TIME_INTERVAL)*1e3)}const{ScrollView:F,TouchableOpacity:C,Text:D}=a.ReactNative,{FormInput:y,FormDivider:d,FormSwitchRow:m,FormText:U,FormIcon:v}=S.Forms;function k(){async function e(){for(const t in u.storage)(u.storage[t]===!1||u.storage[t])&&(l[t]=u.storage[t]);console.log("Applying settings..."),await T(),A.showToast("Settings updated!",g.getAssetIDByName("Check"))}return a.React.createElement(C,{onPress:e},a.React.createElement(U,{style:{marginRight:12}},"UPDATE"))}function V(){const e=L.useProxy(u.storage),t=a.NavigationNative.useNavigation();return a.React.useEffect(function(){t.setOptions({title:"Last.fm Configuration",headerRight:k})},[]),a.React.createElement(F,null,a.React.createElement(y,{value:e.appName||void 0,onChangeText:function(n){return e.appName=n.trim()},title:"Discord Application Name",placeholder:c.DEFAULT_APP_NAME,returnKeyType:"done"}),a.React.createElement(d,null),a.React.createElement(y,{required:!0,value:e.username||void 0,onChangeText:function(n){return e.username=n.trim()},title:"Last.fm username",helpText:!e.username&&a.React.createElement(D,{style:{color:"#FF0000"}},"This field is required!"),placeholder:"wumpus123",returnKeyType:"done"}),a.React.createElement(d,null),a.React.createElement(y,{value:e.timeInterval,onChangeText:function(n){return e.timeInterval=Number(n)},title:"Update interval (in seconds)",placeholder:c.DEFAULT_TIME_INTERVAL.toString(),keyboardType:"numeric",returnKeyType:"done"}),a.React.createElement(d,null),a.React.createElement(m,{label:"Show time elapsed",subLabel:"Show the time elapsed since the song started playing",leading:a.React.createElement(v,{source:g.getAssetIDByName("clock")}),value:e.showTimestamp,onValueChange:function(n){return e.showTimestamp=n}}),a.React.createElement(d,null),a.React.createElement(m,{label:"Set status as listening",subLabel:'Set your status as "Listening to" instead of "Playing"',leading:a.React.createElement(v,{source:g.getAssetIDByName("ic_headset_neutral")}),value:e.listeningTo,onValueChange:function(n){return e.listeningTo=n}}),a.React.createElement(d,null),a.React.createElement(m,{label:"Verbose logging",subLabel:"Log more information to the console for debugging purposes",leading:a.React.createElement(v,{source:g.getAssetIDByName("pencil")}),value:e.verboseLogging,onValueChange:function(n){return e.verboseLogging=n}}))}const r={},l={...w.plugin.storage},_=h.findByStoreName("UserStore"),M=h.findByProps("SET_ACTIVITY").SET_ACTIVITY,i=function(...e){return l.verboseLogging&&console.log(...e)};var O={onLoad:function(){console.log("Starting last.fm plugin.."),r.pluginStopped=!1,_.getCurrentUser()&&(console.log("User is already logged in, initializing..."),T().catch(console.error)),a.FluxDispatcher.subscribe("CONNECTION_OPEN",function(){T().catch(console.error)})},onUnload:function(){console.log("Stopping last.fm..."),r.pluginStopped=!0,p()},settings:V};return o.SET_ACTIVITY=M,o.UserStore=_,o.currentSettings=l,o.default=O,o.global=r,o.verboseLog=i,Object.defineProperty(o,"__esModule",{value:!0}),o})({},vendetta,vendetta.metro,vendetta.metro.common,vendetta.plugin,vendetta.storage,vendetta.ui.assets,vendetta.ui.components,vendetta.ui.toasts); +!function(e,t,n,a,r,o,i,l,s){"use strict";let c={DEFAULT_APP_NAME:"Music",DEFAULT_TIME_INTERVAL:5,APPLICATION_ID:"1054951789318909972",LFM_API_KEY:"615322f0047e12aedbc610d9d71f7430",LFM_DEFAULT_COVER_HASHES:["2a96cbd8b46e442fc41c2b86b821562f","c6f59c1e5e7240a4c0d427abd71f3dbb"]},u=n.findByProps("getAssetIds");async function g(){let e=new URLSearchParams({method:"user.getrecenttracks",user:S.username,api_key:c.LFM_API_KEY,format:"json",limit:"1",extended:"1"}).toString(),t=await fetch(`https://ws.audioscrobbler.com/2.0/?${e}`);if(!t.ok)throw Error(`Failed to fetch the latest scrobble: ${t.statusText}`);let n=await t.json(),a=n?.recenttracks?.track?.[0];if(!a)throw n;return{name:a.name,artist:a.artist.name,album:a.album["#text"],albumArt:await m(a.image[3]["#text"]),url:a.url,date:a.date?.["#text"]??"now",nowPlaying:Boolean(a["@attr"]?.nowplaying),loved:"1"===a.loved}}async function m(e){return c.LFM_DEFAULT_COVER_HASHES.some(function(t){return e.includes(t)})?null:e}function d(){return R.lastActivity&&F("--> Clearing activity..."),f(null)}function f(e){R.pluginStopped&&(console.log("--> Plugin is unloaded, aborting..."),R.updateInterval&&clearInterval(R.updateInterval),e=null),R.lastActivity=e,a.FluxDispatcher.dispatch({type:"LOCAL_ACTIVITY_UPDATE",activity:e})}async function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.APPLICATION_ID;if(!e)return null;if("string"==typeof e){let n=await u.getAssetIds(t,[e]);return n[0]}return await u.getAssetIds(t,e)}async function h(){if(F("--> Fetching last track..."),!S.username)throw s.showToast("Last.fm username is not set!",i.getAssetIDByName("Small")),y(),Error("Username is not set");let e=await g().catch(async function(e){throw F("--> An error occurred while fetching the last track, aborting..."),d(),e});if(!e.nowPlaying){F("--> Last track is not currently playing, aborting..."),d();return}if(F("--> Track fetched!"),R.lastTrackUrl===e.url){F("--> Last track is the same as the previous one, aborting...");return}let t={name:S.appName||c.DEFAULT_APP_NAME,flags:0,type:S.listeningTo?2:0,details:e.name,state:`by ${e.artist}`,application_id:c.APPLICATION_ID};if(R.lastTrackUrl=e.url,t.name.includes("{{"))for(let n in e)t.name=t.name.replace(`{{${n}}}`,e[n]);S.showTimestamp&&(t.timestamps={start:Date.now()/1e3|0}),e.album&&(t.assets={large_image:await p(e.albumArt),large_text:`on ${e.album}`}),F("--> Setting activity..."),F(t);try{f(t)}catch(e){throw F("--> An error occurred while setting the activity"),d(),e}F("--> Successfully set activity!")}function y(){console.log("--> Flushing..."),R.lastActivity=null,R.lastTrackUrl=null,R.updateInterval&&clearInterval(R.updateInterval),d()}async function T(){if(console.log("--> Initializing..."),R.pluginStopped)throw Error("Plugin is already stopped!");y();let e=0;await h().catch(function(t){console.error(t),e++}),R.updateInterval=setInterval(function(){return h().then(function(){e=0}).catch(function(t){console.error(t),++e>3&&(console.error("Failed to fetch/set activity 3 times, aborting..."),y())})},1e3*(S.timeInterval||c.DEFAULT_TIME_INTERVAL))}let{ScrollView:E,TouchableOpacity:v,Text:A}=a.ReactNative,{FormInput:I,FormDivider:b,FormSwitchRow:_,FormText:L,FormIcon:w}=l.Forms;function N(){async function e(){for(let e in r.storage)(!1===r.storage[e]||r.storage[e])&&(S[e]=r.storage[e]);console.log("Applying settings..."),await T(),s.showToast("Settings updated!",i.getAssetIDByName("Check"))}return a.React.createElement(v,{onPress:e},a.React.createElement(L,{style:{marginRight:12}},"UPDATE"))}function P(){let e=o.useProxy(r.storage),t=a.NavigationNative.useNavigation();return a.React.useEffect(function(){t.setOptions({title:"Last.fm Configuration",headerRight:N})},[]),a.React.createElement(E,null,a.React.createElement(I,{value:e.appName||void 0,onChangeText:function(t){return e.appName=t.trim()},title:"Discord Application Name",placeholder:c.DEFAULT_APP_NAME,returnKeyType:"done"}),a.React.createElement(b,null),a.React.createElement(I,{required:!0,value:e.username||void 0,onChangeText:function(t){return e.username=t.trim()},title:"Last.fm username",helpText:!e.username&&a.React.createElement(A,{style:{color:"#FF0000"}},"This field is required!"),placeholder:"wumpus123",returnKeyType:"done"}),a.React.createElement(b,null),a.React.createElement(I,{value:e.timeInterval,onChangeText:function(t){return e.timeInterval=Number(t)},title:"Update interval (in seconds)",placeholder:c.DEFAULT_TIME_INTERVAL.toString(),keyboardType:"numeric",returnKeyType:"done"}),a.React.createElement(b,null),a.React.createElement(_,{label:"Show time elapsed",subLabel:"Show the time elapsed since the song started playing",leading:a.React.createElement(w,{source:i.getAssetIDByName("clock")}),value:e.showTimestamp,onValueChange:function(t){return e.showTimestamp=t}}),a.React.createElement(b,null),a.React.createElement(_,{label:"Set status as listening",subLabel:'Set your status as "Listening to" instead of "Playing"',leading:a.React.createElement(w,{source:i.getAssetIDByName("ic_headset_neutral")}),value:e.listeningTo,onValueChange:function(t){return e.listeningTo=t}}),a.React.createElement(b,null),a.React.createElement(_,{label:"Verbose logging",subLabel:"Log more information to the console for debugging purposes",leading:a.React.createElement(w,{source:i.getAssetIDByName("pencil")}),value:e.verboseLogging,onValueChange:function(t){return e.verboseLogging=t}}))}let R={},S={...t.plugin.storage},C=n.findByStoreName("UserStore"),D=n.findByProps("SET_ACTIVITY").SET_ACTIVITY,F=function(){for(var e=arguments.length,t=Array(e),n=0;n. +*/let n=e.findByProps("show","confirm","close"),r=e.findByProps("handleStartCall"),a=function(){function t(){!function(t,o){if(!(t instanceof o))throw TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.onLoad=function(){o.logger.log("MoreConfirm: patching calls..."),o.patcher.instead("handleStartCall",r,function(t,e){let[{rawRecipients:[{username:r,discriminator:a},l]},c]=t,i=c?"video call":"call";n.show({title:l?`MoreConfirm: Start a group ${i}?`:`MoreConfirm: Start a ${i} with ${r}#${a}?`,body:l?"Are you sure you want to start the group call?":`Are you sure you want to ${i} ${r}#${a}?`,confirmText:"Yes",cancelText:"Cancel",confirmColor:"brand",onConfirm:function(){try{e(...t)}catch(t){o.logger.error("Failed to start call",t)}}})})},t}();t.default=a,Object.defineProperty(t,"__esModule",{value:!0})}({},vendetta,vendetta.metro); \ No newline at end of file diff --git a/MoreConfirm/manifest.json b/MoreConfirm/manifest.json index d3f1788..3e2d48f 100644 --- a/MoreConfirm/manifest.json +++ b/MoreConfirm/manifest.json @@ -1 +1 @@ -{"name":"MoreConfirm","description":"Prompts confirmations before making irreversible actions.","authors":[{"name":"amsyarasyiq","id":"492949202121261067"}],"main":"index.js","vendetta":{"icon":"check"},"hash":"9cd8f3018bd9c3eeb476231591838865b6258dfd8f60460b8050a427b95e3143"} \ No newline at end of file +{"name":"MoreConfirm","description":"Prompts confirmations before making irreversible actions.","authors":[{"name":"amsyarasyiq","id":"492949202121261067"}],"main":"index.js","vendetta":{"icon":"check"},"hash":"cba9c7a3326d2eaf34b3a0ad8795940d1721ad929146b21db556fefc9f82d323"} \ No newline at end of file diff --git a/NoIdle/index.js b/NoIdle/index.js index 4779c78..fec1c70 100644 --- a/NoIdle/index.js +++ b/NoIdle/index.js @@ -1 +1 @@ -(function(e,t,o){"use strict";let n;var i={onLoad:function(){t.logger.log("Starting NoIdle..."),n=t.patcher.before("dispatch",o.FluxDispatcher,function([{type:l}]){if(l==="IDLE")return[{type:"IDLE",idle:!1}]})},onUnload:function(){t.logger.log("Disabling NoIdle.."),n?.()}};return e.default=i,Object.defineProperty(e,"__esModule",{value:!0}),e})({},vendetta,vendetta.metro.common); +!function(t,e,n){"use strict";let o;let i=function(){function t(){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,t)}var i=t.prototype;return i.onLoad=function(){e.logger.log("Starting NoIdle..."),o=e.patcher.before("dispatch",n.FluxDispatcher,function(t){let[{type:e}]=t;if("IDLE"===e)return[{type:"IDLE",idle:!1}]})},i.onUnload=function(){e.logger.log("Disabling NoIdle.."),o?.()},t}();t.default=i,Object.defineProperty(t,"__esModule",{value:!0})}({},vendetta,vendetta.metro.common); \ No newline at end of file diff --git a/NoIdle/manifest.json b/NoIdle/manifest.json index 8ec95f8..6b7be0f 100644 --- a/NoIdle/manifest.json +++ b/NoIdle/manifest.json @@ -1 +1 @@ -{"name":"NoIdle","description":"Prevent status from idling when Discord is in the background.","authors":[{"name":"amsyarasyiq","id":"492949202121261067"}],"main":"index.js","vendetta":{"icon":"StatusIdle"},"hash":"3edb88659845821f3d3e100356f86aa684319448e7a192c18431aee3e8b08fc2"} \ No newline at end of file +{"name":"NoIdle","description":"Prevent status from idling when Discord is in the background.","authors":[{"name":"amsyarasyiq","id":"492949202121261067"}],"main":"index.js","vendetta":{"icon":"StatusIdle"},"hash":"30d9755940198cb7ef712d4b13bc55a6f49454ba48496ba986a5df7e7e80e58c"} \ No newline at end of file