diff --git a/HideGiftButton/index.js b/HideGiftButton/index.js index eaad055..d28f056 100644 --- a/HideGiftButton/index.js +++ b/HideGiftButton/index.js @@ -1 +1 @@ -(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); +(function(u,i,r){"use strict";function d(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function l(e,n){for(var a=0;a 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 Clearing activity..."),I(null)}function I(e){i.pluginStopped&&(console.log("--> Plugin is unloaded, aborting..."),i.updateInterval&&clearInterval(i.updateInterval),e=null),i.lastActivity=e,a.FluxDispatcher.dispatch({type:"LOCAL_ACTIVITY_UPDATE",activity:e})}async function U(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 w(){if(l("--> Fetching last track..."),!s.username)throw b.showToast("Last.fm username is not set!",g.getAssetIDByName("Small")),h(),new Error("Username is not set");const e=await C().catch(async function(n){throw l("--> An error occurred while fetching the last track, aborting..."),d(),n});if(!e.nowPlaying){l("--> Last track is not currently playing, aborting..."),d();return}if(l("--> Track fetched!"),i.lastTrackUrl===e.url){l("--> Last track is the same as the previous one, aborting...");return}const 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(i.lastTrackUrl=e.url,t.name.includes("{{"))for(const 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 U(e.albumArt),large_text:`on ${e.album}`}),l("--> Setting activity..."),l(t);try{I(t)}catch(n){throw l("--> An error occurred while setting the activity"),d(),n}l("--> Successfully set activity!")}function h(){console.log("--> Flushing..."),i.lastActivity=null,i.lastTrackUrl=null,i.updateInterval&&clearInterval(i.updateInterval),d()}async function m(){if(console.log("--> Initializing..."),i.pluginStopped)throw new Error("Plugin is already stopped!");h();let e=0;await w().catch(function(t){console.error(t),e++}),i.updateInterval=setInterval(function(){return w().then(function(){e=0}).catch(function(t){console.error(t),++e>3&&(console.error("Failed to fetch/set activity 3 times, aborting..."),h())})},(s.timeInterval||c.DEFAULT_TIME_INTERVAL)*1e3)}const{ScrollView:k,TouchableOpacity:V,Text:O}=a.ReactNative,{FormInput:p,FormDivider:f,FormSwitchRow:T,FormText:M,FormIcon:v}=P.Forms;function x(){async function e(){for(const t in u.storage)(u.storage[t]===!1||u.storage[t])&&(s[t]=u.storage[t]);console.log("Applying settings..."),await m(),b.showToast("Settings updated!",g.getAssetIDByName("Check"))}return a.React.createElement(V,{onPress:e},a.React.createElement(M,{style:{marginRight:12}},"UPDATE"))}function $(){const e=S.useProxy(u.storage),t=a.NavigationNative.useNavigation();return a.React.useEffect(function(){t.setOptions({title:"Last.fm Configuration",headerRight:x})},[]),a.React.createElement(k,null,a.React.createElement(p,{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(f,null),a.React.createElement(p,{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(O,{style:{color:"#FF0000"}},"This field is required!"),placeholder:"wumpus123",returnKeyType:"done"}),a.React.createElement(f,null),a.React.createElement(p,{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(f,null),a.React.createElement(T,{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(f,null),a.React.createElement(T,{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(f,null),a.React.createElement(T,{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 i={},s={...L.plugin.storage},_=y.findByStoreName("UserStore"),B=y.findByProps("SET_ACTIVITY").SET_ACTIVITY,l=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&e.React.createElement(I,{data:t.exempted,keyExtractor:function(c){return c},renderItem:function(c){let{item:l}=c;const E=g.getUser(l);return e.React.createElement(p,{label:E.username,leading:e.React.createElement(m,{style:y.avatar,source:{uri:E.getAvatarURL()}}),trailing:e.React.createElement(d,{onPress:function(){n.storage.exempted=n.storage.exempted.filter(function(C){return C!==l})}},e.React.createElement(o,{source:u.getAssetIDByName("Small"),disableColor:!0}))})},ItemSeparatorComponent:h}),a&&e.React.createElement(w,{onFinish:function(){return r(!1)}})))}const D=f.findByProps("createPendingReply");n.storage.exempted??=[];var A=new function a(){F(this,a),R(this,"settings",U),R(this,"onUnload",v.patcher.before("createPendingReply",D,function(r){let[t]=r;t.shouldMention&&=n.storage.exempted.includes(t.message?.author?.id)}))};return s.default=A,Object.defineProperty(s,"__esModule",{value:!0}),s})({},vendetta,vendetta.metro,vendetta.plugin,vendetta.metro.common,vendetta.storage,vendetta.ui.assets,vendetta.ui.components); diff --git a/NoAutoReplyMention/manifest.json b/NoAutoReplyMention/manifest.json index 29947ed..57a0b5d 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":"4e0fe69544e65b3e9b9b83ccba6fb8eb76b17b2d17ab1f5c65220924dd3b5744"} \ 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":"3d7e4738159925fa69e65006881aaef5c775260316b58044b68608ae817050d5"} \ No newline at end of file diff --git a/NoIdle/index.js b/NoIdle/index.js index 8972cfb..d03836b 100644 --- a/NoIdle/index.js +++ b/NoIdle/index.js @@ -1 +1 @@ -(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); +(function(t,u,o){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function f(e,n){for(var l=0;l