Discord ᅟhas updated to prevent users from easily opening the console in their client. For the reason, you have to do first before you open the console:
- Open the file in the following path:
- Windows:
%APPDATA%\Discord\settings.json
- macOS: (In macOS' case, the first or second may not exist but that's fine. If it exist, proceed with this work for only the file in one path.)
~/Library/Application Support/Discord/settings.json
or/Library/Application Support/Discord/settings.json
- Linux: (Also in Linux's case, proceed that like macOS.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var hideBlockedMessage = setInterval(() => { | |
document.querySelectorAll('div[class^="groupStart"]') // Get all the 'Blocked message's | |
.forEach(blockMsg => blockMsg.hidden ? void undefined : blockMsg.hidden = true) // Then change 'hidden' value of the tags to true if it isn't hidden | |
}, 50); // period; You can remove this value, but it may be increase stress on the browser or client | |
// clearInterval(hideBlockedMessage); | |
// If you want to show the blocked message again, you can run this code. Then go to other channel and come back, you'll see the hidden message. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.jsoup.Jsoup; | |
import org.jsoup.nodes.Element; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class Main { | |
public static void main(String[] args) throws IOException { | |
String format = "%-6s %-5s %s\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getHKLevelRank(timeout) { | |
if (timeout === undefined) timeout = 5000; | |
const format = "%-6s %-5s %s\n", | |
rankData = org.jsoup.Jsoup.connect("https://leaderboard.hkdev.services/") | |
.timeout(timeout).get() | |
.getElementsByClass("table table-hover table-condensed").select("tr"); | |
let result = ""; | |
for (let i = 0; i < rankData.size(); i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.noeul.hk.client; | |
import com.sun.java.swing.plaf.windows.WindowsLookAndFeel; | |
import com.sun.javafx.application.PlatformImpl; | |
import javafx.embed.swing.JFXPanel; | |
import javafx.scene.Group; | |
import javafx.scene.Scene; | |
import javafx.scene.web.WebEngine; | |
import javafx.scene.web.WebView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(this.disablePingToDefault = () => { | |
this.disablePingToDefault.interval = setInterval(() => { | |
if (this.disablePingToDefault.currentUrl !== location.href) { // Cached url is not equal to 'location.href', do the following: | |
if (this.disablePingToDefault.observer !== undefined) // If an observer which created at previous is exist, | |
this.disablePingToDefault.observer.disconnect(); // disconnect it. | |
else { // If it wasn't, | |
// Create new instance to detect insertion of the reply box. | |
this.disablePingToDefault.observer = new MutationObserver(() => { | |
let pingButton = document.querySelector('div[class*="mentionButton"]'); // Get ping switch in reply box. | |
if (pingButton !== null) pingButton.click(); // Click if it's not null. Then reply ping will be disable. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Class = java.lang.Class, | |
JavaArray = java.lang.reflect.Array; | |
let jarFiles = JavaArray.newInstance(Class.forName("java.net.URL"), 1); | |
JavaArray.set(jarFiles, 0, new java.io.File("HKLeaderboard-1.0.0.jar").toURI().toURL()); | |
const Enum = java.lang.Enum, | |
Integer = java.lang.Integer, | |
JavaString = java.lang.String; | |
let classLoader = java.net.URLClassLoader.newInstance(jarFiles), | |
leaderBoardClass = Class.forName("com.noeul.discord.hk.leaderboard.Leaderboard", true, classLoader), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.hideChannelNotice = setInterval(() => { | |
if (this.hideChannelNotice.currentUrl !== location.href) { // Cached url is not equal to location.href, do the following: | |
let $ = document.querySelector("div[class|=channelNotice]"); // Get channel notice box in channel navigation bar. | |
if ($ !== null) $.hidden = true; // Hide in display if it's not null. | |
this.hideChannelNotice.currentUrl = location.href; // Then cache current url. | |
} | |
}, 50); // I set 50 millis delay for waiting time. This task will be run every 50 milliseconds. | |
this.showChannelNotice = () => { // This function changes to original setting; If you wanna change it that way, you can input 'showChannelNotice();' into the console. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Notice: This code is no longer working and deprecated | |
(( | |
$, | |
f = n => Object.values($._dispatcher._actionHandlers._dependencyGraph.nodes) | |
.find($ => $.name == n) | |
.actionHandler.CONNECTION_OPEN | |
) => { | |
try { | |
f`ExperimentStore`({ user: { flags: ++$.getCurrentUser().flags }, type: "CONNECTION_OPEN" }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The userscript file to grant all archievements w/o uncomfortable work | |
// This will be kept forever, once applied. | |
// After application, you will need to reload Discord. | |
($ => { | |
$.contentWindow.localStorage.PoggermodeAchievementStore = JSON.stringify({ | |
_state: { | |
unlockedAchievements: [...Array(20)].map((_, i) => ({ achievementId: i, dateUnlocked: 0 })) | |
// You can set value of 'dateUnlocked' to current time with the code 'Date.now()' instead of '0'. | |
}, |
OlderNewer