From c7b9009bb357a101d7d5de92d08debef893fd628 Mon Sep 17 00:00:00 2001 From: amsyarasyiq Date: Thu, 27 Apr 2023 07:37:16 +0000 Subject: [PATCH] deploy: 41bad09587837bfa79bdaf5a075379b958e00c4e --- RichPresence/index.js | 2 +- RichPresence/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RichPresence/index.js b/RichPresence/index.js index 0ae19ae..38f9614 100644 --- a/RichPresence/index.js +++ b/RichPresence/index.js @@ -1 +1 @@ -(function(u,s,_,n,g,v,m,T,C){"use strict";function I(t,l){if(!(t instanceof l))throw new TypeError("Cannot call a class as a function")}function f(t,l){for(var e=0;e0:t||t===0||t===!1}function x(t){return JSON.parse(JSON.stringify(t,function(l,e){if(e===t)return e;if(!(typeof l=="string"&&l.startsWith("_")))switch(typeof e){case"object":{if(Array.isArray(e)&&e.length===0)return;const a=Object.entries(e).filter(function(F){return h(F[1])});return a.length>0?Object.fromEntries(a):void 0}default:return h(e)?e:void 0}}))}var d;(function(t){t[t.PLAYING=0]="PLAYING",t[t.STREAMING=1]="STREAMING",t[t.LISTENING=2]="LISTENING",t[t.WATCHING=3]="WATCHING",t[t.COMPETING=5]="COMPETING"})(d||(d={}));const y=_.findByProps("getAssetIds"),E=Date.now(),o=s.plugin.storage;typeof o.selected?.length!="number"&&Object.assign(o,{selected:"default",selections:{default:k()}});function k(){return{name:"Discord",application_id:"1054951789318909972",flags:0,type:d.PLAYING,timestamps:{_enabled:!1,start:E},assets:{},buttons:[{},{}]}}async function R(t){if(typeof t!="object")throw new Error("Invalid activity");const l=t?.timestamps?._enabled;if(t=x(t),l?t.timestamps.start||=E:delete t.timestamps,t?.assets){const e=[t.application_id,[t.assets.large_image,t.assets.small_image]];let a=y.getAssetIds(...e);a.length||(a=await y.fetchAssetIds(...e)),t.assets.large_image=a[0],t.assets.small_image=a[1]}return t?.buttons?.length&&(t.buttons=t.buttons.filter(function(e){return e.label&&e.url}),t.buttons.length?Object.assign(t,{metadata:{button_urls:t.buttons.map(function(e){return e.url})},buttons:t.buttons.map(function(e){return e.label})}):delete t.buttons),n.FluxDispatcher.dispatch({type:"LOCAL_ACTIVITY_UPDATE",activity:t,pid:1608,socketId:"RichPresence@Vendetta"}),t}var O=new(function(){function t(){I(this,t),w(this,"settings",P)}return S(t,[{key:"onLoad",value:function(){s.logger.log("Sending RPC request");const l=o.selections[o.selected];if(!l)throw new Error("Selected activity does not exist");R(l).then(function(e){s.logger.log("RPC request sent"),s.logger.log(e)}).catch(function(e){s.logger.error("An error occured while sending RPC request :("),s.logger.error(e?.stack??e)})}},{key:"onUnload",value:function(){s.logger.log("Stopping RPC request"),R(null)}}]),t}());return u.default=O,Object.defineProperty(u,"__esModule",{value:!0}),u})({},vendetta,vendetta.metro,vendetta.metro.common,vendetta.plugin,vendetta.storage,vendetta.ui,vendetta.ui.components,vendetta.metro.common.ReactNative); +(function(c,s,d,n,b,i,C,p,h,S){"use strict";function w(t,l){if(!(t instanceof l))throw new TypeError("Cannot call a class as a function")}function y(t,l){for(var e=0;e0:t||t===0||t===!1}function B(t){return JSON.parse(JSON.stringify(t,function(l,e){if(e===t)return e;if(!(typeof l=="string"&&l.startsWith("_")))switch(typeof e){case"object":{if(Array.isArray(e)&&e.length===0)return;const a=Object.entries(e).filter(function(M){return v(M[1])});return a.length>0?Object.fromEntries(a):void 0}default:return v(e)?e:void 0}}))}var f;(function(t){t[t.PLAYING=0]="PLAYING",t[t.STREAMING=1]="STREAMING",t[t.LISTENING=2]="LISTENING",t[t.WATCHING=3]="WATCHING",t[t.COMPETING=5]="COMPETING"})(f||(f={}));const _=d.findByProps("getAssetIds"),T=Date.now(),u=s.plugin.storage;typeof u.selected?.length!="number"&&Object.assign(u,{selected:"default",selections:{default:G()}});function G(){return{name:"Discord",application_id:"1054951789318909972",flags:0,type:f.PLAYING,timestamps:{_enabled:!1,start:T},assets:{},buttons:[{},{}]}}async function I(t){if(typeof t!="object")throw new Error("Invalid activity");if(t){const l=t?.timestamps?._enabled;if(t=B(t),l?t.timestamps.start||=T:delete t.timestamps,t.assets){const e=[t.application_id,[t.assets.large_image,t.assets.small_image]];let a=_.getAssetIds(...e);a.length||(a=await _.fetchAssetIds(...e)),t.assets.large_image=a[0],t.assets.small_image=a[1]}t.buttons?.length?(t.buttons=t.buttons.filter(function(e){return e.label&&e.url}),t.buttons.length?Object.assign(t,{metadata:{button_urls:t.buttons.map(function(e){return e.url})},buttons:t.buttons.map(function(e){return e.label})}):delete t.buttons):delete t.buttons}return n.FluxDispatcher.dispatch({type:"LOCAL_ACTIVITY_UPDATE",activity:t,pid:1608,socketId:"RichPresence@Vendetta"}),t}var m=new(function(){function t(){w(this,t),P(this,"settings",D)}return L(t,[{key:"onLoad",value:function(){s.logger.log("Sending RPC request");const l=u.selections[u.selected];if(!l)throw new Error("Selected activity does not exist");I(l).then(function(e){s.logger.log("RPC request sent"),s.logger.log(e)}).catch(function(e){s.logger.error("An error occured while sending RPC request :("),s.logger.error(e?.stack??e)})}},{key:"onUnload",value:function(){s.logger.log("Stopping RPC request"),I(null)}}]),t}());return c.default=m,Object.defineProperty(c,"__esModule",{value:!0}),c})({},vendetta,vendetta.metro,vendetta.metro.common,vendetta.plugin,vendetta.ui.components,vendetta.storage,vendetta.ui,vendetta.metro.common.ReactNative,window.React); diff --git a/RichPresence/manifest.json b/RichPresence/manifest.json index 402ff5a..b02bb7c 100644 --- a/RichPresence/manifest.json +++ b/RichPresence/manifest.json @@ -1 +1 @@ -{"authors":[{"name":"pylix","id":"492949202121261067"}],"main":"index.js","name":"RichPresence","description":"Sets Discord Rich Presence for your profile.","vendetta":{"icon":"games"},"hash":"23b1d878fef631d419f07643bfefcede5bf289e6e7ee1f7b021d3b5cfe4251d7"} \ No newline at end of file +{"authors":[{"name":"pylix","id":"492949202121261067"}],"main":"index.js","name":"RichPresence","description":"Sets Discord Rich Presence for your profile.","vendetta":{"icon":"games"},"hash":"fdcc10daa087bd26b1f2ab16b6e97897704bd25fabe5165cb9262b1ffd63b036"} \ No newline at end of file