From c93e225f8fa53198a4e5c1da3e7c040a1082f2da Mon Sep 17 00:00:00 2001 From: amsyarasyiq Date: Wed, 8 Mar 2023 07:44:05 +0000 Subject: [PATCH] deploy: b84db804ad0fec2b54812d5abde14268f5001282 --- HideGiftButton/index.js | 2 +- HideGiftButton/manifest.json | 2 +- Last.fm/index.js | 3 +-- Last.fm/manifest.json | 2 +- MoreConfirm/index.js | 19 +------------------ MoreConfirm/manifest.json | 2 +- NoAutoReplyMention/index.js | 2 +- NoAutoReplyMention/manifest.json | 2 +- NoIdle/index.js | 2 +- NoIdle/manifest.json | 2 +- 10 files changed, 10 insertions(+), 28 deletions(-) diff --git a/HideGiftButton/index.js b/HideGiftButton/index.js index 5751041..eaad055 100644 --- a/HideGiftButton/index.js +++ b/HideGiftButton/index.js @@ -1 +1 @@ -(function(exports,_vendetta,metro){'use strict';function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}let origState;const ChatInput=metro.findByDisplayName("ChatInput");var index = new(function(){function HideGiftButton(){_classCallCheck(this,HideGiftButton);}var _proto=HideGiftButton.prototype;_proto.onLoad=function onLoad(){_vendetta.logger.log("Starting HideGiftButton...");origState=ChatInput.defaultProps.hideGiftButton;ChatInput.defaultProps.hideGiftButton=true;};_proto.onUnload=function onUnload(){_vendetta.logger.log("Unloading HideGiftButton..");ChatInput.defaultProps.hideGiftButton=origState;};return HideGiftButton}());exports.default=index;Object.defineProperty(exports,'__esModule',{value:true});return exports;})({},vendetta,vendetta.metro); \ No newline at end of file +(function(e,i,u){"use strict";function f(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}let a;const o=u.findByDisplayName("ChatInput");var l=new(function(){function t(){f(this,t)}var n=t.prototype;return n.onLoad=function(){i.logger.log("Starting HideGiftButton..."),a=o.defaultProps.hideGiftButton,o.defaultProps.hideGiftButton=!0},n.onUnload=function(){i.logger.log("Unloading HideGiftButton.."),o.defaultProps.hideGiftButton=a},t}());return e.default=l,Object.defineProperty(e,"__esModule",{value:!0}),e})({},vendetta,vendetta.metro); diff --git a/HideGiftButton/manifest.json b/HideGiftButton/manifest.json index 3a2d030..adcb61e 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":"9b9fc17e867866e0674424d44c542243771214fc72585b4819d50a24c92e2289"} \ 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":"701da2482a39c1a6318ee705a0aa22d641f351f6f4a94e7b650312ee40614892"} \ No newline at end of file diff --git a/Last.fm/index.js b/Last.fm/index.js index 7f0feb5..816f471 100644 --- a/Last.fm/index.js +++ b/Last.fm/index.js @@ -1,2 +1 @@ -(function(exports,_vendetta,metro,common,plugin,storage,assets,components,toasts){'use strict';const Constants={DEFAULT_APP_NAME:"Music",DEFAULT_TIME_INTERVAL:5,APPLICATION_ID:"1054951789318909972",LFM_API_KEY:"615322f0047e12aedbc610d9d71f7430",LFM_DEFAULT_COVER_HASHES:["2a96cbd8b46e442fc41c2b86b821562f","c6f59c1e5e7240a4c0d427abd71f3dbb"]};const AssetManager=metro.findByProps("getAssetIds");async function fetchLatestScrobble(){const params=new URLSearchParams({"method":"user.getrecenttracks","user":currentSettings.username,"api_key":Constants.LFM_API_KEY,"format":"json","limit":"1","extended":"1"}).toString();const result=await fetch(`https://ws.audioscrobbler.com/2.0/?${params}`);if(!result.ok)throw new Error(`Failed to fetch the latest scrobble: ${result.statusText}`);const info=await result.json();const lastTrack=info?.recenttracks?.track?.[0];if(!lastTrack)throw info;return {name:lastTrack.name,artist:lastTrack.artist.name,album:lastTrack.album["#text"],albumArt:await handleAlbumCover(lastTrack.image[3]["#text"]),url:lastTrack.url,date:lastTrack.date?.["#text"]??"now",nowPlaying:Boolean(lastTrack["@attr"]?.nowplaying),loved:lastTrack.loved==="1"}}async function handleAlbumCover(cover){if(Constants.LFM_DEFAULT_COVER_HASHES.some(function(x){return cover.includes(x)})){return null}return cover}function clearActivity(){global.lastActivity&&verboseLog("--> Clearing activity...");return sendRequest(null)}function sendRequest(activity){if(global.pluginStopped){console.log("--> Plugin is unloaded, aborting...");global.updateInterval&&clearInterval(global.updateInterval);activity=null;}global.lastActivity=activity;common.FluxDispatcher.dispatch({type:"LOCAL_ACTIVITY_UPDATE",activity:activity});}async function fetchAsset(asset){let appId=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Constants.APPLICATION_ID;if(!asset)return null;if(typeof asset==="string"){const assetId=await AssetManager.getAssetIds(appId,[asset]);return assetId[0]}return await AssetManager.getAssetIds(appId,asset)}async function update(){verboseLog("--> Fetching last track...");if(!currentSettings.username){toasts.showToast("Last.fm username is not set!",assets.getAssetIDByName("Small"));flush();throw new Error("Username is not set")}const lastTrack=await fetchLatestScrobble().catch(async function(err){verboseLog("--> An error occurred while fetching the last track, aborting...");clearActivity();throw err});if(!lastTrack.nowPlaying){verboseLog("--> Last track is not currently playing, aborting...");clearActivity();return}verboseLog("--> Track fetched!");if(global.lastTrackUrl===lastTrack.url){verboseLog("--> Last track is the same as the previous one, aborting...");return}const activity={name:currentSettings.appName||Constants.DEFAULT_APP_NAME,flags:0,type:currentSettings.listeningTo?2:0,details:lastTrack.name,state:`by ${lastTrack.artist}`,application_id:Constants.APPLICATION_ID};global.lastTrackUrl=lastTrack.url;if(activity.name.includes("{{")){for(const key in lastTrack){activity.name=activity.name.replace(`{{${key}}}`,lastTrack[key]);}}if(currentSettings.showTimestamp){activity.timestamps={start:Date.now()/1e3|0};}if(lastTrack.album){activity.assets={large_image:await fetchAsset(lastTrack.albumArt),large_text:`on ${lastTrack.album}`};}verboseLog("--> Setting activity...");verboseLog(activity);try{sendRequest(activity);}catch(err){verboseLog("--> An error occurred while setting the activity");clearActivity();throw err}verboseLog("--> Successfully set activity!");}function flush(){console.log("--> Flushing...");global.lastActivity=null;global.lastTrackUrl=null;global.updateInterval&&clearInterval(global.updateInterval);clearActivity();}async function initialize(){console.log("--> Initializing...");if(global.pluginStopped){throw new Error("Plugin is already stopped!")}flush();let tries=0;await update().catch(function(err){console.error(err);tries++;});global.updateInterval=setInterval(function(){return update().then(function(){tries=0;}).catch(function(err){console.error(err);if(++tries>3){console.error("Failed to fetch/set activity 3 times, aborting...");flush();}})},(currentSettings.timeInterval||Constants.DEFAULT_TIME_INTERVAL)*1e3);} -const{ScrollView,TouchableOpacity,Text}=common.ReactNative;const{FormInput,FormDivider,FormSwitchRow,FormText,FormIcon}=components.Forms;function UpdateButton(){async function onPressCallback(){for(const key in plugin.storage){if(plugin.storage[key]===false||plugin.storage[key]){currentSettings[key]=plugin.storage[key];}}console.log("Applying settings...");await initialize();toasts.showToast("Settings updated!",assets.getAssetIDByName("Check"));}return common.React.createElement(TouchableOpacity,{onPress:onPressCallback},common.React.createElement(FormText,{style:{marginRight:12}},"UPDATE"))}function Settings(){const settings=storage.useProxy(plugin.storage);const navigation=common.NavigationNative.useNavigation();common.React.useEffect(function(){navigation.setOptions({title:"Last.fm Configuration",headerRight:UpdateButton});},[]);return common.React.createElement(ScrollView,null,common.React.createElement(FormInput,{value:settings.appName||undefined,onChangeText:function(value){return settings.appName=value.trim()},title:"Discord Application Name",placeholder:Constants.DEFAULT_APP_NAME,returnKeyType:"done"}),common.React.createElement(FormDivider,null),common.React.createElement(FormInput,{required:true,value:settings.username||undefined,onChangeText:function(value){return settings.username=value.trim()},title:"Last.fm username",helpText:!settings.username&&common.React.createElement(Text,{style:{color:"#FF0000"}},"This field is required!"),placeholder:"wumpus123",returnKeyType:"done"}),common.React.createElement(FormDivider,null),common.React.createElement(FormInput,{value:settings.timeInterval,onChangeText:function(value){return settings.timeInterval=Number(value)},title:"Update interval (in seconds)",placeholder:Constants.DEFAULT_TIME_INTERVAL.toString(),keyboardType:"numeric",returnKeyType:"done"}),common.React.createElement(FormDivider,null),common.React.createElement(FormSwitchRow,{label:"Show time elapsed",subLabel:"Show the time elapsed since the song started playing",leading:common.React.createElement(FormIcon,{source:assets.getAssetIDByName("clock")}),value:settings.showTimestamp,onValueChange:function(value){return settings.showTimestamp=value}}),common.React.createElement(FormDivider,null),common.React.createElement(FormSwitchRow,{label:"Set status as listening",subLabel:'Set your status as "Listening to" instead of "Playing"',leading:common.React.createElement(FormIcon,{source:assets.getAssetIDByName("ic_headset_neutral")}),value:settings.listeningTo,onValueChange:function(value){return settings.listeningTo=value}}),common.React.createElement(FormDivider,null),common.React.createElement(FormSwitchRow,{label:"Verbose logging",subLabel:"Log more information to the console for debugging purposes",leading:common.React.createElement(FormIcon,{source:assets.getAssetIDByName("pencil")}),value:settings.verboseLogging,onValueChange:function(value){return settings.verboseLogging=value}}))}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}const global={};const currentSettings={..._vendetta.plugin.storage};const UserStore=metro.findByStoreName("UserStore");const SET_ACTIVITY=metro.findByProps("SET_ACTIVITY").SET_ACTIVITY;const verboseLog=function(){for(var _len=arguments.length,message=new Array(_len),_key=0;_key<_len;_key++){message[_key]=arguments[_key];}return currentSettings.verboseLogging&&console.log(...message)};var index = new(function(){function LastFM(){_classCallCheck(this,LastFM);this.settings=Settings;}var _proto=LastFM.prototype;_proto.onLoad=function onLoad(){console.log("Starting last.fm plugin..");global.pluginStopped=false;if(UserStore.getCurrentUser()){console.log("User is already logged in, initializing...");initialize().catch(console.error);}common.FluxDispatcher.subscribe("CONNECTION_OPEN",function(){initialize().catch(console.error);});};_proto.onUnload=function onUnload(){console.log("Stopping last.fm...");global.pluginStopped=true;flush();};return LastFM}());exports.SET_ACTIVITY=SET_ACTIVITY;exports.UserStore=UserStore;exports.currentSettings=currentSettings;exports.default=index;exports.global=global;exports.verboseLog=verboseLog;Object.defineProperty(exports,'__esModule',{value:true});return exports;})({},vendetta,vendetta.metro,vendetta.metro.common,vendetta.plugin,vendetta.storage,vendetta.ui.assets,vendetta.ui.components,vendetta.ui.toasts); \ No newline at end of file +(function(o,_,p,a,u,L,g,S,A){"use strict";function N(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}const c={DEFAULT_APP_NAME:"Music",DEFAULT_TIME_INTERVAL:5,APPLICATION_ID:"1054951789318909972",LFM_API_KEY:"615322f0047e12aedbc610d9d71f7430",LFM_DEFAULT_COVER_HASHES:["2a96cbd8b46e442fc41c2b86b821562f","c6f59c1e5e7240a4c0d427abd71f3dbb"]},E=p.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 P(s.image[3]["#text"]),url:s.url,date:s.date?.["#text"]??"now",nowPlaying:!!s["@attr"]?.nowplaying,loved:s.loved==="1"}}async function P(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 C(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]: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")),h(),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 C(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 h(){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!");h();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..."),h())})},(l.timeInterval||c.DEFAULT_TIME_INTERVAL)*1e3)}const{ScrollView:F,TouchableOpacity:D,Text:U}=a.ReactNative,{FormInput:y,FormDivider:d,FormSwitchRow:m,FormText:k,FormIcon:v}=S.Forms;function V(){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(D,{onPress:e},a.React.createElement(k,{style:{marginRight:12}},"UPDATE"))}function M(){const e=L.useProxy(u.storage),t=a.NavigationNative.useNavigation();return a.React.useEffect(function(){t.setOptions({title:"Last.fm Configuration",headerRight:V})},[]),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(U,{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={..._.plugin.storage},w=p.findByStoreName("UserStore"),O=p.findByProps("SET_ACTIVITY").SET_ACTIVITY,i=function(){for(var e=arguments.length,t=new Array(e),n=0;n. -*/function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}const dialog=metro.findByProps("show","confirm","close");const CallManager=metro.findByProps("handleStartCall");var index = new(function(){function MoreConfirm(){_classCallCheck(this,MoreConfirm);}var _proto=MoreConfirm.prototype;_proto.onLoad=function onLoad(){_vendetta.logger.log("MoreConfirm: patching calls...");_vendetta.patcher.instead("handleStartCall",CallManager,function(args,orig){const[{rawRecipients:[{username,discriminator},multiple]},isVideo]=args;const action=isVideo?"video call":"call";dialog.show({title:multiple?`MoreConfirm: Start a group ${action}?`:`MoreConfirm: Start a ${action} with ${username}#${discriminator}?`,body:multiple?"Are you sure you want to start the group call?":`Are you sure you want to ${action} ${username}#${discriminator}?`,confirmText:"Yes",cancelText:"Cancel",confirmColor:"brand",onConfirm:function(){try{orig(...args);}catch(e){_vendetta.logger.error("Failed to start call",e);}}});});};return MoreConfirm}());exports.default=index;Object.defineProperty(exports,'__esModule',{value:true});return exports;})({},vendetta,vendetta.metro); \ No newline at end of file +(function(t,n,a){"use strict";function u(o,r){if(!(o instanceof r))throw new TypeError("Cannot call a class as a function")}const f=a.findByProps("show","confirm","close"),d=a.findByProps("handleStartCall");var h=new(function(){function o(){u(this,o)}var r=o.prototype;return r.onLoad=function(){n.logger.log("MoreConfirm: patching calls..."),n.patcher.instead("handleStartCall",d,function(c,y){const[{rawRecipients:[{username:l,discriminator:i},s]},C]=c,e=C?"video call":"call";f.show({title:s?`MoreConfirm: Start a group ${e}?`:`MoreConfirm: Start a ${e} with ${l}#${i}?`,body:s?"Are you sure you want to start the group call?":`Are you sure you want to ${e} ${l}#${i}?`,confirmText:"Yes",cancelText:"Cancel",confirmColor:"brand",onConfirm:function(){try{y(...c)}catch(p){n.logger.error("Failed to start call",p)}}})})},o}());return t.default=h,Object.defineProperty(t,"__esModule",{value:!0}),t})({},vendetta,vendetta.metro); diff --git a/MoreConfirm/manifest.json b/MoreConfirm/manifest.json index 8e3009e..8a99127 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":"94e433cbfbd4551fc7bed612eaec9d5c68ca645d9df0cb4bc6be762d22958cb8"} \ 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":"9d5490c54eb51167ed5d13e5d16b64ffaece08a10d491d34148b2c991e5b0b41"} \ No newline at end of file diff --git a/NoAutoReplyMention/index.js b/NoAutoReplyMention/index.js index ee0d466..d56e30c 100644 --- a/NoAutoReplyMention/index.js +++ b/NoAutoReplyMention/index.js @@ -1 +1 @@ -(function(exports){'use strict';const onUnload=globalThis.vendetta.patcher.before("createPendingReply",globalThis.vendetta.metro.findByProps("createPendingReply"),function(param){let[arg]=param;return arg.shouldMention&&=false});exports.onUnload=onUnload;return exports;})({}); \ No newline at end of file +(function(n){"use strict";const e=globalThis.vendetta.patcher.before("createPendingReply",globalThis.vendetta.metro.findByProps("createPendingReply"),function(t){let[o]=t;return o.shouldMention&&=!1});return n.onUnload=e,n})({}); diff --git a/NoAutoReplyMention/manifest.json b/NoAutoReplyMention/manifest.json index 9b49b8f..29947ed 100644 --- a/NoAutoReplyMention/manifest.json +++ b/NoAutoReplyMention/manifest.json @@ -1 +1 @@ -{"name":"NoAutoReplyMention","description":"Turns off auto mention when replying to someone.","authors":[{"name":"amsyarasyiq","id":"492949202121261067"}],"main":"index.js","vendetta":{"icon":"ic_notif_off"},"hash":"7712887f12ca89b50048484550a314729e5c6398277052da52a960bfd16ca809"} \ No newline at end of file +{"name":"NoAutoReplyMention","description":"Turns off auto mention when replying to someone.","authors":[{"name":"amsyarasyiq","id":"492949202121261067"}],"main":"index.js","vendetta":{"icon":"ic_notif_off"},"hash":"4e0fe69544e65b3e9b9b83ccba6fb8eb76b17b2d17ab1f5c65220924dd3b5744"} \ No newline at end of file diff --git a/NoIdle/index.js b/NoIdle/index.js index 72ff89e..8972cfb 100644 --- a/NoIdle/index.js +++ b/NoIdle/index.js @@ -1 +1 @@ -(function(exports,_vendetta,common){'use strict';function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}let unpatch;var index = new(function(){function NoIdle(){_classCallCheck(this,NoIdle);}var _proto=NoIdle.prototype;_proto.onLoad=function onLoad(){_vendetta.logger.log("Starting NoIdle...");unpatch=_vendetta.patcher.before("dispatch",common.FluxDispatcher,function(param){let[{type}]=param;if(type!=="IDLE")return;return [{type:"IDLE",idle:false}]});};_proto.onUnload=function onUnload(){_vendetta.logger.log("Disabling NoIdle..");unpatch?.();};return NoIdle}());exports.default=index;Object.defineProperty(exports,'__esModule',{value:true});return exports;})({},vendetta,vendetta.metro.common); \ No newline at end of file +(function(t,o,r){"use strict";function l(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}let i;var a=new(function(){function n(){l(this,n)}var e=n.prototype;return e.onLoad=function(){o.logger.log("Starting NoIdle..."),i=o.patcher.before("dispatch",r.FluxDispatcher,function(c){let[{type:u}]=c;if(u==="IDLE")return[{type:"IDLE",idle:!1}]})},e.onUnload=function(){o.logger.log("Disabling NoIdle.."),i?.()},n}());return t.default=a,Object.defineProperty(t,"__esModule",{value:!0}),t})({},vendetta,vendetta.metro.common); diff --git a/NoIdle/manifest.json b/NoIdle/manifest.json index 11bd798..4bf740d 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":"256e4ec951c2e6cd397f16fe007ac0ca68ad3b63ec43acc8d8d23834dbe31b63"} \ 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":"bc61a8f9235e22cc84c3007f3d02cde50ce140db38ec20a4bb5c0d080fd32736"} \ No newline at end of file