more plugins

This commit is contained in:
Cynthia Foxwell 2018-05-13 19:01:34 -06:00
parent 88baf7a5bc
commit a46ddb6c23
4 changed files with 95 additions and 3 deletions

View file

@ -0,0 +1,21 @@
bdwatcher = null, bdtag = null, setupCSS = function (n) {
var e = fs.readFileSync(n, "utf-8");
null === bdtag && (bdtag = document.createElement("style"), document.head.appendChild(bdtag)), bdtag.innerHTML = e, null === bdwatcher && (bdwatcher = fs.watch(n, {
encoding: "utf-8"
}, function (e, w) {
if ("change" === e) {
var i = fs.readFileSync(n, "utf-8");
bdtag.innerHTML = i
}
}))
};
exports.meta = {
author: "dr1ft",
name: "BeautifulDiscord Port",
desc: "Allows CSS to be imported and updated on the fly."
},
exports.start = () => {
if (fs.existsSync($api.data + 'style.css'))
setupCSS($api.data + 'style.css');
}

58
plugins/guildcount.js Normal file
View file

@ -0,0 +1,58 @@
function formattedGuildCount(shortened) {
const guildCount = document.querySelectorAll(".guild > div[draggable=true]").length;
return `${guildCount} Guilds`;
}
function setupServerCount() {
if (document.querySelector(".server-count")) return;
let gc = document.createElement("div");
gc.className = "server-count";
let glist = document.querySelector(".friends-online");
if (!glist) return;
glist.parentNode.insertBefore(gc, glist.nextSibling);
}
function updateServerCount() {
if (document.querySelector(".server-count") && document.querySelector(".server-count").innerHTML == formattedGuildCount()) return;
document.querySelector(".server-count").innerHTML = formattedGuildCount();
}
function scCSS() {
let css = document.createElement("style");
css.type = "text/css";
css.id = "css-scount";
css.innerHTML = `.server-count {
color: hsla(0,0%,100%,.3);
font-size: 10px;
font-weight: 500;
line-height: 130%;
margin: 10px 0;
text-align: center;
text-transform: uppercase;
white-space: nowrap;
width: 50px;
word-wrap: normal;
}`;
document.body.appendChild(css);
}
exports.meta = {
author: "Cynosphere",
name: "Guild Count",
desc: "Shows guild count under online count."
}
exports.start = () => {
scCSS();
let observer = new MutationObserver(() => {
setupServerCount();
updateServerCount();
});
observer.observe(document.querySelector("div[class*=\"app-\"]"), {
childList: true,
subtree: true
});
}

View file

@ -1,15 +1,15 @@
exportsexports = { exportsexports = {
meta: { meta: {
author: "Cynosphere", author: "Cynosphere, janeptrv",
name: "osu! Typing", name: "osu! Typing",
desc: "Adds typing sounds from osu!." desc: "Adds typing sounds from osu!."
}, },
start: function(){ start: function(){
var sounds = []; var sounds = [];
for (var i = 1; i < 4; i++) { for (var i = 1; i < 4; i++) {
sounds.push(new Audio(`https://github.com/statefram/sounds/blob/master/osu_typing_click${i}.wav?raw=true`)); sounds.push(new Audio(`https://github.com/janeptrv/sounds/blob/master/osu_typing_click${i}.wav?raw=true`));
} }
const backspace = new Audio("https://github.com/statefram/sounds/blob/master/osu_typing_erase.wav?raw=true"); const backspace = new Audio("https://github.com/janeptrv/sounds/blob/master/osu_typing_erase.wav?raw=true");
var keys = {}; var keys = {};
function typingSound(ev) { function typingSound(ev) {

13
plugins/sailboat.js Normal file
View file

@ -0,0 +1,13 @@
exports.meta = {
author: "BlockBuilder57, Cynosphere",
name: "Sailboat",
desc: "Login as bot accounts."
}
exports.replacements = {
'/i.default.Store.pauseEmittingChanges\\(\\),t.user.bot/':'false',
'/.\\._reset\\(!0,1e3,"Disconnect requested by user"\\)/':'console.log("delightfully devilish seymour")',
'/\\.experiments;v={},t\\.forEach/':'.experiments;if(t==undefined) return;v={},t.forEach',
'/CONNECTION_OPEN:function\\(e\\){f=e\\.connected/':'CONNECTION_OPEN:function(e){if(e.connectedAccounts==undefined) return; f=e.connected',
'/function S\\(e\\){var t=arguments/':'function S(e){if(e==undefined) return; var t=arguments',
'totalUnavailableGuilds,n=[];':'totalUnavailableGuilds,n=[];if(e.readState==undefined) return;'
}