Discord Custom Badges

Add custom badges.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name            Discord Custom Badges
// @description     Add custom badges.
// @version         1.0.1
// @author          roxasytb
// @namespace       https://github.com/RoxasYTB/
// @match           https://*.discord.com/app
// @match           https://*.discord.com/channels/*
// @match           https://*.discord.com/login
// @license         MIT
// @icon            https://cdn.discordapp.com/emojis/1118860094575218708.webp?size=128
// @grant           none
// ==/UserScript==
(function () {
	'use strict';
let _mods;
webpackChunkdiscord_app.push([[Symbol()], {}, (r) => (_mods = r.c)]);
webpackChunkdiscord_app.pop();
let findByProps = (...props) => {
	for (let m of Object.values(_mods)) {
		try {
			if (!m.exports || m.exports === window) continue;
			if (props.every((x) => m.exports?.[x])) return m.exports;

			for (let ex in m.exports) {
				if (props.every((x) => m.exports?.[ex]?.[x])) return m.exports[ex];
			}
		} catch {}
	}
};

setInterval(()=>{
    myId=findByProps("getCurrentUser").getCurrentUser().id
    if(findByProps("getUserProfile").getUserProfile(myId) && findByProps("getUserProfile").getUserProfile(myId).badges.length<7)
    findByProps("getUserProfile").getUserProfile(myId).badges.splice(0,0,{id:"certified_moderator",description:"Anciens des programmes de modération", icon:"https://cdn.discordapp.com/emojis/1026532993923293184.webp?size=128&quality=lossless",link:"https://discord.com/safety"});
},500)
})();