diff --git a/Moyai/index.js b/Moyai/index.js new file mode 100644 index 0000000..b379667 --- /dev/null +++ b/Moyai/index.js @@ -0,0 +1 @@ +(function(o,E,r,n,d){"use strict";const{ScrollView:R}=r.findByProps("ScrollView"),{TableRowGroup:S,TableSwitchRow:b,Stack:w}=r.findByProps("TableSwitchRow","TableRowGroup","Stack");function m(){const[,e]=n.React.useReducer(function(t){return~t},0);return n.React.createElement(R,{style:{flex:1}},n.React.createElement(w,{style:{padding:16},spacing:16},n.React.createElement(S,{title:"General"},n.React.createElement(b,{label:"Play on reactions",subLabel:"Play the sound when someone reacts with moyai",value:d.plugin.storage.allowReactions??!0,onValueChange:function(t){d.plugin.storage.allowReactions=t,e()}}))))}const{DCDSoundManager:c}=n.ReactNative.NativeModules,f=r.findByStoreName("SelectedChannelStore"),D="https://raw.githubusercontent.com/Metastruct/garrysmod-chatsounds/master/sound/chatsounds/autoadd/memes/overused%20thud.ogg",i=6969;let h=-1;const T=function(){return new Promise(function(e){try{c.prepare(D,"media",i,function(t,s){return e(s)})}catch{e({duration:1e3})}})};let u=null,a=!1;async function g(){if(l)try{a&&(u!=null&&clearTimeout(u),c.stop(i),a=!1),a=!0,await c.play(i),u=setTimeout(function(){a=!1,l&&c.stop(i),u=null},h)}catch{a=!1}}const A=/🗿|/gi;function p(e){try{if(e.message?.content&&e.channelId==f.getChannelId()&&!e.message.state){const t=e.message.content.match(A);if(t)for(let s=0;s