';
-
- return changeLog;
-};
-
-Core.prototype.alert = function (title, text) {
- var id = '';
- for( var i=0; i < 5; i++ )
- id += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(Math.random() * "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".length));
- var bdAlert = '\
+(function(){let __fs=window.require("fs");let __process=window.require("process");let __platform=__process.platform;let __dataPath=(__platform==='win32'?__process.env.APPDATA:__platform==='darwin'?__process.env.HOME+'/Library/Preferences':process.env.HOME+'/.config')+'/BetterDiscord/';let __data={};if(__fs.existsSync(`${__dataPath}localStorage.json`)){try{__data=JSON.parse(__fs.readFileSync(`${__dataPath}localStorage.json`))}catch(err){console.log(err)}}else if(__fs.existsSync("localStorage.json")){try{__data=JSON.parse(__fs.readFileSync("localStorage.json"))}catch(err){console.log(err)}}
+var __ls=__data;__ls.setItem=function(i,v){__ls[i]=v;this.save()};__ls.getItem=function(i){return __ls[i]||null};__ls.save=function(){__fs.writeFileSync(`${__dataPath}/localStorage.json`,JSON.stringify(this),null,4)};var __proxy=new Proxy(__ls,{set:function(target,name,val,receiver){__ls[name]=val;__ls.save()},get:function(target,name,receiver){return __ls[name]||null}});window.localStorage=__proxy})();(()=>{let v2Loader=document.createElement('div');v2Loader.className="bd-loaderv2";v2Loader.title="BetterDiscord is loading...";document.body.appendChild(v2Loader)})();window.bdStorage={};window.bdStorage.get=function(i){return betterDiscordIPC.sendSync('synchronous-message',{'arg':'storage','cmd':'get','var':i})};window.bdStorage.set=function(i,v){betterDiscordIPC.sendSync('synchronous-message',{'arg':'storage','cmd':'set','var':i,'data':v})};window.bdPluginStorage={};window.bdPluginStorage.get=function(pn,i){return betterDiscordIPC.sendSync('synchronous-message',{'arg':'pluginstorage','cmd':'get','pn':pn,'var':i})};window.bdPluginStorage.set=function(pn,i,v){betterDiscordIPC.sendSync('synchronous-message',{'arg':'pluginstorage','cmd':'set','pn':pn,'var':i,'data':v})};betterDiscordIPC.on('asynchronous-reply',(event,arg)=>{console.log(event);console.log(arg)});var settingsPanel,emoteModule,utils,quickEmoteMenu,opublicServers,voiceMode,pluginModule,themeModule,customCssEditor,dMode;var jsVersion=1.79;var supportedVersion="0.2.81";var mainObserver;var twitchEmoteUrlStart="https://static-cdn.jtvnw.net/emoticons/v1/";var twitchEmoteUrlEnd="/1.0";var ffzEmoteUrlStart="https://cdn.frankerfacez.com/emoticon/";var ffzEmoteUrlEnd="/1";var bttvEmoteUrlStart="https://cdn.betterttv.net/emote/";var bttvEmoteUrlEnd="/1x";var mainCore;var settings={"Save logs locally":{"id":"bda-gs-0","info":"Saves chat logs locally","implemented":!1,"hidden":!1,"cat":"core"},"Public Servers":{"id":"bda-gs-1","info":"Display public servers button","implemented":!0,"hidden":!1,"cat":"core"},"Minimal Mode":{"id":"bda-gs-2","info":"Hide elements and reduce the size of elements.","implemented":!0,"hidden":!1,"cat":"core"},"Voice Mode":{"id":"bda-gs-4","info":"Only show voice chat","implemented":!0,"hidden":!1,"cat":"core"},"Hide Channels":{"id":"bda-gs-3","info":"Hide channels in minimal mode","implemented":!0,"hidden":!1,"cat":"core"},"Dark Mode":{"id":"bda-gs-5","info":"Make certain elements dark by default(wip)","implemented":!0,"hidden":!1,"cat":"core"},"Override Default Emotes":{"id":"bda-es-5","info":"Override default emotes","implemented":!1,"hidden":!1,"cat":"core"},"Voice Disconnect":{"id":"bda-dc-0","info":"Disconnect from voice server when closing Discord","implemented":!0,"hidden":!1,"cat":"core"},"Custom css live update":{"id":"bda-css-0","info":"","implemented":!0,"hidden":!0,"cat":"core"},"Custom css auto udpate":{"id":"bda-css-1","info":"","implemented":!0,"hidden":!0,"cat":"core"},"24 Hour Timestamps":{"id":"bda-gs-6","info":"Replace 12hr timestamps with proper ones","implemented":!0,"hidden":!1,"cat":"core"},"Coloured Text":{"id":"bda-gs-7","info":"Make text colour the same as role colour","implemented":!0,"hidden":!1,"cat":"core"},"BetterDiscord Blue":{"id":"bda-gs-b","info":"Replace Discord blue with BD Blue","implemented":!0,"hidden":!1,"cat":"core"},"Developer Mode":{"id":"bda-gs-8","info":"Developer Mode","implemented":!0,"hidden":!1,"cat":"core"},"Twitch Emotes":{"id":"bda-es-7","info":"Show Twitch emotes","implemented":!0,"hidden":!1,"cat":"emote"},"FrankerFaceZ Emotes":{"id":"bda-es-1","info":"Show FrankerFaceZ Emotes","implemented":!0,"hidden":!1,"cat":"emote"},"BetterTTV Emotes":{"id":"bda-es-2","info":"Show BetterTTV Emotes","implemented":!0,"hidden":!1,"cat":"emote"},"Emote Menu":{"id":"bda-es-0","info":"Show Twitch/Favourite emotes in emote menu","implemented":!0,"hidden":!1,"cat":"emote"},"Emoji Menu":{"id":"bda-es-9","info":"Show Discord emoji menu","implemented":!0,"hidden":!1,"cat":"emote"},"Emote Autocomplete":{"id":"bda-es-3","info":"Autocomplete emote commands","implemented":!1,"hidden":!1,"cat":"emote"},"Emote Auto Capitalization":{"id":"bda-es-4","info":"Autocapitalize emote commands","implemented":!0,"hidden":!1,"cat":"emote"},"Show Names":{"id":"bda-es-6","info":"Show emote names on hover","implemented":!0,"hidden":!1,"cat":"emote"},"Show emote modifiers":{"id":"bda-es-8","info":"Enable emote mods","implemented":!0,"hidden":!1,"cat":"emote"},};var links={"Jiiks.net":{"text":"Jiiks.net","href":"thtp://jiiks.net","target":"_blank"},"twitter":{"text":"Twitter","href":"http://twitter.com/jiiksi","target":"_blank"},"github":{"text":"Github","href":"http://github.com/jiiks","target":"_blank"}};var defaultCookie={"version":jsVersion,"bda-gs-0":!1,"bda-gs-1":!0,"bda-gs-2":!1,"bda-gs-3":!1,"bda-gs-4":!1,"bda-gs-5":!0,"bda-gs-6":!1,"bda-gs-7":!1,"bda-gs-8":!1,"bda-es-0":!0,"bda-es-1":!0,"bda-es-2":!0,"bda-es-3":!1,"bda-es-4":!1,"bda-es-5":!0,"bda-es-6":!0,"bda-es-7":!0,"bda-gs-b":!0,"bda-es-8":!0,"bda-jd":!0,"bda-es-8":!0,"bda-dc-0":!1,"bda-css-0":!1,"bda-css-1":!1,"bda-es-9":!0};var bdchangelog={"changes":{"0a":{"title":"1.78 : Temp support for new settingspanel","text":"Added temp support for Discord's new settingspanel until v2.","img":""},"0b":{"title":"1.78 : Public Servers","text":"New look and flow for public servers","img":""},"0c":{"title":"1.78 : New loading icon","text":"New loading icon will now display in bottom right when BD is loading.","img":""},"0d":{"title":"1.78 : New CustomCSS editor look","text":"Updated CustomCSS editor with dark theme","img":""},"0e":{"title":"1.78 : BetterDiscord Blue","text":"Replace Discord blue with BetterDiscord blue!","img":""}},"fixes":{"0a":{"title":"1.79 : Settings Saving","text":"Fixed settings not saving with new settings panel","img":""}}};var settingsCookie={};function Core(){}
+Core.prototype.init=function(){var self=this;var lVersion=(typeof(version)==="undefined")?bdVersion:version;if(lVersion Please download the latest version from BetterDiscord.net");return}
+utils=new Utils();var sock=new BdWSocket();sock.start();utils.getHash();emoteModule=new EmoteModule();quickEmoteMenu=new QuickEmoteMenu();voiceMode=new VoiceMode();dMode=new devMode();emoteModule.init();this.initSettings();this.initObserver();function gwDefer(){console.log(new Date().getTime()+" Defer");if($(".guilds-wrapper .guilds").children().length>0){console.log(new Date().getTime()+" Defer Loaded");var guilds=$(".guilds>li:first-child");var showChannelsButton=$("",{class:"btn",id:"bd-show-channels",text:"R",css:{"cursor":"pointer"},click:function(){settingsCookie["bda-gs-3"]=!1;$("body").removeClass("bd-minimal-chan");self.saveSettings()}});$(".guilds-wrapper").prepend(showChannelsButton);opublicServers=new PublicServers();customCssEditor=new CustomCssEditor();pluginModule=new PluginModule();pluginModule.loadPlugins();if(typeof(themesupport2)!=="undefined"){themeModule=new ThemeModule();themeModule.loadThemes()}
+settingsPanel=new SettingsPanel();settingsPanel.init();quickEmoteMenu.init(!1);$("#tc-settings-button").on("click",function(){settingsPanel.show()});window.addEventListener("beforeunload",function(){if(settingsCookie["bda-dc-0"]){$('.btn.btn-disconnect').click()}});$(document).on("mousedown",function(e){});opublicServers.init();emoteModule.autoCapitalize();if(settingsCookie.version.CodeMirror{ min-width:100%; }");$("head").append('');document.getElementsByClassName("bd-loaderv2")[0].remove()}else{setTimeout(gwDefer,100)}}
+$(document).ready(function(){setTimeout(gwDefer,1000)})};Core.prototype.initSettings=function(){if($.cookie("better-discord")==undefined){settingsCookie=defaultCookie;this.saveSettings()}else{this.loadSettings();for(var setting in defaultCookie){if(settingsCookie[setting]==undefined){settingsCookie[setting]=defaultCookie[setting];this.saveSettings()}}}};Core.prototype.saveSettings=function(){$.cookie("better-discord",JSON.stringify(settingsCookie),{expires:365,path:'/'})};Core.prototype.loadSettings=function(){settingsCookie=JSON.parse($.cookie("better-discord"))};var botlist=["119598467310944259"];Core.prototype.initObserver=function(){mainObserver=new MutationObserver(function(mutations){mutations.forEach(function(mutation){if(settingsPanel!==undefined)
+settingsPanel.inject(mutation);if($(mutation.target).find(".emoji-picker").length){var fc=mutation.target.firstChild;if(fc.classList.contains("popout")){quickEmoteMenu.obsCallback($(fc))}}
+if(typeof pluginModule!=="undefined")pluginModule.rawObserver(mutation);if(mutation.target.getAttribute('class')!=null){if(mutation.target.classList.contains('title-wrap')||mutation.target.classList.contains('chat')){voiceMode.obsCallback();if(typeof pluginModule!=="undefined")pluginModule.channelSwitch()}
+if(mutation.target.getAttribute('class').indexOf('scroller messages')!=-1){if(typeof pluginModule!=="undefined")pluginModule.newMessage()}
+if(settingsCookie["bda-gs-6"]){$(".timestamp").not("[data-24]").each(function(){var t=$(this);t.attr("data-24",!0);var text=t.text();var matches=/(.*)?at\s+(\d{1,2}):(\d{1,2})\s+(.*)/.exec(text);if(matches==null)return!0;if(matches.length<5)return!0;var h=parseInt(matches[2]);if(matches[4]=="AM"){if(h==12)h-=12}else if(matches[4]=="PM"){if(h<12)h+=12}
+matches[2]=('0'+h).slice(-2);t.text(matches[1]+" at "+matches[2]+":"+matches[3])})}
+if(settingsCookie["bda-gs-7"]){$(".user-name").not("[data-colour]").each(function(){var t=$(this);var color=t.css("color");if(color=="rgb(255, 255, 255)")return!0;t.closest(".message-group").find(".markup").not("[data-colour]").each(function(){$(this).attr("data-colour",!0);$(this).css("color",color)})})}}
+emoteModule.obsCallback(mutation)})});mainObserver.observe(document,{childList:!0,subtree:!0})};Core.prototype.constructChangelog=function(){var changeLog=''+'
'+'
'+'
'+'
'+' What\'s new in BetterDiscord JS'+jsVersion+''+' '+'
'+'
'+'
';if(bdchangelog.changes!=null){changeLog+=''+'
'+' New Stuff'+'
'+'
';for(var change in bdchangelog.changes){change=bdchangelog.changes[change];changeLog+=''+'
'+' '+change.title+''+'
'+change.text+'
'+'
'}
+changeLog+='
'}
+if(bdchangelog.fixes!=null){changeLog+=''+'
'+' Fixed'+'
'+'
';for(var fix in bdchangelog.fixes){fix=bdchangelog.fixes[fix];changeLog+=''+'