diff --git a/js/main.js b/js/main.js
index 72f39f2b..0ad546d1 100644
--- a/js/main.js
+++ b/js/main.js
@@ -1079,12 +1079,6 @@ SettingsPanel.prototype.init = function () {
voiceMode.enable();
}
- if (settingsCookie["bda-jd"]) {
- opublicServers.joinServer("0Tmfo5ZbORCRqbAd");
- settingsCookie["bda-jd"] = false;
- mainCore.saveSettings();
- }
-
if (settingsCookie["bda-es-6"]) {
//Pretty emote titles
emoteNamePopup = $("
");
diff --git a/js/main.min.js b/js/main.min.js
index 6c4fa6ae..8081434c 100644
--- a/js/main.min.js
+++ b/js/main.min.js
@@ -1,2 +1,68 @@
-function Core(){}function EmoteModule(){}function PublicServers(){}function QuickEmoteMenu(){}function SettingsPanel(){utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.9.0/codemirror.min.js"),utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.9.0/mode/css/css.min.js"),utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.4.2/Sortable.min.js")}function Utils(){}function VoiceMode(){}function PluginModule(){}function ThemeModule(){}function BdWSocket(){bdws=this}function BdApi(){}var settingsPanel,emoteModule,utils,quickEmoteMenu,opublicServers,voiceMode,pluginModule,themeModule,jsVersion=1.57,supportedVersion="0.2.5",mainObserver,twitchEmoteUrlStart="https://static-cdn.jtvnw.net/emoticons/v1/",twitchEmoteUrlEnd="/1.0",ffzEmoteUrlStart="https://cdn.frankerfacez.com/emoticon/",ffzEmoteUrlEnd="/1",bttvEmoteUrlStart="https://cdn.betterttv.net/emote/",bttvEmoteUrlEnd="/1x",mainCore,settings={"Save logs locally":{id:"bda-gs-0",info:"Saves chat logs locally",implemented:!1},"Public Servers":{id:"bda-gs-1",info:"Display public servers button",implemented:!0},"Minimal Mode":{id:"bda-gs-2",info:"Hide elements and reduce the size of elements.",implemented:!0},"Voice Mode":{id:"bda-gs-4",info:"Only show voice chat",implemented:!0},"Hide Channels":{id:"bda-gs-3",info:"Hide channels in minimal mode",implemented:!0},"Quick Emote Menu":{id:"bda-es-0",info:"Show quick emote menu for adding emotes",implemented:!0},"Show Emotes":{id:"bda-es-7",info:"Show any emotes",implemented:!0},"FrankerFaceZ Emotes":{id:"bda-es-1",info:"Show FrankerFaceZ Emotes",implemented:!0},"BetterTTV Emotes":{id:"bda-es-2",info:"Show BetterTTV Emotes",implemented:!0},"Emote Autocomplete":{id:"bda-es-3",info:"Autocomplete emote commands",implemented:!1},"Emote Auto Capitalization":{id:"bda-es-4",info:"Autocapitalize emote commands",implemented:!0},"Override Default Emotes":{id:"bda-es-5",info:"Override default emotes",implemented:!1},"Show Names":{id:"bda-es-6",info:"Show emote names on hover",implemented:!0}},links={"Jiiks.net":{text:"Jiiks.net",href:"http://jiiks.net",target:"_blank"},twitter:{text:"Twitter",href:"http://twitter.com/jiiksi",target:"_blank"},github:{text:"Github",href:"http://github.com/jiiks",target:"_blank"}},defaultCookie={version:jsVersion,"bda-gs-0":!1,"bda-gs-1":!0,"bda-gs-2":!1,"bda-gs-3":!1,"bda-gs-4":!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-jd":!0},bdchangelog={changes:{api:{title:"Api Functions!",text:"New api events!",img:""},dec:{title:"Decorations&Snow!",text:"Decorations and snow have been removed.",img:""}},fixes:{emotes:{title:"Sub emotes!",text:"Discord sub emotes are now replaced by BetterDiscord sub emotes and can be favorited!",img:""}},upcoming:{ignore:{title:"Ignore User!",text:"Ignore users you don't like!",img:""}}},settingsCookie={};Core.prototype.init=function(){function e(){if(console.log((new Date).getTime()+" Defer"),$(".guilds-wrapper .guilds").children().length>0){console.log((new Date).getTime()+" Defer Loaded");var i=$(".guilds>li:first-child");i.after($(" ",{id:"bd-pub-li",css:{height:"20px",display:1==settingsCookie["bda-gs-1"]?"":"none"}}).append($("
",{"class":"guild-inner",css:{height:"20px","border-radius":"4px"}}).append($(" ").append($("
",{css:{"line-height":"20px","font-size":"12px"},text:"public",id:"bd-pub-button"})))));var o=$(" ",{"class":"btn",id:"bd-show-channels",text:"R",css:{cursor:"pointer"},click:function(){settingsCookie["bda-gs-3"]=!1,$("body").removeClass("bd-minimal-chan"),t.saveSettings()}});if($(".guilds-wrapper").prepend(o),opublicServers=new PublicServers,pluginModule=new PluginModule,pluginModule.loadPlugins(),"undefined"!=typeof themesupport2&&(themeModule=new ThemeModule,themeModule.loadThemes()),settingsPanel=new SettingsPanel,settingsPanel.init(),quickEmoteMenu.init(!1),$("#tc-settings-button").on("click",function(){settingsPanel.show()}),$("#bd-pub-button").on("click",function(){opublicServers.show()}),opublicServers.init(),emoteModule.autoCapitalize(),settingsCookie.version.CodeMirror{ min-width:100%; }"),$("head").append('')}else setTimeout(e,100)}var t=this;if(version Please download the latest version from BetterDiscord.net ");utils=new Utils;var i=new BdWSocket;i.start(),utils.getHash(),emoteModule=new EmoteModule,quickEmoteMenu=new QuickEmoteMenu,voiceMode=new VoiceMode,emoteModule.init(),this.initSettings(),this.initObserver(),$(document).ready(function(){setTimeout(e,1e3)})},Core.prototype.initSettings=function(){if(void 0==$.cookie("better-discord"))settingsCookie=defaultCookie,this.saveSettings();else{this.loadSettings();for(var e in defaultCookie)void 0==settingsCookie[e]&&(settingsCookie[e]=defaultCookie[e],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(e){e.forEach(function(e){if(null!=e.target.getAttribute("class")&&((e.target.classList.contains("title-wrap")||e.target.classList.contains("chat"))&&(quickEmoteMenu.obsCallback(),voiceMode.obsCallback(),"undefined"!=typeof pluginModule&&pluginModule.channelSwitch(),$(".message-group").each(function(){var e=$(this).find(".avatar-large");if(e.length>0)try{e.css("background-image").match(/\d+/).toString();botlist.indexOf(e)>-1&&$(this).find(".user-name").addClass("boticon")}catch(t){}})),-1!=e.target.getAttribute("class").indexOf("scroller messages"))){var t=$(".message-group").last();if(void 0!=t){var i=t.find(".avatar-large");if(i.length>0)try{botlist.indexOf(i.css("background-image").match(/\d+/).toString())>-1&&t.find(".user-name").addClass("boticon")}catch(o){}}"undefined"!=typeof pluginModule&&pluginModule.newMessage()}emoteModule.obsCallback(e)})}),mainObserver.observe(document,{childList:!0,subtree:!0})},Core.prototype.constructChangelog=function(){var e=''},Core.prototype.alert=function(e,t){$("body").append('")};var emotesFfz={},emotesBTTV={},emotesTwitch={emotes:{emote:{image_id:0}}},subEmotesTwitch={};EmoteModule.prototype.init=function(){},EmoteModule.prototype.getBlacklist=function(){$.getJSON("https://cdn.rawgit.com/Jiiks/betterDiscordApp/"+_hash+"/data/emotefilter.json",function(e){bemotes=e.blacklist})},EmoteModule.prototype.obsCallback=function(e){var t=this;if(settingsCookie["bda-es-7"]){$(".emoji").each(function(){var e=$(this);-1!=e.attr("src").indexOf(".png")&&e.replaceWith(""+e.attr("alt")+" ")});for(var i=0;i-1)return;return o.addClass("spoiler"),void o.on("click",function(){$(this).removeClass("spoiler"),spoilered.push($(this).attr("data-reactid"))})}if(!(t.length<4)){if("ClauZ"==t)return void(e=e.replace("ClauZ",' '));if(-1==$.inArray(t,bemotes)){if(emotesTwitch.emotes.hasOwnProperty(t)){var s=Math.round(t.length/4),a=t.substr(0,s)+""+t.substr(s,s)+""+t.substr(2*s,s)+""+t.substr(3*s),r=twitchEmoteUrlStart+emotesTwitch.emotes[t].image_id+twitchEmoteUrlEnd;return void(e=e.replace(t,''))}if("undefined"!=typeof emotesFfz&&settingsCookie["bda-es-1"]&&emotesFfz.hasOwnProperty(t)){var s=Math.round(t.length/4),a=t.substr(0,s)+""+t.substr(s,s)+""+t.substr(2*s,s)+""+t.substr(3*s),r=ffzEmoteUrlStart+emotesFfz[t]+ffzEmoteUrlEnd;return void(e=e.replace(t,''))}if("undefined"!=typeof emotesBTTV&&settingsCookie["bda-es-2"]&&emotesBTTV.hasOwnProperty(t)){var s=Math.round(t.length/4),a=t.substr(0,s)+""+t.substr(s,s)+""+t.substr(2*s,s)+""+t.substr(3*s),r=emotesBTTV[t];return void(e=e.replace(t,''))}if("undefined"!=typeof emotesBTTV2&&settingsCookie["bda-es-2"]&&emotesBTTV2.hasOwnProperty(t)){var s=Math.round(t.length/4),a=t.substr(0,s)+""+t.substr(s,s)+""+t.substr(2*s,s)+""+t.substr(3*s),r=bttvEmoteUrlStart+emotesBTTV2[t]+bttvEmoteUrlEnd;return void(e=e.replace(t,''))}if(subEmotesTwitch.hasOwnProperty(t)){var s=Math.round(t.length/4),a=t.substr(0,s)+""+t.substr(s,s)+""+t.substr(2*s,s)+""+t.substr(3*s),r=twitchEmoteUrlStart+subEmotesTwitch[t]+twitchEmoteUrlEnd;return void(e=e.replace(t,''))}}}}),null!=i.parentElement)){var o=i.parentElement.offsetHeight;i.innerHTML=e.replace(new RegExp("","g"),"");var n=i.parentElement.offsetHeight,s=$(".scroller.messages").first();s.scrollTop(s.scrollTop()+(n-o))}}}if("undefined"!=typeof emotesTwitch&&e.parentElement){var i=e.parentElement;if("SPAN"==i.tagName){var o=!1;$(i.parentElement).hasClass("edited")&&(i=i.parentElement.parentElement.firstChild,o=!0),o?setTimeout(t,250):t()}}},EmoteModule.prototype.autoCapitalize=function(){var e=this;$("body").delegate($(".channel-textarea-inner textarea"),"keyup change paste",function(){if(settingsCookie["bda-es-4"]){var t=$(".channel-textarea-inner textarea").val();if(void 0!=t){var i=t.split(" ").pop();if(i.length>3){if("danSgame"==i)return;var o=e.capitalize(i.toLowerCase());null!==o&&void 0!==o&&$(".channel-textarea-inner textarea").val(t.replace(i,o))}}}})},EmoteModule.prototype.capitalize=function(e){var t=emotesTwitch.emotes;for(var i in t)if(t.hasOwnProperty(i)&&e==(i+"").toLowerCase())return i};var publicServers={servers:{server:{code:0,icon:null,title:"title",language:"EN",description:"description"}}};PublicServers.prototype.getPanel=function(){return this.container},PublicServers.prototype.init=function(){var e=this;this.container=$("
",{id:"bd-ps-container",style:"display:none"});var t=$("
",{id:"bd-ps-header"});$(" ",{text:"Public Servers"}).appendTo(t),$(" ",{id:"bd-ps-close",style:"cursor:pointer;",text:"X"}).appendTo(t),t.appendTo(this.getPanel());var i=$("
",{id:"bd-ps-body"});i.appendTo(this.getPanel());var o=$("",{border:"0"}),n=$(" ");n.appendTo(o);var s=$(" ",{}).append($(" ",{text:"Name"})).append($(" ",{text:"Code"})).append($(" ",{text:"Language"})).append($(" ",{text:"Description"})).append($(" ",{text:"Join"}));s.appendTo(n);var a=$(" ",{id:"bd-ps-tbody"});a.appendTo(o),o.appendTo(i),$("body").append(this.getPanel()),$("#bd-ps-close").on("click",function(){e.show()});var r=publicServers.servers;for(var d in r)if(r.hasOwnProperty(d)){var l=r[d],c=l.code,p=l.title,u=l.language,m=l.description;this.addServer(d,c,p,u,m)}},PublicServers.prototype.addServer=function(e,t,i,o,n){var s=this,a=$("#bd-ps-tbody"),r=$(" ").append($("
",{"class":"bd-ps-description",text:n})),d=$(" ");d.append($(" ",{text:i})),d.append($(" ",{css:{"-webkit-user-select":"initial","user-select":"initial"},text:t})),d.append($(" ",{text:o})),d.append(r),d.append($(" ").append($(" ",{text:"Join",css:{height:"30px",display:"block","margin-top":"10px","background-color":"#36393E",border:"1px solid #404040",outline:"1px solid #000",color:"#EDEDED"},click:function(){s.joinServer(t)}}))),a.append(d)},PublicServers.prototype.show=function(){this.getPanel().toggle();var e=$("#bd-pub-li");e.removeClass(),this.getPanel().is(":visible")&&e.addClass("active")},PublicServers.prototype.joinServer=function(e){$(".guilds-add").click(),$(".action.join .btn").click(),$(".create-guild-container input").val(e),$(".form.join-server .btn-primary").click()};var emoteBtn,emoteMenu,eiarr=[1,3,4,6,7,8,10,11,12,13,14];QuickEmoteMenu.prototype.init=function(e){emoteBtn=null,$(".channel-textarea").first().removeClass("emotemenu-enabled"),emoteMenu||this.initEmoteList();var t;emoteBtn=$("
",{id:"twitchcord-button-container",style:"display:none"}).append($(" ",{id:"twitchcord-button",onclick:"return false;"})),$(".content.flex-spacer.flex-horizontal .flex-spacer.flex-vertical form").append(emoteBtn),emoteMenu.detach(),emoteBtn.append(emoteMenu),$("#twitchcord-button").on("click",function(){return t=!t,t?($("#bdemotemenustyle").html(".twitchcord-button-open { background-image:url(https://static-cdn.jtvnw.net/emoticons/v1/"+eiarr[Math.floor(Math.random()*eiarr.length)]+"/1.0) !important; }"),emoteMenu.addClass("emotemenu-open"),$(this).addClass("twitchcord-button-open")):(emoteMenu.removeClass(),$(this).removeClass()),!1}),$(document).off("click.bdem").on("click.bdem",function(){t&&(t=!t,emoteMenu.removeClass(),$("#twitchcord-button").removeClass())}),$("#emote-menu").on("click",function(){return $("#rmenu").hide(),!1}),settingsCookie["bda-es-0"]&&($(".channel-textarea").first().addClass("emotemenu-enabled"),emoteBtn.show());var i=$(".emote-icon");i.off(),i.on("click",function(){var e=$(this).attr("title"),t=$(".channel-textarea-inner textarea");t.val(" "==t.val().slice(-1)?t.val()+e:t.val()+" "+e)});var o=localStorage.bdfavemotes;void 0!=o&&(favoriteEmotes=JSON.parse(atob(o)),this.updateFavorites())};var bdfw={};QuickEmoteMenu.prototype.obsCallback=function(){if(emoteBtn&&$(".content.flex-spacer.flex-horizontal .flex-spacer.flex-vertical form")){var e=$("#twitchcord-button-container");void 0==e.parent().prop("tagName")&&(quickEmoteMenu=new QuickEmoteMenu,quickEmoteMenu.init(!0))}};var favoriteEmotes={};QuickEmoteMenu.prototype.initEmoteList=function(){emoteMenu=$("
",{id:"emote-menu"});var e=$("
",{id:"emote-menu-header"}),t=$("
",{id:"emote-menu-inner"}),i=$("
",{id:"emote-menu-inner-fav",css:{display:"none"}}),o=$("
",{"class":"emote-menu-tab emote-menu-tab-selected",id:"emgb",text:"Global",click:function(){$("#emfa").removeClass("emote-menu-tab-selected"),$("#emgb").addClass("emote-menu-tab-selected"),$("#emote-menu-inner-fav").hide(),$("#emote-menu-inner").show()}}),n=$("
",{"class":"emote-menu-tab",id:"emfa",text:"Favorite",click:function(){$("#emgb").removeClass("emote-menu-tab-selected"),$("#emfa").addClass("emote-menu-tab-selected"),$("#emote-menu-inner").hide(),$("#emote-menu-inner-fav").show()}});e.append(o),e.append(n),emoteMenu.append(e);var s=$("
",{"class":"scroller-wrap"}),a=$("
",{"class":"scroller"});s.append(a),a.append(t),a.append(i),emoteMenu.append(s);for(var r in emotesTwitch.emotes)if(emotesTwitch.emotes.hasOwnProperty(r)){var d=emotesTwitch.emotes[r].image_id;t.append($("
",{"class":"emote-container"}).append($(" ",{"class":"emote-icon",id:r,alt:"",src:"https://static-cdn.jtvnw.net/emoticons/v1/"+d+"/1.0",title:r})))}},QuickEmoteMenu.prototype.favorite=function(e,t){favoriteEmotes.hasOwnProperty(e)||(favoriteEmotes[e]=t),this.updateFavorites()},QuickEmoteMenu.prototype.updateFavorites=function(){$("#rmenu").length||($("body").append(''),$(document).on("click",function(){$("#rmenu").hide()}));var e=this,t=$("#emote-menu-inner-fav");t.empty();for(var i in favoriteEmotes){var o=favoriteEmotes[i],n=$("
",{"class":"emote-container"}),s=$(" ",{"class":"emote-icon",alt:"",src:o,title:i}).appendTo(n);t.append(n),s.off("click").on("click",function(e){var t=$(this).attr("title"),i=$(".channel-textarea-inner textarea");i.val(" "==i.val().slice(-1)?i.val()+t:i.val()+" "+t)}),s.off("contextmenu").on("contextmenu",function(t){var i=$(this).attr("title"),o=$("#rmenu");return o.find("a").off("click").on("click",function(){delete favoriteEmotes[i],e.updateFavorites()}),o.hide(),o.css({top:t.pageY,left:t.pageX}),o.show(),!1})}window.localStorage.bdfavemotes=btoa(JSON.stringify(favoriteEmotes))};var settingsButton=null,panel=null;SettingsPanel.prototype.init=function(){var e=this;e.construct();var t=$("body");settingsCookie["bda-es-0"]?$("#twitchcord-button-container").show():$("#twitchcord-button-container").hide(),settingsCookie["bda-gs-2"]?t.addClass("bd-minimal"):t.removeClass("bd-minimal"),settingsCookie["bda-gs-3"]?t.addClass("bd-minimal-chan"):t.removeClass("bd-minimal-chan"),settingsCookie["bda-gs-4"]&&voiceMode.enable(),settingsCookie["bda-jd"]&&(opublicServers.joinServer("0Tmfo5ZbORCRqbAd"),settingsCookie["bda-jd"]=!1,mainCore.saveSettings()),settingsCookie["bda-es-6"]?(emoteNamePopup=$(""),$(document).on("mouseover",".emote",function(){var e=$(this).offset(),t=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(t),$(emoteNamePopup).css("left",e.left-25),$(emoteNamePopup).css("top",e.top-32),$("div[data-reactid='.0.1.1']").append($(emoteNamePopup))}),$(document).on("mouseleave",".emote",function(){$(".tipsy").remove()})):$(document).off("mouseover",".emote")},SettingsPanel.prototype.applyCustomCss=function(e){0==$("#customcss").length&&$("head").append(''),$("#customcss").html(e),localStorage.setItem("bdcustomcss",btoa(e))};var customCssInitialized=!1,lastTab="";SettingsPanel.prototype.changeTab=function(e){var t=this;lastTab=e;var i=$("#bd-control-groups");switch($(".bd-tab").removeClass("selected"),$(".bd-pane").hide(),$("#"+e).addClass("selected"),$("#"+e.replace("tab","pane")).show(),e){case"bd-settings-tab":break;case"bd-customcss-tab":if(!customCssInitialized){var o=CodeMirror.fromTextArea(document.getElementById("bd-custom-css-ta"),{lineNumbers:!0,mode:"css",indentUnit:4,theme:"neat"});o.on("change",function(e){var i=e.getValue();t.applyCustomCss(i)}),customCssInitialized=!0}break;case"bd-plugins-tab":break;case"bd-themes-tab":i.html("Coming soon ")}},SettingsPanel.prototype.updateSetting=function(e){var t=$(e).children().find('input[type="checkbox"]'),i=!t.is(":checked"),o=t.attr("id");t.prop("checked",i),settingsCookie[o]=i,settingsCookie["bda-es-0"]?$("#twitchcord-button-container").show():$("#twitchcord-button-container").hide(),settingsCookie["bda-gs-2"]?$("body").addClass("bd-minimal"):$("body").removeClass("bd-minimal"),settingsCookie["bda-gs-3"]?$("body").addClass("bd-minimal-chan"):$("body").removeClass("bd-minimal-chan"),settingsCookie["bda-gs-1"]?$("#bd-pub-li").show():$("#bd-pub-li").hide(),settingsCookie["bda-gs-4"]?voiceMode.enable():voiceMode.disable(),settingsCookie["bda-es-6"]?(emoteNamePopup=$(""),$(document).on("mouseover",".emote",function(){var e=$(this).offset(),t=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(t),$(emoteNamePopup).css("left",e.left-25),$(emoteNamePopup).css("top",e.top-32),$("div[data-reactid='.0.1.1']").append($(emoteNamePopup))}),$(document).on("mouseleave",".emote",function(){$(".tipsy").remove()})):$(document).off("mouseover",".emote"),mainCore.saveSettings()},SettingsPanel.prototype.construct=function(){function e(){$(".tab-bar-item").removeClass("selected"),settingsButton.addClass("selected"),$(".form .settings-right .settings-inner").first().hide(),panel.show(),""==lastTab?i.changeTab("bd-settings-tab"):i.changeTab(lastTab)}function t(){$(".btn.btn-settings").length<1?setTimeout(t,100):$(".btn.btn-settings").first().on("click",function(){function e(){if($(".modal-inner").first().is(":visible")){panel.hide();var t=$(".tab-bar.SIDE").first();$(".tab-bar.SIDE .tab-bar-item").click(function(){$(".form .settings-right .settings-inner").first().show(),$("#bd-settings-new").removeClass("selected"),panel.hide()}),t.append(settingsButton),$(".form .settings-right .settings-inner").last().after(panel),$("#bd-settings-new").removeClass("selected")}else setTimeout(e,100)}e()})}var i=this;panel=$("
",{id:"bd-pane","class":"settings-inner",css:{display:"none"}});var o='',settingsButton=$("
",{"class":"tab-bar-item",text:"BetterDiscord",id:"bd-settings-new",click:e}),panel.html(o),t()};var _hash;Utils.prototype.getTextArea=function(){return $(".channel-textarea-inner textarea")},Utils.prototype.jqDefer=function(e){window.jQuery?e():setTimeout(function(){this.jqDefer(e)},100)},Utils.prototype.getHash=function(){$.getJSON("https://api.github.com/repos/Jiiks/BetterDiscordApp/commits/master",function(e){_hash=e.sha,emoteModule.getBlacklist()})},Utils.prototype.loadHtml=function(e,t){var i=$("
",{"class":"bd-container"}).appendTo("body");e="//cdn.rawgit.com/Jiiks/BetterDiscordApp/"+_hash+"/html/"+e+".html",i.load(e,t())},Utils.prototype.injectJs=function(e){$("",{type:"text/javascript",src:e}).appendTo($("body"))},Utils.prototype.injectCss=function(e){$(" ",{type:"text/css",rel:"stylesheet",href:e}).appendTo($("head"))},Utils.prototype.log=function(e){console.info("%c[BetterDiscord]%c "+e,"color:teal; font-weight:bold;","")},Utils.prototype.err=function(e){console.info("%c[BetterDiscord]%c "+e,"color:red; font-weight:bold;","")},VoiceMode.prototype.obsCallback=function(){var e=this;settingsCookie["bda-gs-4"]&&(e.disable(),setTimeout(function(){e.enable()},300))},VoiceMode.prototype.enable=function(){$(".scroller.guild-channels ul").first().css("display","none"),$(".scroller.guild-channels header").first().css("display","none"),$(".app.flex-vertical").first().css("overflow","hidden"),$(".chat.flex-vertical.flex-spacer").first().css("visibility","hidden").css("min-width","0px"),$(".flex-vertical.channels-wrap").first().css("flex-grow","100000"),$(".guild-header .btn.btn-hamburger").first().css("visibility","hidden")},VoiceMode.prototype.disable=function(){$(".scroller.guild-channels ul").first().css("display",""),$(".scroller.guild-channels header").first().css("display",""),$(".app.flex-vertical").first().css("overflow",""),$(".chat.flex-vertical.flex-spacer").first().css("visibility","").css("min-width",""),$(".flex-vertical.channels-wrap").first().css("flex-grow",""),$(".guild-header .btn.btn-hamburger").first().css("visibility","")};var pluginCookie={};PluginModule.prototype.loadPlugins=function(){this.loadPluginData(),$.each(bdplugins,function(){var e=this.plugin;e.load();var t=e.getName(),i=!1;pluginCookie.hasOwnProperty(t)?i=pluginCookie[t]:pluginCookie[t]=!1,i&&e.start()})},PluginModule.prototype.handlePlugin=function(e){var t=$(e).children().find('input[type="checkbox"]'),i=!t.is(":checked"),o=t.attr("id");t.prop("checked",i),i?(bdplugins[o].plugin.start(),pluginCookie[o]=!0):(bdplugins[o].plugin.stop(),pluginCookie[o]=!1),this.savePluginData()},PluginModule.prototype.showSettings=function(e){if(null!=bdplugins[e]&&"function"==typeof bdplugins[e].plugin.getSettingsPanel){var t=bdplugins[e].plugin.getSettingsPanel();$(".modal-inner").off("click.bdpsm").on("click.bdpsm",function(e){$("#bd-psm-id").length?$(".bd-psm").remove():$(".bd-psm").attr("id","bd-psm-id")}),$(".modal").append(''),$("#bd-psm-s").append(t)}},PluginModule.prototype.loadPluginData=function(){var e=$.cookie("bd-plugins");void 0!=e&&(pluginCookie=JSON.parse($.cookie("bd-plugins")))},PluginModule.prototype.savePluginData=function(){$.cookie("bd-plugins",JSON.stringify(pluginCookie),{expires:365,path:"/"})},PluginModule.prototype.newMessage=function(){$.each(bdplugins,function(){pluginCookie[this.plugin.getName()]&&"function"==typeof this.plugin.onMessage&&this.plugin.onMessage()})},PluginModule.prototype.channelSwitch=function(){$.each(bdplugins,function(){pluginCookie[this.plugin.getName()]&&"function"==typeof this.plugin.onSwitch&&this.plugin.onSwitch()})},PluginModule.prototype.socketEvent=function(e,t){$.each(bdplugins,function(){pluginCookie[this.plugin.getName()]&&"function"==typeof this.plugin.socketEvent&&this.plugin.socketEvent(t)})};var themeCookie={};ThemeModule.prototype.loadThemes=function(){this.loadThemeData(),$.each(bdthemes,function(){var e=this.name,t=!1;themeCookie.hasOwnProperty(e)?themeCookie[e]&&(t=!0):themeCookie[e]=!1,t&&$("head").append('")})},ThemeModule.prototype.handleTheme=function(e){var t=$(e).children().find('input[type="checkbox"]'),i=!t.is(":checked"),o=t.attr("id").substring(2);t.prop("checked",i),i?($("head").append('"),themeCookie[o]=!0):($("#"+o).remove(),themeCookie[o]=!1),this.saveThemeData()},ThemeModule.prototype.loadThemeData=function(){var e=$.cookie("bd-themes");void 0!=e&&(themeCookie=JSON.parse($.cookie("bd-themes")))},ThemeModule.prototype.saveThemeData=function(){$.cookie("bd-themes",JSON.stringify(themeCookie),{expires:365,path:"/"})};var bdSocket,bdws;BdWSocket.prototype.start=function(){var e=this;$.ajax({method:"GET",url:"https://discordapp.com/api/gateway",headers:{authorization:localStorage.token.match(/\"(.+)\"/)[1]
-},success:function(t){e.open(t.url)}})},BdWSocket.prototype.open=function(e){utils.log("Socket Host: "+e);try{bdSocket=new WebSocket(e),bdSocket.onopen=this.onOpen,bdSocket.onmessage=this.onMessage,bdSocket.onerror=this.onError,bdSocket.onclose=this.onClose}catch(t){utils.log(t)}},BdWSocket.prototype.onOpen=function(){utils.log("Socket Open");var e={op:2,d:{token:JSON.parse(localStorage.getItem("token")),properties:JSON.parse(localStorage.getItem("superProperties")),v:3}};bdws.send(e)},BdWSocket.prototype.onMessage=function(e){var t,i,o;try{t=JSON.parse(e.data),i=t.d,o=t.t}catch(n){return void utils.err(n)}switch(o){case"READY":bdSocket.interval=setInterval(function(){bdws.send({op:1,d:Date.now()})},i.heartbeat_interval),utils.log("Socket Ready");break;case"PRESENCE_UPDATE":pluginModule.socketEvent("PRESENCE_UPDATE",i);break;case"TYPING_START":pluginModule.socketEvent("TYPING_START",i);break;case"MESSAGE_CREATE":pluginModule.socketEvent("MESSAGE_CREATE",i);break;case"MESSAGE_UPDATE":pluginModule.socketEvent("MESSAGE_UPDATE",i)}},BdWSocket.prototype.onError=function(e){utils.log("Socket Error - "+e.message)},BdWSocket.prototype.onClose=function(e){utils.log("Socket Closed - "+e.code+" : "+e.reason),clearInterval(bdSocket.interval),bdws.start()},BdWSocket.prototype.send=function(e){1==bdSocket.readyState&&bdSocket.send(JSON.stringify(e))},BdWSocket.prototype.getSocket=function(){return bdSocket},BdApi.joinServer=function(e){opublicServers.joinServer(e)},BdApi.injectCSS=function(e,t){$("head").append(''),$("#"+e).html(t)},BdApi.clearCSS=function(e){$("#"+e).remove()},BdApi.getPlugin=function(e){return bdplugins.hasOwnProperty(e)?bdplugins[e].plugin:null},BdApi.getIpc=function(){return betterDiscordIPC},BdApi.getCore=function(){return mainCore},BdApi.getUserIdByName=function(e){for(var t=$(".member-username"),i=0;i 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();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");guilds.after($(" ",{id:"bd-pub-li",css:{"height":"20px","display":settingsCookie["bda-gs-1"]==true?"":"none"}}).append($("
",{class:"guild-inner",css:{"height":"20px","border-radius":"4px"}}).append($(" ").append($("
",{css:{"line-height":"20px","font-size":"12px"},text:"public",id:"bd-pub-button"})))));var showChannelsButton=$(" ",{class:"btn",id:"bd-show-channels",text:"R",css:{"cursor":"pointer"},click:function(){settingsCookie["bda-gs-3"]=false;$("body").removeClass("bd-minimal-chan");self.saveSettings();}});$(".guilds-wrapper").prepend(showChannelsButton);opublicServers=new PublicServers();pluginModule=new PluginModule();pluginModule.loadPlugins();if(typeof(themesupport2)!=="undefined"){themeModule=new ThemeModule();themeModule.loadThemes();}
+settingsPanel=new SettingsPanel();settingsPanel.init();quickEmoteMenu.init(false);$("#tc-settings-button").on("click",function(){settingsPanel.show();});$("#bd-pub-button").on("click",function(){opublicServers.show();});opublicServers.init();emoteModule.autoCapitalize();if(settingsCookie["version"].CodeMirror{ min-width:100%; }");$("head").append('');}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(mutation.target.getAttribute('class')!=null){if(mutation.target.classList.contains('title-wrap')||mutation.target.classList.contains('chat')){quickEmoteMenu.obsCallback();voiceMode.obsCallback();if(typeof pluginModule!=="undefined")pluginModule.channelSwitch();$(".message-group").each(function(){var a=$(this).find(".avatar-large");if(a.length>0){try{var b=a.css("background-image").match(/\d+/).toString();if(botlist.indexOf(a)>-1){$(this).find(".user-name").addClass("boticon");}}catch(err){}}});}
+if(mutation.target.getAttribute('class').indexOf('scroller messages')!=-1){var lastMessage=$(".message-group").last();if(lastMessage!=undefined){var a=lastMessage.find(".avatar-large");if(a.length>0){try{if(botlist.indexOf(a.css("background-image").match(/\d+/).toString())>-1){lastMessage.find(".user-name").addClass("boticon");}}catch(err){}}}
+if(typeof pluginModule!=="undefined")pluginModule.newMessage();}}
+emoteModule.obsCallback(mutation);});});mainObserver.observe(document,{childList:true,subtree:true});};Core.prototype.constructChangelog=function(){var changeLog=''+'';return changeLog;};Core.prototype.alert=function(title,text){$("body").append(''+'');};var emotesFfz={};var emotesBTTV={};var emotesTwitch={"emotes":{"emote":{"image_id":0}}};var subEmotesTwitch={};function EmoteModule(){}
+EmoteModule.prototype.init=function(){};EmoteModule.prototype.getBlacklist=function(){$.getJSON("https://cdn.rawgit.com/Jiiks/betterDiscordApp/"+_hash+"/data/emotefilter.json",function(data){bemotes=data.blacklist;});};EmoteModule.prototype.obsCallback=function(mutation){var self=this;if(!settingsCookie["bda-es-7"])return;$(".emoji").each(function(){var t=$(this);if(t.attr("src").indexOf(".png")!=-1){t.replaceWith(""+t.attr("alt")+" ");}});for(var i=0;i-1){return;}
+markup.addClass("spoiler");markup.on("click",function(){$(this).removeClass("spoiler");spoilered.push($(this).attr("data-reactid"));});return;}
+if(word.length<4){return;}
+if(word=="ClauZ"){parentInnerHTML=parentInnerHTML.replace("ClauZ",' ');return;}
+if($.inArray(word,bemotes)!=-1)return;if(emotesTwitch.emotes.hasOwnProperty(word)){var len=Math.round(word.length / 4);var name=word.substr(0,len)+"\uFDD9"+word.substr(len,len)+"\uFDD9"+word.substr(len*2,len)+"\uFDD9"+word.substr(len*3);var url=twitchEmoteUrlStart+emotesTwitch.emotes[word].image_id+twitchEmoteUrlEnd;parentInnerHTML=parentInnerHTML.replace(word,'');return;}
+if(typeof emotesFfz!=='undefined'&&settingsCookie["bda-es-1"]){if(emotesFfz.hasOwnProperty(word)){var len=Math.round(word.length / 4);var name=word.substr(0,len)+"\uFDD9"+word.substr(len,len)+"\uFDD9"+word.substr(len*2,len)+"\uFDD9"+word.substr(len*3);var url=ffzEmoteUrlStart+emotesFfz[word]+ffzEmoteUrlEnd;parentInnerHTML=parentInnerHTML.replace(word,'');return;}}
+if(typeof emotesBTTV!=='undefined'&&settingsCookie["bda-es-2"]){if(emotesBTTV.hasOwnProperty(word)){var len=Math.round(word.length / 4);var name=word.substr(0,len)+"\uFDD9"+word.substr(len,len)+"\uFDD9"+word.substr(len*2,len)+"\uFDD9"+word.substr(len*3);var url=emotesBTTV[word];parentInnerHTML=parentInnerHTML.replace(word,'');return;}}
+if(typeof emotesBTTV2!=='undefined'&&settingsCookie["bda-es-2"]){if(emotesBTTV2.hasOwnProperty(word)){var len=Math.round(word.length / 4);var name=word.substr(0,len)+"\uFDD9"+word.substr(len,len)+"\uFDD9"+word.substr(len*2,len)+"\uFDD9"+word.substr(len*3);var url=bttvEmoteUrlStart+emotesBTTV2[word]+bttvEmoteUrlEnd;parentInnerHTML=parentInnerHTML.replace(word,'');return;}}
+if(subEmotesTwitch.hasOwnProperty(word)){var len=Math.round(word.length / 4);var name=word.substr(0,len)+"\uFDD9"+word.substr(len,len)+"\uFDD9"+word.substr(len*2,len)+"\uFDD9"+word.substr(len*3);var url=twitchEmoteUrlStart+subEmotesTwitch[word]+twitchEmoteUrlEnd;parentInnerHTML=parentInnerHTML.replace(word,'');return;}});if(parent.parentElement==null)return;var oldHeight=parent.parentElement.offsetHeight;parent.innerHTML=parentInnerHTML.replace(new RegExp("\uFDD9","g"),"");var newHeight=parent.parentElement.offsetHeight;var scrollPane=$(".scroller.messages").first();scrollPane.scrollTop(scrollPane.scrollTop()+(newHeight-oldHeight));}
+if(edited){setTimeout(inject,250);}else{inject();}};EmoteModule.prototype.autoCapitalize=function(){var self=this;$('body').delegate($(".channel-textarea-inner textarea"),'keyup change paste',function(){if(!settingsCookie["bda-es-4"])return;var text=$(".channel-textarea-inner textarea").val();if(text==undefined)return;var lastWord=text.split(" ").pop();if(lastWord.length>3){if(lastWord=="danSgame")return;var ret=self.capitalize(lastWord.toLowerCase());if(ret!==null&&ret!==undefined){$(".channel-textarea-inner textarea").val(text.replace(lastWord,ret));}}});};EmoteModule.prototype.capitalize=function(value){var res=emotesTwitch.emotes;for(var p in res){if(res.hasOwnProperty(p)&&value==(p+'').toLowerCase()){return p;}}};var publicServers={"servers":{"server":{"code":0,"icon":null,"title":"title","language":"EN","description":"description"}}};function PublicServers(){}
+PublicServers.prototype.getPanel=function(){return this.container;};PublicServers.prototype.init=function(){var self=this;this.container=$("
",{id:"bd-ps-container",style:"display:none"});var header=$("
",{id:"bd-ps-header"});$(" ",{text:"Public Servers"}).appendTo(header);$(" ",{id:"bd-ps-close",style:"cursor:pointer;",text:"X"}).appendTo(header);header.appendTo(this.getPanel());var psbody=$("
",{id:"bd-ps-body"});psbody.appendTo(this.getPanel());var table=$("",{border:"0"});var thead=$(" ");thead.appendTo(table);var headers=$(" ",{}).append($(" ",{text:"Name"})).append($(" ",{text:"Code"})).append($(" ",{text:"Language"})).append($(" ",{text:"Description"})).append($(" ",{text:"Join"}));headers.appendTo(thead);var tbody=$(" ",{id:"bd-ps-tbody"});tbody.appendTo(table);table.appendTo(psbody);$("body").append(this.getPanel());$("#bd-ps-close").on("click",function(){self.show();});var servers=publicServers.servers;for(var server in servers){if(servers.hasOwnProperty(server)){var s=servers[server];var code=s.code;var title=s.title;var language=s.language;var description=s.description;this.addServer(server,code,title,language,description);}}};PublicServers.prototype.addServer=function(name,code,title,language,description){var self=this;var tableBody=$("#bd-ps-tbody");var desc=$(" ").append($("
",{class:"bd-ps-description",text:description}));var tr=$(" ");tr.append($(" ",{text:title}));tr.append($(" ",{css:{"-webkit-user-select":"initial","user-select":"initial"},text:code}));tr.append($(" ",{text:language}));tr.append(desc);tr.append($(" ").append($(" ",{text:"Join",css:{"height":"30px","display":"block","margin-top":"10px","background-color":"#36393E","border":"1px solid #404040","outline":"1px solid #000","color":"#EDEDED"},click:function(){self.joinServer(code);}})));tableBody.append(tr);};PublicServers.prototype.show=function(){this.getPanel().toggle();var li=$("#bd-pub-li");li.removeClass();if(this.getPanel().is(":visible")){li.addClass("active");}};PublicServers.prototype.joinServer=function(code){$(".guilds-add").click();$(".action.join .btn").click();$(".create-guild-container input").val(code);$(".form.join-server .btn-primary").click();};var emoteBtn,emoteMenu;var eiarr=[1,3,4,6,7,8,10,11,12,13,14];function QuickEmoteMenu(){}
+QuickEmoteMenu.prototype.init=function(reload){emoteBtn=null;$(".channel-textarea").first().removeClass("emotemenu-enabled");if(!emoteMenu){this.initEmoteList();}
+var menuOpen;emoteBtn=$("
",{id:"twitchcord-button-container",style:"display:none"}).append($(" ",{id:"twitchcord-button",onclick:"return false;"}));$(".content.flex-spacer.flex-horizontal .flex-spacer.flex-vertical form").append(emoteBtn);emoteMenu.detach();emoteBtn.append(emoteMenu);$("#twitchcord-button").on("click",function(){menuOpen=!menuOpen;if(menuOpen){$("#bdemotemenustyle").html('.twitchcord-button-open { background-image:url(https://static-cdn.jtvnw.net/emoticons/v1/'+eiarr[Math.floor(Math.random()*eiarr.length)]+'/1.0) !important; }');emoteMenu.addClass("emotemenu-open");$(this).addClass("twitchcord-button-open");}else{emoteMenu.removeClass();$(this).removeClass();}
+return false;});$(document).off("click.bdem").on("click.bdem",function(){if(menuOpen){menuOpen=!menuOpen;emoteMenu.removeClass();$("#twitchcord-button").removeClass();}});$("#emote-menu").on("click",function(){$("#rmenu").hide();return false;});if(settingsCookie["bda-es-0"]){$(".channel-textarea").first().addClass("emotemenu-enabled");emoteBtn.show();}
+var emoteIcon=$(".emote-icon");emoteIcon.off();emoteIcon.on("click",function(){var emote=$(this).attr("title");var ta=$(".channel-textarea-inner textarea");ta.val(ta.val().slice(-1)==" "?ta.val()+emote:ta.val()+" "+emote);});var fe=localStorage["bdfavemotes"];if(fe!=undefined){favoriteEmotes=JSON.parse(atob(fe));this.updateFavorites();}};var bdfw={};QuickEmoteMenu.prototype.obsCallback=function(){if(!emoteBtn)return;if(!$(".content.flex-spacer.flex-horizontal .flex-spacer.flex-vertical form"))return;var tcbtn=$("#twitchcord-button-container");if(tcbtn.parent().prop("tagName")==undefined){quickEmoteMenu=new QuickEmoteMenu();quickEmoteMenu.init(true);}};var favoriteEmotes={};QuickEmoteMenu.prototype.initEmoteList=function(){emoteMenu=$("
",{id:"emote-menu"});var emoteMenuHeader=$("
",{id:"emote-menu-header"});var emoteMenuBody=$("
",{id:"emote-menu-inner"});var emoteMenuBodyFav=$("
",{id:"emote-menu-inner-fav",css:{"display":"none"}});var globalTab=$("
",{class:"emote-menu-tab emote-menu-tab-selected",id:"emgb",text:"Global",click:function(){$("#emfa").removeClass("emote-menu-tab-selected");$("#emgb").addClass("emote-menu-tab-selected");$("#emote-menu-inner-fav").hide();$("#emote-menu-inner").show();}});var favoriteTab=$("
",{class:"emote-menu-tab",id:"emfa",text:"Favorite",click:function(){$("#emgb").removeClass("emote-menu-tab-selected");$("#emfa").addClass("emote-menu-tab-selected");$("#emote-menu-inner").hide();$("#emote-menu-inner-fav").show();}});emoteMenuHeader.append(globalTab);emoteMenuHeader.append(favoriteTab);emoteMenu.append(emoteMenuHeader);var swrapper=$("
",{class:"scroller-wrap"});var scroller=$("
",{class:"scroller"});swrapper.append(scroller);scroller.append(emoteMenuBody);scroller.append(emoteMenuBodyFav);emoteMenu.append(swrapper);for(var emote in emotesTwitch.emotes){if(emotesTwitch.emotes.hasOwnProperty(emote)){var id=emotesTwitch.emotes[emote].image_id;emoteMenuBody.append($("
",{class:"emote-container"}).append($(" ",{class:"emote-icon",id:emote,alt:"",src:"https://static-cdn.jtvnw.net/emoticons/v1/"+id+"/1.0",title:emote})));}}};QuickEmoteMenu.prototype.favorite=function(name,url){if(!favoriteEmotes.hasOwnProperty(name)){favoriteEmotes[name]=url;}
+this.updateFavorites();};QuickEmoteMenu.prototype.updateFavorites=function(){if(!$("#rmenu").length){$("body").append('');$(document).on("click",function(){$("#rmenu").hide();});}
+var self=this;var emoteMenuBody=$("#emote-menu-inner-fav");emoteMenuBody.empty();for(var emote in favoriteEmotes){var url=favoriteEmotes[emote];var econtainer=$("
",{class:"emote-container"});var icon=$(" ",{class:"emote-icon",alt:"",src:url,title:emote}).appendTo(econtainer);emoteMenuBody.append(econtainer);icon.off("click").on("click",function(e){var emote=$(this).attr("title");var ta=$(".channel-textarea-inner textarea");ta.val(ta.val().slice(-1)==" "?ta.val()+emote:ta.val()+" "+emote);});icon.off("contextmenu").on("contextmenu",function(e){var title=$(this).attr("title");var menu=$("#rmenu");menu.find("a").off("click").on("click",function(){delete favoriteEmotes[title];self.updateFavorites();});menu.hide();menu.css({top:e.pageY,left:e.pageX});menu.show();return false;});}
+window.localStorage["bdfavemotes"]=btoa(JSON.stringify(favoriteEmotes));};var settingsButton=null;var panel=null;function SettingsPanel(){utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.9.0/codemirror.min.js");utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.9.0/mode/css/css.min.js");utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.4.2/Sortable.min.js");}
+SettingsPanel.prototype.init=function(){var self=this;self.construct();var body=$("body");if(settingsCookie["bda-es-0"]){$("#twitchcord-button-container").show();}else{$("#twitchcord-button-container").hide();}
+if(settingsCookie["bda-gs-2"]){body.addClass("bd-minimal");}else{body.removeClass("bd-minimal");}
+if(settingsCookie["bda-gs-3"]){body.addClass("bd-minimal-chan");}else{body.removeClass("bd-minimal-chan");}
+if(settingsCookie["bda-gs-4"]){voiceMode.enable();}
+if(settingsCookie["bda-es-6"]){emoteNamePopup=$("");$(document).on("mouseover",".emote",function(){var x=$(this).offset();var title=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(title);$(emoteNamePopup).css('left',x.left-25);$(emoteNamePopup).css('top',x.top-32);$("div[data-reactid='.0.1.1']").append($(emoteNamePopup));});$(document).on("mouseleave",".emote",function(){$(".tipsy").remove();});}else{$(document).off('mouseover','.emote');}};SettingsPanel.prototype.applyCustomCss=function(css){if($("#customcss").length==0){$("head").append('');}
+$("#customcss").html(css);localStorage.setItem("bdcustomcss",btoa(css));};var customCssInitialized=false;var lastTab="";SettingsPanel.prototype.changeTab=function(tab){var self=this;lastTab=tab;var controlGroups=$("#bd-control-groups");$(".bd-tab").removeClass("selected");$(".bd-pane").hide();$("#"+tab).addClass("selected");$("#"+tab.replace("tab","pane")).show();switch(tab){case"bd-settings-tab":break;case"bd-customcss-tab":if(!customCssInitialized){var editor=CodeMirror.fromTextArea(document.getElementById("bd-custom-css-ta"),{lineNumbers:true,mode:'css',indentUnit:4,theme:'neat'});editor.on("change",function(cm){var css=cm.getValue();self.applyCustomCss(css);});customCssInitialized=true;}
+break;case"bd-plugins-tab":break;case"bd-themes-tab":controlGroups.html("Coming soon ");break;}};SettingsPanel.prototype.updateSetting=function(checkbox){var cb=$(checkbox).children().find('input[type="checkbox"]');var enabled=!cb.is(":checked");var id=cb.attr("id");cb.prop("checked",enabled);settingsCookie[id]=enabled;if(settingsCookie["bda-es-0"]){$("#twitchcord-button-container").show();}else{$("#twitchcord-button-container").hide();}
+if(settingsCookie["bda-gs-2"]){$("body").addClass("bd-minimal");}else{$("body").removeClass("bd-minimal");}
+if(settingsCookie["bda-gs-3"]){$("body").addClass("bd-minimal-chan");}else{$("body").removeClass("bd-minimal-chan");}
+if(settingsCookie["bda-gs-1"]){$("#bd-pub-li").show();}else{$("#bd-pub-li").hide();}
+if(settingsCookie["bda-gs-4"]){voiceMode.enable();}else{voiceMode.disable();}
+if(settingsCookie["bda-es-6"]){emoteNamePopup=$("");$(document).on("mouseover",".emote",function(){var x=$(this).offset();var title=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(title);$(emoteNamePopup).css('left',x.left-25);$(emoteNamePopup).css('top',x.top-32);$("div[data-reactid='.0.1.1']").append($(emoteNamePopup));});$(document).on("mouseleave",".emote",function(){$(".tipsy").remove();});}else{$(document).off('mouseover','.emote');}
+mainCore.saveSettings();};SettingsPanel.prototype.construct=function(){var self=this;panel=$("
",{id:"bd-pane",class:"settings-inner",css:{"display":"none"}});var settingsInner=''+'';function showSettings(){$(".tab-bar-item").removeClass("selected");settingsButton.addClass("selected");$(".form .settings-right .settings-inner").first().hide();panel.show();if(lastTab==""){self.changeTab("bd-settings-tab");}else{self.changeTab(lastTab);}}
+settingsButton=$("
",{class:"tab-bar-item",text:"BetterDiscord",id:"bd-settings-new",click:showSettings});panel.html(settingsInner);function defer(){if($(".btn.btn-settings").length<1){setTimeout(defer,100);}else{$(".btn.btn-settings").first().on("click",function(){function innerDefer(){if($(".modal-inner").first().is(":visible")){panel.hide();var tabBar=$(".tab-bar.SIDE").first();$(".tab-bar.SIDE .tab-bar-item").click(function(){$(".form .settings-right .settings-inner").first().show();$("#bd-settings-new").removeClass("selected");panel.hide();});tabBar.append(settingsButton);$(".form .settings-right .settings-inner").last().after(panel);$("#bd-settings-new").removeClass("selected");}else{setTimeout(innerDefer,100);}}
+innerDefer();});}}
+defer();};var _hash;function Utils(){}
+Utils.prototype.getTextArea=function(){return $(".channel-textarea-inner textarea");};Utils.prototype.jqDefer=function(fnc){if(window.jQuery){fnc();}else{setTimeout(function(){this.jqDefer(fnc);},100);}};Utils.prototype.getHash=function(){$.getJSON("https://api.github.com/repos/Jiiks/BetterDiscordApp/commits/master",function(data){_hash=data.sha;emoteModule.getBlacklist();});};Utils.prototype.loadHtml=function(html,callback){var container=$("
",{class:"bd-container"}).appendTo("body");html='//cdn.rawgit.com/Jiiks/BetterDiscordApp/'+_hash+'/html/'+html+'.html';container.load(html,callback());};Utils.prototype.injectJs=function(uri){$("",{type:"text/javascript",src:uri}).appendTo($("body"));};Utils.prototype.injectCss=function(uri){$(" ",{type:"text/css",rel:"stylesheet",href:uri}).appendTo($("head"));};Utils.prototype.log=function(message){console.info("%c[BetterDiscord]%c "+message,"color:teal; font-weight:bold;","");};Utils.prototype.err=function(message){console.info("%c[BetterDiscord]%c "+message,"color:red; font-weight:bold;","");};function VoiceMode(){}
+VoiceMode.prototype.obsCallback=function(){var self=this;if(settingsCookie["bda-gs-4"]){self.disable();setTimeout(function(){self.enable();},300);}};VoiceMode.prototype.enable=function(){$(".scroller.guild-channels ul").first().css("display","none");$(".scroller.guild-channels header").first().css("display","none");$(".app.flex-vertical").first().css("overflow","hidden");$(".chat.flex-vertical.flex-spacer").first().css("visibility","hidden").css("min-width","0px");$(".flex-vertical.channels-wrap").first().css("flex-grow","100000");$(".guild-header .btn.btn-hamburger").first().css("visibility","hidden");};VoiceMode.prototype.disable=function(){$(".scroller.guild-channels ul").first().css("display","");$(".scroller.guild-channels header").first().css("display","");$(".app.flex-vertical").first().css("overflow","");$(".chat.flex-vertical.flex-spacer").first().css("visibility","").css("min-width","");$(".flex-vertical.channels-wrap").first().css("flex-grow","");$(".guild-header .btn.btn-hamburger").first().css("visibility","");};var pluginCookie={};function PluginModule(){}
+PluginModule.prototype.loadPlugins=function(){this.loadPluginData();$.each(bdplugins,function(){var plugin=this["plugin"];plugin.load();var name=plugin.getName();var enabled=false;if(pluginCookie.hasOwnProperty(name)){enabled=pluginCookie[name];}else{pluginCookie[name]=false;}
+if(enabled){plugin.start();}});};PluginModule.prototype.handlePlugin=function(checkbox){var cb=$(checkbox).children().find('input[type="checkbox"]');var enabled=!cb.is(":checked");var id=cb.attr("id");cb.prop("checked",enabled);if(enabled){bdplugins[id]["plugin"].start();pluginCookie[id]=true;}else{bdplugins[id]["plugin"].stop();pluginCookie[id]=false;}
+this.savePluginData();};PluginModule.prototype.showSettings=function(plugin){if(bdplugins[plugin]!=null){if(typeof bdplugins[plugin].plugin.getSettingsPanel==="function"){var panel=bdplugins[plugin].plugin.getSettingsPanel();$(".modal-inner").off("click.bdpsm").on("click.bdpsm",function(e){if($("#bd-psm-id").length){$(".bd-psm").remove();}else{$(".bd-psm").attr("id","bd-psm-id");}});$(".modal").append('');$("#bd-psm-s").append(panel);}}};PluginModule.prototype.loadPluginData=function(){var cookie=$.cookie("bd-plugins");if(cookie!=undefined){pluginCookie=JSON.parse($.cookie("bd-plugins"));}};PluginModule.prototype.savePluginData=function(){$.cookie("bd-plugins",JSON.stringify(pluginCookie),{expires:365,path:'/'});};PluginModule.prototype.newMessage=function(){$.each(bdplugins,function(){if(!pluginCookie[this.plugin.getName()])return;if(typeof this.plugin.onMessage==="function"){this.plugin.onMessage();}});};PluginModule.prototype.channelSwitch=function(){$.each(bdplugins,function(){if(!pluginCookie[this.plugin.getName()])return;if(typeof this.plugin.onSwitch==="function"){this.plugin.onSwitch();}});};PluginModule.prototype.socketEvent=function(e,data){$.each(bdplugins,function(){if(!pluginCookie[this.plugin.getName()])return;if(typeof this.plugin.socketEvent==="function"){this.plugin.socketEvent(data);}});};var themeCookie={};function ThemeModule(){}
+ThemeModule.prototype.loadThemes=function(){this.loadThemeData();$.each(bdthemes,function(){var name=this["name"];var enabled=false;if(themeCookie.hasOwnProperty(name)){if(themeCookie[name]){enabled=true;}}else{themeCookie[name]=false;}
+if(enabled){$("head").append('');}});};ThemeModule.prototype.handleTheme=function(checkbox){var cb=$(checkbox).children().find('input[type="checkbox"]');var enabled=!cb.is(":checked");var id=cb.attr("id").substring(2);cb.prop("checked",enabled);if(enabled){$("head").append('');themeCookie[id]=true;}else{$("#"+id).remove();themeCookie[id]=false;}
+this.saveThemeData();};ThemeModule.prototype.loadThemeData=function(){var cookie=$.cookie("bd-themes");if(cookie!=undefined){themeCookie=JSON.parse($.cookie("bd-themes"));}};ThemeModule.prototype.saveThemeData=function(){$.cookie("bd-themes",JSON.stringify(themeCookie),{expires:365,path:'/'});};var bdSocket;var bdws;function BdWSocket(){bdws=this;}
+BdWSocket.prototype.start=function(){var self=this;$.ajax({method:"GET",url:"https://discordapp.com/api/gateway",headers:{authorization:localStorage.token.match(/\"(.+)\"/)[1]},success:function(data){self.open(data.url);}});};BdWSocket.prototype.open=function(host){utils.log("Socket Host: "+host);try{bdSocket=new WebSocket(host);bdSocket.onopen=this.onOpen;bdSocket.onmessage=this.onMessage;bdSocket.onerror=this.onError;bdSocket.onclose=this.onClose;}catch(err){utils.log(err);}};BdWSocket.prototype.onOpen=function(){utils.log("Socket Open");var data={op:2,d:{token:JSON.parse(localStorage.getItem('token')),properties:JSON.parse(localStorage.getItem('superProperties')),v:3}};bdws.send(data);};BdWSocket.prototype.onMessage=function(e){var packet,data,type;try{packet=JSON.parse(e.data);data=packet.d;type=packet.t;}catch(err){utils.err(err);return;}
+switch(type){case"READY":bdSocket.interval=setInterval(function(){bdws.send({op:1,d:Date.now()});},data.heartbeat_interval);utils.log("Socket Ready");break;case"PRESENCE_UPDATE":pluginModule.socketEvent("PRESENCE_UPDATE",data);break;case"TYPING_START":pluginModule.socketEvent("TYPING_START",data);break;case"MESSAGE_CREATE":pluginModule.socketEvent("MESSAGE_CREATE",data);break;case"MESSAGE_UPDATE":pluginModule.socketEvent("MESSAGE_UPDATE",data);break;default:break;}};BdWSocket.prototype.onError=function(e){utils.log("Socket Error - "+e.message);};BdWSocket.prototype.onClose=function(e){utils.log("Socket Closed - "+e.code+" : "+e.reason);clearInterval(bdSocket.interval);bdws.start();};BdWSocket.prototype.send=function(data){if(bdSocket.readyState==1){bdSocket.send(JSON.stringify(data));}};BdWSocket.prototype.getSocket=function(){return bdSocket;};function BdApi(){}
+BdApi.joinServer=function(code){opublicServers.joinServer(code);};BdApi.injectCSS=function(id,css){$("head").append('');$("#"+id).html(css);};BdApi.clearCSS=function(id){$("#"+id).remove();};BdApi.getPlugin=function(name){if(bdplugins.hasOwnProperty(name)){return bdplugins[name]["plugin"];}
+return null;};BdApi.getIpc=function(){return betterDiscordIPC;};BdApi.getCore=function(){return mainCore;};BdApi.getUserIdByName=function(name){var users=$(".member-username");for(var i=0;i